[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 12:42:34 PDT 2025


Actually
> Polygon ID 2 should be
> POLYGON ((135 77.17079836679849336, 90 80.91016666428700432,  90 90 , 180 90, 180 80.91016666428700432, 135 77.17079836679849336))
is  incorrect because the first point of this polygon should be  0 90 . So I think that reprojected geometries should be as in  test_polys-2_3996-4326-proper.csv (attached) :
WKT,ID
"POLYGON ((-90 80.910166664287,-135 77.1707983667985,-180 80.910166664287,-180 90,0 90,-90 80.910166664287))","1"
"POLYGON ((0 90,180 90,180 80.910166664287,135 77.1707983667985,90 80.910166664287,0 90))","2"
"POLYGON ((-45 77.1707983667985,-90 80.910166664287,0 90,0 80.910166664287,-45 77.1707983667985))","3"
"POLYGON ((0 80.910166664287,0 90,90 80.910166664287,45 77.1707983667985,0 80.910166664287))","4"
>Friday, October 24, 2025 7:32 PM +03:00 from Andrey VI via gdal-dev < gdal-dev at lists.osgeo.org >:
> 
>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
> 
>_______________________________________________
>gdal-dev mailing list
>gdal-dev at lists.osgeo.org
>https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
Andrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20251024/8a5d5eda/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_polys-2_3996-4326-proper.csv
Type: text/csv
Size: 417 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20251024/8a5d5eda/attachment.csv>


More information about the gdal-dev mailing list