I have a feature layer of points representing people and a feature layer of polygons representing areas they are assigned to be in. I would like to have a web app where a user can move an existing point into a different polygon then have the point update to the name of the new area. If it's possible I would like the point to be updated by clicking a button that runs a tool that updates by the point's location rather than by having the user type in the information.
I'm having trouble searching for answers to this because all the ones I find relate to doing a spatial join. But I don't want to create a new feature class. I need to only update the attributes of the feature in the existing point feature layer.
Thank you.
Steve
Are you hoping for a Python or JS solution, or something else?
Honestly anything. I don’t really have much scripting experience so I’d have to learn more about any possible solution.
Sent from my iPhone
In Python, you would find the Point Geometry you moved, then cycle through the Polygon objects, checking if the polygon contains the point (using one of the polygon methods, like contains or not disjoint). The JS API would have similar objects/methods, but I'm not particularly familiar with it.
Steven, where does the data reside? If it is in a relational database (MS SQL Server, Oracle etc.) you could work something up at the database level.
Matthew
It resides in an sql database but the updates will be made through a web app.
Sent from my iPhone
Yea, that's okay. I'll have a crack at a little SQL trigger that will do the update within the database once the point is moved via the WebMap. You might need to do some finessing as I don't know your data structure.
Matthew
You'll need to update the attached with your database, schema and featureclass names, as well as the names of the fields in your point and polygon featureclasses.
The trigger will:
1. get the geometry for the moved point feature
2. find the polygon that the point intersects with and gets the 'name' of that area.
3. updates the point attribute with the 'name' of that area
Let me know how you get on.
Thank you for trying to help. I'm not seeing anything attached to your post.