Aller au contenu principal

Retrieve the X and Y coordinates of a polygon's vertices from a Geometry Picker

Commentaires

4 commentaires

  • Berend Veldkamp

    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
  • Amanda Putri

    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
  • Berend Veldkamp

    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
  • Amanda Putri

    Yep, that's exactly what we needed Berend Veldkamp. Thank you!

    0

Vous devez vous connecter pour laisser un commentaire.