Search code examples
geoservergeotoolsgeomesa

GeoMesa: Polygon creation fails with some coordinates


I am creating a polygon as a geom attribute in a SimpleFeature, and testing it with various geospatial coordinates, but I am finding that some coordinates work with POLYGON and others raise an exception. For example, this bounding box in South Korea fails:

Invalid xz value from geometry/time: POLYGON ((35.709649 128.188477, 35.708649 128.188477, 35.708649 128.188201, 35.709649 128.188201, 35.709649 128.188477))

but using the same code and specifying some coordinates in Italy works fine:

POLYGON((44.751610 9.997559, 44.750610 9.997559, 44.750610 9.997001, 44.751610 9.997001, 44.751610 9.997559))

There are others around the globe that work fine also, but South Korea in particular consistently fails. Does anybody know why this is and how I might stabilize the behavior so that it works consistently?

Thank you.


Solution

  • GeoMesa assumes that the points are defined in longitude-latitude order. I believe the polygon you have defined for South Korea is written in latitude-longitude order.

    If you reverse the coordinates, it should work.