Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

esrijson to geojson Exception

Open
#321 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
api, data

Research direction

Begin with the attached EsriJson.json and GeoJson.json, then reproduce the conversion through createGeometryByJson and getGeoJson. Trace the GeometryEngine conversion calls, including geoJsonToGeometry and geometryToGeoJson, and compare the result with the arcgisToGeoJSON method. Done means the supplied input produces a non-empty geometry or the incompatibility is clearly documented.

Written by the indexing model from the issue text.

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 arcgisToGeoJSON method.

The code example is as follows:

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

EsriJson.json

Dominant language
Java
Stars
710
Forks
268
Avg merge
7d 23h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Esri/geometry-api-java

All issues in Esri/geometry-api-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.