Calculate distance between 2 polygons on the map
Hello,
Is it possible to create a workflow to find the shortest distance between 2 parcel polygons on a map. I have a workflow that performs a search for a parcel based on the address. Then it draws a 1000 fr and 500 ft buffers around that parcel and checks for intersections with a layer that contains properties owned by city council members. If the property locates in the range 500-1000 ft, I need to calculate the shortest distance on map between those 2 polygons. Is it somehow possible with Calculate Distance activity?
-
See this example of a Calculate Distance activity, you can open it in Workflow Designer (Open By Url)
https://latitudegeo.maps.arcgis.com/home/item.html?id=0cf5aeb1bc554180aeedfd34e8cd8370
Run it in this app > Tools > Advanced GIS > Calculate Distance (Server)
https://apps.vertigisstudio.eu/web/?app=e69e17cb09274fbcb08575b1d59c6c23
0 -
Hi NIco, thank you so much. How can I access the workflow? I see this
-1 -
0 -
Nico Burgerhart could you please share a json file?
0 -
Save the code below as a JSON file.
{"_properties":{},"components":[{"id":2,"steps":[{"id":3,"inputs":{},"position":"0,0","purpose":"start","title":"Start","transitions":[{"id":15,"inputs":{},"position":"90,60 90,100","sourceConnector":"bottom","target":{"id":8}}]},{"action":"gcx:wf:forms:form:DisplayForm","id":8,"inputs":{"form":{"accessors":[],"code":"resources.forms[values.id]","values":{"id":6}}},"name":"form1","position":"-30,100","title":"Display Form","transitions":[{"id":12,"inputs":{},"position":"90,220 90,260","sourceConnector":"bottom","target":{"id":11}}]},{"action":"gcx:wf:arcgis::DistanceServiceTask","id":11,"inputs":{"geodesic":true,"geometry1":{"accessors":["$form1"],"annotations":[{"count":6,"index":0,"kind":"idref"}],"code":"$form1.state.PolylineGeometryPicker.value.geometry[0]","source":"$form1.state.PolylineGeometryPicker.value.geometry[0]"},"geometry2":{"accessors":["$form1"],"annotations":[{"count":6,"index":0,"kind":"idref"}],"code":"$form1.state.PolygonGeometryPicker.value.geometry[0]","source":"$form1.state.PolygonGeometryPicker.value.geometry[0]"},"unit":"kilometers","url":"https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer"},"name":"distance1","position":"-30,260","title":"Calculate Distance (server)","transitions":[{"id":19,"inputs":{},"position":"90,330 90,360","sourceConnector":"bottom","target":{"id":18}}]},{"action":"gcx:wf:ui::Alert","id":13,"inputs":{"text":{"accessors":["$distance1","$distance2"],"annotations":[{"count":10,"index":61,"kind":"idref"},{"count":10,"index":117,"kind":"idref"}],"code":"\"Calculate Distance (server) Results\\nGeodesic Distance: \" + $distance1.distance + \" kms\\nNon-Geodesic Distance: \" + $distance2.distance + \" kms.\"","source":"\"Calculate Distance (server) Results\\nGeodesic Distance: \" + $distance1.distance + \" kms\\nNon-Geodesic Distance: \" + $distance2.distance + \" kms.\""}},"position":"-30,460","title":"Alert"},{"action":"gcx:wf:arcgis::DistanceServiceTask","id":18,"inputs":{"geodesic":false,"geometry1":{"accessors":["$form1"],"annotations":[{"count":6,"index":0,"kind":"idref"}],"code":"$form1.state.PolylineGeometryPicker.value.geometry[0]","source":"$form1.state.PolylineGeometryPicker.value.geometry[0]"},"geometry2":{"accessors":["$form1"],"annotations":[{"count":6,"index":0,"kind":"idref"}],"code":"$form1.state.PolygonGeometryPicker.value.geometry[0]","source":"$form1.state.PolygonGeometryPicker.value.geometry[0]"},"unit":"kilometers","url":"https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer"},"name":"distance2","position":"-30,360","title":"Calculate Distance (server)","transitions":[{"id":20,"inputs":{},"position":"90,430 90,460","sourceConnector":"bottom","target":{"id":13}}]}]}],"designerVersion":"5.52.1+1","forms":[{"defaults":{},"elements":{"Footer":{"index":3,"items":{"0":{"default":true,"index":0,"label":"Submit","validates":true,"value":"submit"},"1":{"index":1,"label":"Cancel","validates":false,"value":"cancel"}},"section":"footer","type":"ButtonBar"},"Header":{"section":"header","title":{"markdown":"Calculate Distance (server) Activity"},"type":"Header"},"PolygonGeometryPicker":{"format":"polygon","index":2,"itemLabel":{"markdown":"Polygon"},"prompt":{"markdown":"Add Polygon"},"require":true,"size":1,"title":{"markdown":"Polygon Geometry"},"type":"GeometryPicker"},"PolylineGeometryPicker":{"format":"polyline","index":1,"itemLabel":{"markdown":"Polyline"},"prompt":{"markdown":"Add Polyline"},"require":true,"size":1,"title":{"markdown":"Polyline Geometry"},"type":"GeometryPicker"},"Text1":{"description":{"markdown":"The Calculate Distance (server) activity allows for the calculation of the distance between these two geometries using a input geometry service as both a geodesic and non-geodesic length.\n\nIn this sample workflow, create two geometries as inputs, then view the output distance in an Alert.\n\nWorkflow Available Here: https://latitudegeo.maps.arcgis.com/home/item.html?id=0cf5aeb1bc554180aeedfd34e8cd8370"},"index":0,"type":"Text"}},"id":6}],"licenseInfo":{"licenseeId":"e370080a-766f-c6d4-3d50-83e68ab14227"},"start":{"id":3}}0
Please sign in to leave a comment.
Comments
5 comments