Power Automate (MS Flow) - ArcGIS Rest API addFeatures (0,0)

471
4
Jump to solution
05-26-2020 07:14 AM
KevinThompson1
New Contributor III

Hello All,

I have been using MS Flow to extend Survey123 by using it to update another Hosted Feature Layer on AGOL. 

The flow works as expected and stores the attributes and coordinates correctly, but when you go to view it in AGOL the point is on 0,0 instead of the coordinates shown in service.

I have added the same spatial reference to the flow, but this has not helped. Has anyone experienced such an issue before either within a web hook platform or in JS or python directly?

Kind Regards,

Kevin

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KevinThompson1
New Contributor III

I have determined that this issue is caused when AGOL cannot read the coordinates properly it will default the feature to 0,0. Within my MS Flow the X & Y coordinate are being passed to the geometry when AGOL is looking for Easting and Northing values in Metres since it uses Web Mercator. 

Once this change is made AGOL can now read the geometry and it will be placed on the map accordingly.

Now the issue of it being within the wrong location is solved by redoing the Geometry calculates with the Web Murcator Projection on the Hosted Feature Layer using ArcGIS Pro. This is a pretty standard issue, but the not reading of the coordinates and placing at 0,0 really through me off. Hopefully this helps someone in future!

This all could have been avoided by more closely referring to the service url:

View solution in original post

4 Replies
KevinThompson1
New Contributor III

I have determined that this issue is caused when AGOL cannot read the coordinates properly it will default the feature to 0,0. Within my MS Flow the X & Y coordinate are being passed to the geometry when AGOL is looking for Easting and Northing values in Metres since it uses Web Mercator. 

Once this change is made AGOL can now read the geometry and it will be placed on the map accordingly.

Now the issue of it being within the wrong location is solved by redoing the Geometry calculates with the Web Murcator Projection on the Hosted Feature Layer using ArcGIS Pro. This is a pretty standard issue, but the not reading of the coordinates and placing at 0,0 really through me off. Hopefully this helps someone in future!

This all could have been avoided by more closely referring to the service url:

View solution in original post

ToryChristensen
New Contributor III

Hi Kevin,


Thank you for that explanation, I had recently had the same problem. I'm in a similar situation, attempting to pass X,Y coordinate values from Survey123 into Workforce.

I didnt quite follow your solution, was there an easy way of converting the values into and Eastings, Northings? 

KevinThompson1
New Contributor III

Good Morning Tory,

I am currently using two main methods for passing Geometry into Workforce!

Let me know if these help:

1) Pre-calculating Easting & Northings to pass to Workforce 

- This method is easier and requires ArcGIS Pro or ArcMap.

Calculate Geometry Attributes (Data Management)—ArcGIS Pro | Documentation 

- An Northing & Easting field will need to be added to the Hosted Feature Layer that you are launching your Survey123 Form from and within these you will calculate the Easting and Northing values. 

- In the below example I have taken a Tile Set and Calculated all the Centroids of the Polygons into two fields within the Hosted Feature Layer.

- Then you can configure Survey123 to pass these Northing and Easting values in the URL Parameters.

- My example opens the Tile Set in Edit Mode, but there is only one field that is edited.

- Survey123 then uses these Northing and Eastings when placing the Workforce Assignment

- From this Survey123 Form there is a Flow looking at it waiting to make an Assignment from this Hosted Feature Layer.

- There is a GET request that is sent first to take the Tile ID and search for its other attributes to pull the Northing and Eastings we calculated earlier. It then places those in when sending the POST request to create the Workforce Assignment.

2) Using MS Power Automate to dynamically convert Coordinates to Easting and Northings for Workforce

- This is used to automatically create an Assignment in Workforce when a Survey123 Form is Submitted.

- Workforce's Hosted Feature Layers utilize ESRI Web Mercator Spatial Reference 102100 while Survey123 captures coordinates in World Geodetic System 84 Spatial Reference 4326.

- Within this Flow a response is sent to the Geometry Server to change the projection and those are then passed to Workforce so the Assignment is placed in the correct location.

Hopefully my explanation is more thorough now! Let me know if I can help with anything

Have a great day!

Kevin T

ToryChristensen
New Contributor III

Hi Kevin,

That was a great explanation. I managed to get both methods to work today. The second being exactly what I was after.

Thanks so much for taking the time to write it all out.

Regards,

Tory