Z coordinate isn't used in JtsGeoJSONWriter
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with JtsGeoJSONWriter.toString(shape) and compare its handling of a JtsPoint with three coordinates against the GeoJSONReader input shown in the issue. Verify the result using the provided point example; done means the serialized GeoJSON preserves the original z coordinate.
Written by the indexing model from the issue text.
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);
- Dominant language
- Java
- Stars
- 961
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from locationtech/spatial4j
-
question
Difficulty 5/5 Over a week Newbie friendliness 20/100
locationtech/spatial4j#233 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
locationtech/spatial4j#232 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
locationtech/spatial4j#231 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
locationtech/spatial4j#230 · 2 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
locationtech/spatial4j#227 · 2 comments ·
All issues in locationtech/spatial4j
Similar issues
-
Bug Java Platform: Java
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsentry/sentry-java#6138 · 1 comment ·
-
bug needs triage p2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100