-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Description
I've found that JtsGeoJSONWriter cannot parse JtsPoint with 3 coordinates (x,y,z) to GeoJSON string. z coordinate is just dropped during parsing.
An example is below. geoJSONPoint should be the same JSON as backToGeoJSONPoint variable but you can see that Z coordinate isn't returned.
String geoJSONPoint = "{\"type\": \"Point\", \"coordinates\": [-117.26028657062011, 32.87234560059042, 12.1]}";
JtsSpatialContextFactory factory = new JtsSpatialContextFactory();
factory.geo = true;
factory.useJtsPoint = true;
factory.useJtsLineString = true;
factory.datelineRule = DatelineRule.none;
JtsSpatialContext context = new JtsSpatialContext(factory);
GeoJSONReader geojsonReader = new GeoJSONReader(context, factory);
JtsGeoJSONWriter geoJSONWriter = new JtsGeoJSONWriter(context, factory);
Shape shape = geojsonReader.read(geoJSONPoint);
String backToGeoJSONPoint = geoJSONWriter.toString(shape);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels