Reverse Geocoding and Point in Polygon Python Scripts

568
0
10-02-2019 02:21 PM
YuliaMamonova
Occasional Contributor III

Hello everyone,

I have a hosted feature service that is being updated with Arcgis Quick Capture. When the record is submitted I would like the address and the zone to be calculated based on the coordinates for each record. In Survey 123 connect that is very easily doable with JS functions, but with Quick Capture I am not sure how to set it up.

I have to say (not sure it matters) that initially the feature service was created with Survey 123 connect, because it's just very confusing (for me) to create a normal feature service in Arcgis Pro so it meets all the requirements of Quick Capture. So I just created the regular form in Survey 123 with select_one question, image question, latitude and longitude and some default text questions. Then I used this feature service to create Quick Capture project. So Survey 123 and Quck Capture update the same feature service.

My thoughts were (I've just started learning python, don't know a lot yet) to create 2 new empty fields in the feature service that I want to update and to create 2 python scripts - Geocoding and Point in Polygon, and schedule them to calculate the address and the zone every certain period of time for new records and update the input feature service by adding address and the zone into these 2 new empty fields that I created.

I did this (and I did it completely wrong):

1) Geocoding:

My script (standalone): 

I added the script to Arcgis Pro toolbox, and tried to run it, and of course it failed with this error:

I know what's wrong here:

- arcpy.env.workspace -  As soon as my feature layer was created in Survey 123, it's not stored in geodatabase on my computer:

What should I do?

- input - output feature services - How should I modify the code to update the existing feature service, not to create one?

2) Point in Polygon

I found this https://pro.arcgis.com/en/pro-app/tool-reference/data-management/feature-to-polygon.htm

But there going to be the same problem I suppose.

I know I can update online feature services with jupyter notebooks, BUT. How do i actually schedule it to run? I mean the notebook is for instant result, I know you can export is as a script, but can you actually schedule it?

Please help me figure this out.

Thank you,

Yulia

0 Kudos
0 Replies