notice the zero-width part of the polygon on the right edge. This is invalid, as there are many duplicated points, which is visually apparent from looking at the geojson text. My guess is that what's happening is that all the parts of the polygon that should on the other side of the antimeridian are getting collapsed into a line along the antimeridian, resulting in an invalid polygon.
In the example code, reading the geojson output with a rigorous parser (spatial4j and JTS) results in the error:
org.locationtech.spatial4j.exception.InvalidShapeException: Self-intersection at or near point (180.0, 67.14285713896875, NaN)
Reproduction case is in https://github.com/philvarner/geotrellis-sinusoidaltolatlngreprojection
This case is specifically when working with the geometry of a MODIS scene that crosses the antimeridian. When doing the reprojection using code like
the resulting geojson vector looks like:
notice the zero-width part of the polygon on the right edge. This is invalid, as there are many duplicated points, which is visually apparent from looking at the geojson text. My guess is that what's happening is that all the parts of the polygon that should on the other side of the antimeridian are getting collapsed into a line along the antimeridian, resulting in an invalid polygon.
In the example code, reading the geojson output with a rigorous parser (spatial4j and JTS) results in the error:
When doing this in gdal with:
I get two polygons split across the antimeridian: