Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapInfo CRS not correctly recognized #5217

Closed
meyerlor opened this issue Feb 2, 2022 · 4 comments
Closed

MapInfo CRS not correctly recognized #5217

meyerlor opened this issue Feb 2, 2022 · 4 comments
Assignees

Comments

@meyerlor
Copy link

meyerlor commented Feb 2, 2022

Hello,
I m using GDAL 3.4.1 with QGIS 3.22.3

When exporting any file to a MapInfo .tab into the CRS EPSG:25832, opening that exported file is incorrectly recognized as EPSG:32632.
gdalinfo of that file reports:

Layer name: BORIS_BW_2020

Geometry: Unknown (any)
Feature Count: 296
Extent: (517700.150000, 5281321.900000) - (537137.040000, 5302830.140000)
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["Transverse Mercator",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",9,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2

It should be ETRS and not WGS84 i think. I opened an issue some time ago for QGIS, but i think here it is better placed, if not please delete (qgis/QGIS#43482) !

@jratike80
Copy link
Collaborator

jratike80 commented Feb 2, 2022

I could not reproduce with GDAL 3.4.0dev on Windows.

I had a try both with tab and mif

ogr2ogr -f "MapInfo File" states.tab -a_srs  EPSG:25832 states.shp
ogr2ogr -f "MapInfo File" states.mif -a_srs  EPSG:25832 states.shp

and then

ogrinfo states.tab -al -so

Layer name: states
Geometry: Unknown (any)
Feature Count: 49
Extent: (-124.730000, 24.950000) - (-66.970000, 49.370000)
Layer SRS WKT:
PROJCRS["unnamed",
    BASEGEOGCRS["unnamed",
        DATUM["Euref_89",
            ELLIPSOID["GRS 80",6378137,298.257222101,
 ...

Or with gdalsrsinfo

gdalsrsinfo states.mif

PROJ.4 : +proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs

@rouault rouault self-assigned this Feb 2, 2022
@rouault
Copy link
Member

rouault commented Feb 2, 2022

I've a fix pending. The issue is when using the WKT2 definition of EPSG:25832, which is what QGIS does under the hood, which lacks an explicit datum code.

@jratike80
Copy link
Collaborator

QGIS 3.18 finds https://epsg.org/crs_7791/RDN2008-UTM-zone-32N.html from the mif file that I created but I really made that shapefile with an odd method (attach srs UTM32 into EPSG:4326 data in degrees).

@meyerlor
Copy link
Author

meyerlor commented Feb 2, 2022

QGIS 3.18 finds https://epsg.org/crs_7791/RDN2008-UTM-zone-32N.html from the mif file that I created but I really made that shapefile with an odd method (attach srs UTM32 into EPSG:4326 data in degrees).

that changed in QGIS 3.22 from EPSG7791 to EPSG32632

@rouault thats great! looking forward to this release then :)

rouault added a commit to rouault/QGIS that referenced this issue Feb 2, 2022
…ce: use authId as much as possible

This helps preserving metadata, like datum code, which is generally
absent from WKT2 output. Or when importing from WKT1, extent is missing.

This is an alternative to the fix of OSGeo/gdal#5218 for
OSGeo/gdal#5217.
rouault added a commit to rouault/QGIS that referenced this issue Feb 2, 2022
…ce: use authId as much as possible

This helps preserving metadata, like datum code, which is generally
absent from WKT2 output. Or when importing from WKT1, extent is missing.

This is an alternative to the fix of OSGeo/gdal#5218 for
OSGeo/gdal#5217.
rouault added a commit to rouault/QGIS that referenced this issue Feb 2, 2022
…ce: use authId as much as possible

This helps preserving metadata, like datum code, which is generally
absent from WKT2 output. Or when importing from WKT1, extent is missing.

This is an alternative to the fix of OSGeo/gdal#5218 for
OSGeo/gdal#5217.
nyalldawson pushed a commit to qgis/QGIS that referenced this issue Feb 2, 2022
…ce: use authId as much as possible

This helps preserving metadata, like datum code, which is generally
absent from WKT2 output. Or when importing from WKT1, extent is missing.

This is an alternative to the fix of OSGeo/gdal#5218 for
OSGeo/gdal#5217.
qgis-bot pushed a commit to qgis/QGIS that referenced this issue Feb 2, 2022
…ce: use authId as much as possible

This helps preserving metadata, like datum code, which is generally
absent from WKT2 output. Or when importing from WKT1, extent is missing.

This is an alternative to the fix of OSGeo/gdal#5218 for
OSGeo/gdal#5217.
nyalldawson pushed a commit to qgis/QGIS that referenced this issue Feb 3, 2022
…ce: use authId as much as possible

This helps preserving metadata, like datum code, which is generally
absent from WKT2 output. Or when importing from WKT1, extent is missing.

This is an alternative to the fix of OSGeo/gdal#5218 for
OSGeo/gdal#5217.
rouault added a commit that referenced this issue Feb 16, 2022
MapInfo .tab writing: correctly detect datum when creating a layer from a WKT2 CRS string (fixes #5217)
rouault added a commit that referenced this issue Feb 17, 2022
nyalldawson pushed a commit to qgis/QGIS that referenced this issue Feb 20, 2022
…ce: use authId as much as possible

This helps preserving metadata, like datum code, which is generally
absent from WKT2 output. Or when importing from WKT1, extent is missing.

This is an alternative to the fix of OSGeo/gdal#5218 for
OSGeo/gdal#5217.
nyalldawson pushed a commit to qgis/QGIS that referenced this issue Feb 21, 2022
…ce: use authId as much as possible

This helps preserving metadata, like datum code, which is generally
absent from WKT2 output. Or when importing from WKT1, extent is missing.

This is an alternative to the fix of OSGeo/gdal#5218 for
OSGeo/gdal#5217.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants