How to get georeferenced information correctly?

7 views (last 30 days)
kuldeep
kuldeep on 22 Sep 2024
Answered: Naga on 26 Nov 2024 at 5:19
I am using following matlab line to get map_info and coord_sys_str
% Construct the 'map info' string
map_info = sprintf('{%s, 1, 1, %.10f, %.10f, %.10f, %.10f, %s}', ...
R.ProjectedCRS.Name, x0, y0, x_pixel_size, y_pixel_size, units);
% Get the coordinate system string
% methods(R.ProjectedCRS);
coord_sys_str = R.ProjectedCRS.wktstring;
the output is as follows
map info = {WGS 84 / UTM zone 43N, 1, 1, 376944.5785894837, 2068390.0758226500, 10.0000000000, 10.0000000000, meter}
coordinate system string = {{PROJCRS["WGS 84 / UTM zone 43N",BASEGEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ID["EPSG",6326]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8901]]],CONVERSION["UTM zone 43N",METHOD["Transverse Mercator",ID["EPSG",9807]],PARAMETER["Longitude of natural origin",75,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Scale factor at natural origin",0.9996,SCALEUNIT["unity",1],ID["EPSG",8805]],PARAMETER["False easting",500000,LENGTHUNIT["m",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["m",1],ID["EPSG",8807]],ID["EPSG",16043]],CS[Cartesian,2],AXIS["easting",east,ORDER[1],LENGTHUNIT["Meter",1]],AXIS["northing",north,ORDER[2],LENGTHUNIT["Meter",1]]]}}
When I open this file in ENVI it is not showing lat/lon.
if I copy the georeferenced information from my input header file to output header file which is as follows then it shows the lat/lon on screen in ENVI.
map info = {UTM,14186.0,10802.5,434499.57858948375,2004780.07582265,10.0,10.0,43,North,World Geodetic System 1984,units=Meters}
coordinate system string = {PROJCS["WGS 84 / UTM zone 43N", GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4326"]], PROJECTION["Transverse_Mercator", AUTHORITY["EPSG","9807"]], PARAMETER["central_meridian", 75.0], PARAMETER["latitude_of_origin", 0.0], PARAMETER["scale_factor", 0.9996], PARAMETER["false_easting", 500000.0], PARAMETER["false_northing", 0.0], UNIT["m", 1.0], AXIS["Easting", EAST], AXIS["Northing", NORTH], AUTHORITY["EPSG","32643"]]}
Please suggest me how to get these georeferenced information correctly.
kuldeep

Answers (1)

Naga
Naga on 26 Nov 2024 at 5:19
Hello Kuldeep,
To ensure that your georeferencing information is correctly recognized by ENVI, you need to format the'map_info' and 'coordinate system string' according to its expectations. The discrepancies you observe might arise from slight differences in formatting or parameter names.
  • The 'map_info' string in your input header file has additional fields like zone number and hemisphere, which might be required by ENVI.
  • Your input header file uses a slightly different format for the 'coordinate system string'. To align your output with this format, ensure the use of parameters like 'central_meridian' and 'latitude_of_origin' instead of 'Longitude of natural origin' and 'Latitude of natural origin'.
By making these adjustments, you should be able to generate georeferencing information that ENVI can correctly interpret.

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!