I am drawing an object on map and retrieving it's geometry using following code:
this.draw = new SketchViewModel({
layer: this.drawLayer,
view: this.view
});
this.draw.on("create", function(event: SketchViewModelCreateEvent) {
if (event.state === "complete") {
const geometry = event.graphic.geometry;
}
});
Now i would like to store this geometry directly into esri sde database (postgres) using backend web application. This geometry is in esri json format. I can transform it into geojson format but still I cannot find any function that can save such geometry (esri json, geojson) directly into sde_geometry column. There are however methods to save geometry from WKT format.
So my question is: how can I convert graphic geometry into WKT format? Or maybe is there a better way to achieve this?