7月 28, 2021

GeoJson with Java

 My GeoJson data consist of a feature containing a single polygon.  [Beforehand it was purely a polygon, as it is not desired by the Google Map API, I had to wrap it up.]

However, when coming to Java JTS, thanks to the un-interoperable nature of GeoJson standard, I consistently got bamed by parse errors.

 

This time, JTS hates GeoJson Feature.

 

 

 

```

org.locationtech.jts.io.ParseException: Could not parse Geometry from GeoJson string.  Unsupported 'type':Feature
    at org.locationtech.jts.io.geojson.GeoJsonReader.create(GeoJsonReader.java:171)
    at org.locationtech.jts.io.geojson.GeoJsonReader.read(GeoJsonReader.java:132)
    at org.locationtech.jts.io.geojson.GeoJsonReader.read(GeoJsonReader.java:94)
```

沒有留言:

張貼留言