[gdal-dev] gdalsrsinfo Incorrect or Inconsistent results reporting EPSG codes

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Sat Nov 2 11:51:16 PDT 2019


Hi,

I guess that the Erdas .img format https://gdal.org/drivers/raster/hfa.html
has somewhat limited support for projections
https://github.com/OSGeo/gdal/blob/master/gdal/frmts/hfa/hfadataset.cpp.

At least there is a difference in behavior with GeoTIFF and img:

gdal_translate -of Gtiff -a_srs epsg:6343 DEM_14T_MK_4636.img DEM_14T_MK.tif
gdalsrsinfo DEM_14T_MK.tif -o epsg
EPSG:6343

gdal_translate -of HFA -a_srs epsg:6343 DEM_14T_MK_4636.img DEM_14T_MK.img
gdalsrsinfo DEM_14T_MK.img -o epsg
EPSG:26914

Perhaps using GeoTIFF format instead of img could be a workaround? 

-Jukka Rahkonen-





David Cakalic wrote
> Link below is to a sample IMG file on WeTransfer:
> https://we.tl/t-KtV9xCLaDF
> 
> Depending on the computer, this is showing as:
> EPSG: -1
> EPSG: 26914
> EPSG: 6343
> when using gdalsrsinfo -e {image}
> or
> gdalsrsinfo -o epsg {image}
> 
> 
> Thank you,
> David C.
> 
> 
> 
> 
> jratike80 wrote:
> Subject: Re: [gdal-dev] gdalsrsinfo Incorrect or Inconsistent results
> reporting EPSG codes
> 
> Hi,
> 
> Please make is easier for us to help you and provide a link to such raster
> file. It does not need to be your real, perhaps confidential data, a small
> extract is actually much better. Just take care that if shows all the
> issues
> that you wrote about. Meanwhile you can read
> https://trac.osgeo.org/gdal/wiki/rfc73_proj6_wkt2_srsbarn and think if
> this
> change could explain some of your observations.
> 
> -Jukka Rahkonen-
> 
> 
> 
> David C. wrote
>> Hi,
>>
>> I've been having a problem using gdal to simply read/report EPSG headers
>> on rasters.  I am trying to use it to verify header projection
>> information
>> is correct.
>> First, I am using Windows 10.
>> Rasters are Imagine .IMG format.
>> Command being used is   gdalsrsinfo -e {filename}
>>
>> I've tried gdal from various sources/vintages... the problem is I can
>> only
>> get it to report the proper (expected) EPSG on 2 of 6 computers... even
>> if
>> I take special care to follow same steps each time.  I am also using the
>> SAME EXACT image file each time.
>>
>> The projection is NAD83(2011) / UTM zone 14N.
>> So I expect to see EPSG:6343
>>
>> I'm often getting EPSG:26914
>> This is NAD83 / UTM zone 14N   (NOT 2011)
>>
>> Or I get EPSG:  -1
>>
>> The gdal install that works as expected on 2 of 6 computers is the
>> version
>> that installs on Windows along with  OSgeo4w.  (GDAL 2.4.1 as reported by
>> "gdalsrsinfo --version" command)
>>
>> It only works if I run the gdalsrsinfo command from the C:\OSgeo4w\bin
>> folder.... If I run from anywhere else I get the other results mentioned.
>> Also, I've installed the same OSgeo4w on all 6 machines... and it only
>> works on two.
>>
>> Other GDAL binaries for Windows I got from the gisinternals website...
>> I've tried multiple versions (2.4.1, 2.4.2, 3.0....) and I'm running
>> through the command shell provided with that distribution....  All
>> getting
>> different results (sometimes -1   sometimes  26914)   but I simply can't
>> find any consistency of WHY it is working sometimes and not others.
>>
>> One concern I have is that perhaps since GDAL is packaged with SO MANY
>> programs (ESRI, Qgis, Global Mapper, etc.) that perhaps the command is
>> calling incorrect libraries?
>>
>> Please... if anyone has ideas on WHY this is happening, or how to force
>> the command to run from a a CLEAN environment only using the libraries I
>> desire, I welcome input.
>> Sincerely,
>> David C.
>>
>>
>>
>> _______________________________________________
>> gdal-dev mailing list
> 
>> gdal-dev at .osgeo
> 
>> https://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> 
> 
> 
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
> 
> 
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list