Why Spatial referencing information is missing or not readable directly from ENVI format data?

6 次查看(过去 30 天)
I have created ENVI formatted data along with its header file. I can open it in ENVI software and even extracted the data using shape file manually. However, when I tried to extract the data using same shape file from MATLAB code given below;
[img, R] = readgeoraster(img_file.name);
% Verify if R contains the necessary spatial referencing information
if isempty(R)
error('Spatial referencing information is missing or not readable directly.');
end
It gives following error
Spatial referencing information is missing or not readable directly
I am attaching the ENVI header file and request you to please suggest me how to use it.
Chahar

回答(1 个)

Cris LaPierre
Cris LaPierre 2024-5-8
编辑:Cris LaPierre 2024-5-8
After hearing from the corresponding internal team, it was discovered that the map info parameter in your headerfile is not formatted correctly for UTM projection data. Replace it with the following:
map info = {UTM, 0.500000, 0.500000, 712580.000000, 3216500.000000, 20.000000, 20.000000, 43, north, WGS-84, units=Meters}
You can then load and view your data using code similar to this:
[A, R] = readgeoraster("Bagpat_20230613T052649_7Bands.dat");
mapshow(rescale(A(:,:,[3 2 1])),R)
  3 个评论
Cris LaPierre
Cris LaPierre 2024-5-9
编辑:Cris LaPierre 2024-5-9
Please ask a new question, as that is a different topic from this one. Consider zipping and sharing the shapeful file when you do so people can help. You also seem to be using a different dat file. It would be helpufl to share that, too.
Include any error messages you are getting, what specific data you want to extract, etc
Your code looks very similar to what was answered in this post, so perhaps start by looking there?
gauri
gauri 2024-5-9
I have posted a new question as follows;
https://in.mathworks.com/matlabcentral/answers/2116911-how-do-i-extract-the-multiband-data-using-shape-file

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by