My client has a list of city addresses. When the public completes certain applications, their neighbors within 400 feet need to be notified. Is there a way to use Google maps to queue the addresses (in our dataset) within 400 feet? We’d like these addresses to then be linked in a postcard table.
I am sure there is an API that you can call to get this too, but this does sound like a fun math problem if you want to try, might need some scripting.
Ahhhhh, location science. It’s the new thing. Welcome to the CyberLandr community, Jake!
Yes. Since measurements between points are required, you need to use a haversine algorithm. These can be easily coded in javascript (see below).
Here’s what you need…
The source location of the subject property and its lat/lng.
The dataset of target candidate properties that could be impacted by activities at the source location; this data set must include the lat/lng for every address.
Here’s what you do…
Write a script extension that reads in all the target candidate properties.
Iterate across that data set to compute the distance between your source location and each target property (the distance function takes lat/lng for both and returns the distance in KM which you will convert to feet).
Update the distance computed into a new field for each target property.
Create a view that includes only candidates that are <= 400 (feet).
Ahhhhh, location science. It’s the new thing. Welcome to the CyberLandr community, Jake!
Yes. Since measurements between points are required, you need to use a haversine algorithm. These can be easily coded in javascript (see below).
Here’s what you need…
The source location of the subject property and its lat/lng.
The dataset of target candidate properties that could be impacted by activities at the source location; this data set must include the lat/lng for every address.
Here’s what you do…
Write a script extension that reads in all the target candidate properties.
Iterate across that data set to compute the distance between your source location and each target property (the distance function takes lat/lng for both and returns the distance in KM which you will convert to feet).
Update the distance computed into a new field for each target property.
Create a view that includes only candidates that are <= 400 (feet).
@Bill.French I had a feeling this was in your wheelhouse, which is why I stopped at calling it “a fun math problem”
@Bill.French I had a feeling this was in your wheelhouse, which is why I stopped at calling it “a fun math problem”
Indeed - has some fun elements to it. When you see the first map showing the desired outcome, that’s pretty exciting. And I suspect there are other ways to get this done using Make or Zapier, but I tend to go straight for the solution that has no dependencies or possible added costs.
GeoEncoding addresses can get pricey, but I have found that a slow cache trickle is how to get millions of address locations without paying a dime. In this project, you could avoid encoding the entire data set of addresses and instead use the zip code of the source location to identify all locations with the same zip, then encode only those, and you’re ready to perform the geometry computations. This would make it possible to limit the encoding calls perhaps enough to stay in Google’s free encoding tier on a daily basis.
In fact, the distance test itself has no business running across the entire data set because homes that are 400 ft from the source location are almost never likely to have neighbours in a different zip code.
Indeed - has some fun elements to it. When you see the first map showing the desired outcome, that’s pretty exciting. And I suspect there are other ways to get this done using Make or Zapier, but I tend to go straight for the solution that has no dependencies or possible added costs.
GeoEncoding addresses can get pricey, but I have found that a slow cache trickle is how to get millions of address locations without paying a dime. In this project, you could avoid encoding the entire data set of addresses and instead use the zip code of the source location to identify all locations with the same zip, then encode only those, and you’re ready to perform the geometry computations. This would make it possible to limit the encoding calls perhaps enough to stay in Google’s free encoding tier on a daily basis.
In fact, the distance test itself has no business running across the entire data set because homes that are 400 ft from the source location are almost never likely to have neighbours in a different zip code.
Yep, this is exactly what I was thinking. How many address’ can there be within 400ft (then I remembered Condos and Apartments exist) but even in that scenario, ZIP should be plenty.
Wow @Bill.French thank you I will test this next week!