Retrieve the X and Y coordinates of a polygon's vertices from a Geometry Picker
Hi,
I have been trying to retrieve the coordinate information of a polygon from Geometry Picker. Is it possible to do? For context, what I am trying to achieve with this workflow is:
- For user to define an area of interest by drawing a polygon on a map (in VertiGIS Studio Web) using a Geometry Picker.
- This polygon boundary info will then need to be passed through to FME (Flow Hosted) for further processing, i.e. extracting attributes of features in the area that intersect the polygon boundary
I am looking for ideas and workflow activities that can be used to extract the x,y coordinates of the polygon's vertices. I tried using the Get Geometry Extent but got lost on how to use that to get the coordinates.
I was hoping that someone could point me into the right direction. Thank you!
-
Since you already have FME, I'd just pass the geometry as an argument, and have FME deal with coordinates where needed:
Use the Convert To JSON activity to convert =$form1.state.geometryPicker1.value.geometry[0].toJSON() to a JSON formatted geometry. Then pass =$json1.json to FME
If you really need the coordinates in the workflow, you can go from here: =$form1.state.geometryPicker1.value.geometry[0].rings which is a nested array of numbers. If the polygon is not a multipolygon, the coordinates are an array of coordinate pairs (i.e. two values each) in =$form1.state.geometryPicker1.value.geometry[0].rings[0]
See here: https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings
0 -
Hi Berend Veldkamp thank you, the Convert To JSON works nicely and I can see the JSON-format geometry in the Console when using the Dev tool.
Which activity should I use to pass on the JSON to FME? I was looking into the Run FME Data Download and define =$json1.json.toJSON() as the parameter. Not sure if that's the way to go though.
The workflow looks like this:

Thanks again for your help!
0 -
I don't know the details of FME, so I can only take an (educated) guess. AFAIK any parameters should be defined in the workspace, and should be passed in as something like this:
={ "name-of-parameter" : $json1.json }0 -
Yep, that's exactly what we needed Berend Veldkamp. Thank you!
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
4 commentaires