agrc / deq-spills

Embedded widget written for deq spills application.
MIT License
1 stars 0 forks source link

Determine Incident Proximity to Surface Water #127

Open stdavis opened 1 week ago

stdavis commented 1 week ago

From client:

When a spill location is created or updated for an incident, the map widget should automatically find the nearest waterbody (using NHD data from SGID within a reasonable distance) and update Salesforce fields with the waterbody name and distance.

This could possibly be accomplished by querying the relevant NHD data within the search radius and then looping through each returned geometry to find the one that is closest.

Tasks

steveoh commented 1 week ago

I've used this before with postgis to find the closest record.

https://github.com/steveoh/Presentations/blob/6d5236441a1d6ff3e2ef034ea8bb404fb55327d7/2020/DowntownCodingSLC/2-command-line-with-parameters/main.py#L56-L61

stdavis commented 1 week ago

Could we use that with a feature service or would we have to query open sgid?

steveoh commented 1 week ago

I think that operator is only available in pg directly.

stdavis commented 2 days ago

Maybe this is already supported via the web api.