[gdal-dev] Finnish KKJ and MapInfo MIF with GDAL 3.1

Even Rouault even.rouault at spatialys.com
Mon May 18 06:13:10 PDT 2020


On lundi 18 mai 2020 11:17:52 CEST Rahkonen Jukka (MML) wrote:
> Hi,
> 
> This command
> ogr2ogr -f "MapInfo file" -s_srs epsg:3067 -t_srs epsg:2393 2393.mif
> tm35.jml writes into MIF
> CoordSys Earth Projection 8, 104, "m", 27, 0, 1, 3500000, 0
> 
> ogrinfo shows
> 
> ogrinfo 2393.mif -al -so
> INFO: Open of `2393.mif'
>       using driver `MapInfo File' successful.
> 
> Layer name: 2393
> Geometry: Unknown (any)
> Feature Count: 3
> Extent: (3284260.027390, 6962722.914217) - (3284610.369420, 6962941.953889)
> Layer SRS WKT:
> PROJCRS["unnamed",
>     BASEGEOGCRS["unnamed",
>         DATUM["World Geodetic System 1984",
>             ELLIPSOID["WGS 84",6378137,298.257223563,
>                 LENGTHUNIT["metre",1,
>                     ID["EPSG",9001]]]],
>         PRIMEM["Greenwich",0,
>             ANGLEUNIT["degree",0.0174532925199433,
>                 ID["EPSG",9122]]]],
>     CONVERSION["unnamed",
>         METHOD["Transverse Mercator",
>             ID["EPSG",9807]],
>         PARAMETER["Latitude of natural origin",0,
>             ANGLEUNIT["degree",0.0174532925199433],
>             ID["EPSG",8801]],
>         PARAMETER["Longitude of natural origin",27,
>             ANGLEUNIT["degree",0.0174532925199433],
>             ID["EPSG",8802]],
>         PARAMETER["Scale factor at natural origin",1,
>             SCALEUNIT["unity",1],
>             ID["EPSG",8805]],
>         PARAMETER["False easting",3500000,
>             LENGTHUNIT["metre",1],
>             ID["EPSG",8806]],
>         PARAMETER["False northing",0,
>             LENGTHUNIT["metre",1],
>             ID["EPSG",8807]]],
>     CS[Cartesian,2],
>         AXIS["easting",east,
>             ORDER[1],
>             LENGTHUNIT["metre",1,
>                 ID["EPSG",9001]]],
>         AXIS["northing",north,
>             ORDER[2],
>             LENGTHUNIT["metre",1,
>                 ID["EPSG",9001]]]]
> Data axis to CRS axis mapping: 1,2
> 
> When I convert this data back into EPSG:3067 the coordinates are shifted by
> a hundred meters probably because what was called towgs84 parameters are
> not applied. Parameters appear in the mitab source code
> https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrsf_frmts/mitab/mitab_
> spatialref.cpp#L251 { 0,    1016,"Finnish_KKJ",                4, -96.062,
> -82.428, -121.754, -4.801, -0.345, 1.376, 1.496, 0},
> 
> I tried to fix the MIF by changing the CoordSys line into
> CoordSys Earth Projection 24, 1016, "m", 27, 0, 1, 3500000, 0
> that is to my knowledge what MapInfo itself is using but that does not work
> at all with GDAL
> 
> ogr2ogr -f "jml" -t_srs epsg:3067 2393_alt_from_mif.jml 2393_alt.mif
> ERROR 1: PROJ: proj_as_proj_string: Unsupported conversion method:
> Transverse_Mercator_MapInfo_24 ERROR 6: Cannot find coordinate operations
> from
> `PROJCRS["unnamed",BASEGEOGCRS["unnamed",DATUM["Finnish_KKJ",ELLIPSOID["Int
> ernational
> 1924",6378388,297,LENGTHUNIT["metre",1,ID["EPSG",9001]]]],PRIMEM["Greenwich
> ",0,ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]]],CONVERSION["unn
> amed",METHOD["Transverse_Mercator_MapInfo_24"],PARAMETER["latitude_of_origin
> ",0,ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],PARAMETER["centr
> al_meridian",27,ANGLEUNIT["degree",0.0174532925199433,ID["EPSG",9122]]],PARA
> METER["scale_factor",1,SCALEUNIT["unity",1,ID["EPSG",9201]]],PARAMETER["fals
> e_easting",3500000,LENGTHUNIT["metre",1,ID["EPSG",9001]]],PARAMETER["false_n
> orthing",0,LENGTHUNIT["metre",1,ID["EPSG",9001]]]],CS[Cartesian,2],AXIS["eas
> ting",east,ORDER[1],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["northing",n
> orth,ORDER[2],LENGTHUNIT["metre",1,ID["EPSG",9001]]]]' to `EPSG:3067' ERROR
> 1: Failed to create coordinate transformation between the
> following coordinate systems.  This may be because they
> are not transformable.
> 
> Is there something that I could do for making the conversion to round-trip?

Temptative fix for both datum and projection code in
https://github.com/OSGeo/gdal/pull/2577

I presume the separate codes for the TMerc projection on KKJ and the regular one came 
from using the Snyder's tmerc formula vs using the extended one.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200518/1e3f1dc3/attachment-0001.html>


More information about the gdal-dev mailing list