From Greek0 at gmx.net Sat May 2 06:17:42 2015 From: Greek0 at gmx.net (Christian Aichinger) Date: Sat, 02 May 2015 13:17:42 +0200 Subject: [Geotiff] No proj4 definition for CH1903/LV03 (EPSG 21781) maps Message-ID: <5544B256.7020200@gmx.net> Hi, I have maps with CH1903/LV03/EPSG 21781 coordinates. They worked fine with previous versions of libgeotiff. The current libgeotiff can still read them, but can't produce a proj4 definition for them. Unfortunately, I needed that feature. The problem seems to be the May 2012 Hotine rework[1]. EPSG 21781 now gets mapped to CTProjection == CT_HotineObliqueMercatorAzimuthCenter, but that is not supported in GTIFGetProj4Defn() in geotiff_proj4.c, only CT_ObliqueMercator is. I'm not sure how to best approach this problem. Should projop_wparam.csv be modified so it gives CT_ObliqueMercator with the correct parameters? Or should CT_HotineObliqueMercatorAzimuthCenter just be handled in GTIFGetProj4Defn()? I've attached a sample file that shows the problem. To reproduce, run `listgeo -proj4 CH1903-sample.tif` and observe that no proj4 definition is shown. Cheers, Chris [1]: http://lists.maptools.org/pipermail/geotiff/2012-May/000720.html -------------- next part -------------- A non-text attachment was scrubbed... Name: CH1903-sample.tif Type: image/tiff Size: 886 bytes Desc: not available Url : http://lists.maptools.org/pipermail/geotiff/attachments/20150502/9c889e42/attachment.tif -------------- next part -------------- $ listgeo -proj4 CH1903-sample.tif Geotiff_Information: Version: 1 Key_Revision: 1.0 Tagged_Information: ModelTiepointTag (2,3): 0 0 0 620000 172000 0 ModelPixelScaleTag (1,3): 2.5 2.5 0 End_Of_Tags. Keyed_Information: GTModelTypeGeoKey (Short,1): ModelTypeProjected GTRasterTypeGeoKey (Short,1): RasterPixelIsArea ProjectedCSTypeGeoKey (Short,1): Unknown-21781 ProjLinearUnitsGeoKey (Short,1): Linear_Meter End_Of_Keys. End_Of_Geotiff. PCS = 21781 (name unknown) Projection Linear Units: 9001/metre (1.000000m) PROJ.4 Definition: Corner Coordinates: Upper Left ( 620000.000, 172000.000) Lower Left ( 620000.000, 171875.000) Upper Right ( 620125.000, 172000.000) Lower Right ( 620125.000, 171875.000) Center ( 620062.500, 171937.500) From even.rouault at spatialys.com Sat May 2 07:07:57 2015 From: even.rouault at spatialys.com (Even Rouault) Date: Sat, 2 May 2015 14:07:57 +0200 Subject: [Geotiff] No proj4 definition for CH1903/LV03 (EPSG 21781) maps In-Reply-To: <5544B256.7020200@gmx.net> References: <5544B256.7020200@gmx.net> Message-ID: <201505021407.58531.even.rouault@spatialys.com> Le samedi 02 mai 2015 13:17:42, Christian Aichinger a ?crit : > Hi, > > I have maps with CH1903/LV03/EPSG 21781 coordinates. They worked fine > with previous versions of libgeotiff. The current libgeotiff can still > read them, but can't produce a proj4 definition for them. Unfortunately, > I needed that feature. > > The problem seems to be the May 2012 Hotine rework[1]. EPSG 21781 now > gets mapped to CTProjection == CT_HotineObliqueMercatorAzimuthCenter, > but that is not supported in GTIFGetProj4Defn() in geotiff_proj4.c, only > CT_ObliqueMercator is. > > I'm not sure how to best approach this problem. Should projop_wparam.csv > be modified so it gives CT_ObliqueMercator with the correct parameters? > Or should CT_HotineObliqueMercatorAzimuthCenter just be handled in > GTIFGetProj4Defn()? > > I've attached a sample file that shows the problem. To reproduce, run > `listgeo -proj4 CH1903-sample.tif` and observe that no proj4 definition > is shown. Christian, I've just committed in libgeotiff trunk a fix for that (inspired from GDAL similar code). So now: $ bin/listgeo -proj4 /tmp/CH1903-sample.tif Geotiff_Information: Version: 1 Key_Revision: 1.0 Tagged_Information: ModelTiepointTag (2,3): 0 0 0 620000 172000 0 ModelPixelScaleTag (1,3): 2.5 2.5 0 End_Of_Tags. Keyed_Information: GTModelTypeGeoKey (Short,1): ModelTypeProjected GTRasterTypeGeoKey (Short,1): RasterPixelIsArea ProjectedCSTypeGeoKey (Short,1): Unknown-21781 ProjLinearUnitsGeoKey (Short,1): Linear_Meter End_Of_Keys. End_Of_Geotiff. PCS = 21781 (CH1903 / LV03) Projection = 19922 (Swiss Oblique Mercator 1903M) Projection Method: CT_HotineObliqueMercatorAzimuthCenter ProjCenterLatGeoKey: 46.952406 ( 46d57' 8.66"N) ProjCenterLongGeoKey: 7.439583 ( 7d26'22.50"E) ProjAzimuthAngleGeoKey: 90.000000 ( 90d 0' 0.00"N) ProjRectifiedGridAngleGeoKey: 90.000000 ( 90d 0' 0.00"N) ProjScaleAtCenterGeoKey: 1.000000 ProjFalseEastingGeoKey: 600000.000000 m ProjFalseNorthingGeoKey: 200000.000000 m GCS: 4149/CH1903 Datum: 6149/CH1903 Ellipsoid: 7004/Bessel 1841 (6377397.16,6356078.96) Prime Meridian: 8901/Greenwich (0.000000/ 0d 0' 0.00"E) Projection Linear Units: 9001/metre (1.000000m) PROJ.4 Definition: +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +a=6377397.155 +b=6356078.963 +units=m Corner Coordinates: Upper Left ( 620000.000, 172000.000) ( 7d42' 4.02"E, 46d42' 0.74"N) Lower Left ( 620000.000, 171875.000) ( 7d42' 4.01"E, 46d41'56.69"N) Upper Right ( 620125.000, 172000.000) ( 7d42' 9.91"E, 46d42' 0.73"N) Lower Right ( 620125.000, 171875.000) ( 7d42' 9.89"E, 46d41'56.68"N) Center ( 620062.500, 171937.500) ( 7d42' 6.96"E, 46d41'58.71"N) Even > > Cheers, > Chris > > [1]: http://lists.maptools.org/pipermail/geotiff/2012-May/000720.html -- Spatialys - Geospatial professional services http://www.spatialys.com