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

6 visualizaciones (últimos 30 días)
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

Respuestas (1)

Cris LaPierre
Cris LaPierre el 8 de Mayo de 2024
Editada: Cris LaPierre el 8 de Mayo de 2024
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 comentarios
Cris LaPierre
Cris LaPierre el 9 de Mayo de 2024
Editada: Cris LaPierre el 9 de Mayo de 2024
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 el 9 de Mayo de 2024
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

Iniciar sesión para comentar.

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by