Closing polygon vertice coordinates not identical to starting vertice coordinates? #867
-
Hello Geoman gurus! I started playing with geoman today in the hopes of creating a lightweight geometry editor that can pass coordinate values to our enterprise application. That application has the ability to write geometries (via lat/lon converted to st_geometry shapes) into our Esri (Oracle) enterprise geodatabase. I believe that Esri ST_geometry geodatabase shape validation requires input coordinates for polygons to have identical starting and closing/final vertice coordinates. Some examples here: https://desktop.arcgis.com/en/arcmap/latest/analyze/python/reading-geometries.htm From some quick testing of the geoman editor and writing the coordinates to console, it appears to not contain a closing/identical coordinate pair for polygons. Is this expected behavior and can you think of anyway around this behavior aside from trying to build logic to create a duplicate origin polygon vertice and append that as the final coordinate pair upon completion of a polygon geometry? Here's an example console log of a simple polygon which in geoman was truly 5 vertices, but Esri would require a 6th (identical to #1 vertice) to be considered a valid shape for geodatabase storage: _latlngs: Array(1) Thanks for any ideas / suggestions you can provide! -Rex |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Rex, with GeoJSON definition:
The default export type for Leaflet is GeoJSON, so there is also a way to import it with Example: Export:
Import:
|
Beta Was this translation helpful? Give feedback.
Hi Rex,
with
_latlngs
you are useing the LatLng definition of Leaflet. (Same but public method would be.getLatLngs()
). In Leaflet the first and last positions are not equivalent.But you can convert it to geojson with
.toGeoJSON()
GeoJSON definition:
(2.1.6 Polygon)
(2.1.4. LineString)
The default export type for Leaflet is GeoJSON, so there is also a way to import it with
L.geoJSON()
Example:
Export: