terraformer-js / terraformer

A geographic toolkit for dealing with geometry, geography, formats, and building geodatabases
MIT License
187 stars 28 forks source link

The type field of the Geometry class is missing in @terraformer/arcgis #48

Closed 46319943 closed 4 years ago

46319943 commented 4 years ago

Thank you very much for the conversion tool, but when I use it with ArcGIS JS, it has some problems. Specifically, the type field indicating the geometry type is missing.

In the Geometry document of ArcGIS JS, the type field exists. When switching from GeoJson to ArcGIS Json, the geometry type is lost. In ArcGIS JS, when adding the features field to FeatureSet, the type field in Geometry must exist before it can be added.

Geometry JS document: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type

Graphic's JS document: https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html

FeatureSet JS document: https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html

jgravois commented 4 years ago

This library conforms to the ArcGIS REST API Geometry Object specification.

As you note, the JSAPI requires additional information when parsing geometries. Luckily you can map the corresponding equivalent types and append them to the output yourself.

46319943 commented 4 years ago

Okay thank you! It seems I still have to add geometry type to the object myself