Esri / Esri/geometry-api-java

esrijson to geojson Exception

Open
#321 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
710
Forks
269
Avg merge
7d 23h
Merged PRs (30d)
1

Description

I have an esrijson and when converting it to geojson, I found that the geometry returned by createGeometryByGeoJson is empty. Is there any other way to convert it to geojson?
I can successfully convert using [https://github.com/Esri/arcgis-to-geojson-utils](https://github.com/Esri/arcgis-to-geojson-utils) arcgisToGeoJSON method.

The code example is as follows:
```java
public String EsriJsonToGeoJson(String esri_json){
Geometry geometry = createGeometryByJson(esri_json);
return getGeoJson(geometry);
}

private Geometry createGeometryByGeoJson(String geojson) {
return GeometryEngine.geoJsonToGeometry(geojson, WktExportFlags.wktExportDefaults, Geometry.Type.Unknown).getGeometry();
}

private String getGeoJson(Geometry geometry) {
return GeometryEngine.geometryToGeoJson(geometry);
}

```
The data example is as follows:
[GeoJson.json](https://github.com/Esri/geometry-api-java/files/15293037/GeoJson.json)

[EsriJson.json](https://github.com/Esri/geometry-api-java/files/15292946/EsriJson.json)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.