[postgis-users] Failing ST_Transform with Ross Ice Shelf polygon

Paul Ramsey pramsey at cleverelephant.ca
Tue Nov 7 10:02:15 PST 2023



> On Nov 6, 2023, at 3:39 PM, Paul Ramsey <pramsey at cleverelephant.ca> wrote:
> 
> 
> 
>> On Nov 6, 2023, at 3:33 PM, Marco Boeringa <marco at boeringa.demon.nl> wrote:
>> 
>> Well, yes indeed that is what is happening, 180 came out of the reprojection steps as -180. Full output geometry below. Is there any way to prevent this behavior?
>> 
>> Marco
>> 
> 
> Not really… Either snap to grid or reduce precision
> 
> https://postgis.net/docs/ST_ReducePrecision.html
> https://postgis.net/docs/ST_SnapToGrid.html
> 
> will get you back onto the dividing line (note that it is at -180.00000000000014), but that won’t help in flipping -180 to 180. For your particular case, applying
> 
> https://postgis.net/docs/ST_ShiftLongitude.html
> 
> will fix it, I think, though not in generality

I think using 

https://postgis.net/docs/ST_WrapX.html

would allow a more general purpose solution. At least one you have more control over.

P

> 
> P

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20231107/05a3c773/attachment.htm>


More information about the postgis-users mailing list