[gdal-dev] [ogr2ogr] Anti-meridian issue when reprojecting from a Polar Stereographic projection to a geographic CRS
Andrey VI
andrey_vi at list.ru
Fri Oct 24 09:32:05 PDT 2025
Thank you, Even.
I think that I found an issue with re-projection.
4 polygons in EPSG:3996 as test_polys-2_3996.csv:
WKT,ID
"POLYGON ((-1000000 0,-1000000 1000000,0 1000000,0 0,-1000000 0))",1
"POLYGON ((0 0,0 1000000,1000000 1000000,1000000 0,0 0))",2
"POLYGON ((-1000000 -1000000,-1000000 0,0 0,0 -1000000,-1000000 -1000000))",3
"POLYGON ((0 -1000000,0 0,1000000 0,1000000 -1000000,0 -1000000))",4
gdal vector pipeline read test_polys-2_3996.csv --oo KEEP_GEOM_COLUMNS=NO ! reproject -s EPSG:3996 -d EPSG:4326 ! write -f CSV --lco GEOMETRY=AS_WKT test_polys-2_3996-4326.csv
Resulting test_polys-2_3996-4326.csv :
WKT,ID
"POLYGON ((-90 80.910166664287,-135 77.1707983667985,180.0 80.910166664287,180 90,-90 90,-90 80.910166664287))","1"
"POLYGON ((135.0 77.1707983667985,90.0 80.910166664287,180 90,180.0 80.910166664287,135.0 77.1707983667985))","2"
"POLYGON ((-45 77.1707983667985,-90 80.910166664287,-90 90,0 90,0.0 80.910166664287,-45 77.1707983667985))","3"
"POLYGON ((0.0 80.910166664287,0 90,90 90,90.0 80.910166664287,45.0 77.1707983667985,0.0 80.910166664287))","4"
It looks like polygons with IDs 1 and 2 were reprojected incorrectly.
Polygon ID 1 should be
POLYGON ((-90 80.91016666428700432, -135 77.17079836679849336, -180 80.91016666428700432, -180 90, -90 90, -90 80.91016666428700432))
Polygon ID 2 should be
POLYGON ((135 77.17079836679849336, 90 80.91016666428700432, 90 90 , 180 90, 180 80.91016666428700432, 135 77.17079836679849336))
>Thursday, October 23, 2025 1:39 PM +03:00 from Even Rouault < even.rouault at spatialys.com >:
>
>Andrey,
>
>| With ogr2ogr re-projection now works as expected, but when using gdal
>vector pipeline (reproject -d EPSG:4326) it works without any changes.
>Is this correct?
>
>Actually an extra fix for vector reproject was needed:
>https://github.com/OSGeo/gdal/pull/13275
>
>Even
>
>
>--
>http://www.spatialys.com
>My software is free, but my time generally not.
--
Andrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20251024/b75fceb9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_polys-2_3996.csv
Type: text/csv
Size: 283 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20251024/b75fceb9/attachment.csv>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_polys-2_3996-4326.csv
Type: text/csv
Size: 461 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20251024/b75fceb9/attachment-0001.csv>
More information about the gdal-dev
mailing list