Question

Writing Polygon Geom to Spatialite that is on the date line

  • 25 May 2017
  • 1 reply
  • 2 views

When I write a polygon geometry whose western edge is equivalent to -180.0, but in Spherical Mercator (-20037508.342789244), the longitude value switches signs and becomes positive. I have tried the same process, but writing to a GeoJSON file and no problem occurs.

Is there any value modification occurring when features are written to the Spatialite format?

I can provide a very simple workspace to replicate this if it is needed.

For what it's worth, I believe this is a precision problem.

Simply changing the western longitude from -20037508.342789244 to -20037508.34278924 "solves" the problem. It does however translate to changing the actually geometry because something that originally was equivalent to -180.0 is now -179.99999999999997.


1 reply

Userlevel 4

You could try the tip outlined in this article and see if it helps:

https://knowledge.safe.com/articles/34013/dateline-problem.html

Reply