Closed WillNilges closed 7 months ago
@andybaumgar
@willard Yeah not really relevant to this PR but we need to "geocode" the address at some point in order to get the lat long. That could be in a separate view.
Just found this, which could be interesting. If I'm understanding correctly, this will use the Google Maps API to determine a correct address given an input.
Will try and play with it.
Oh boy, address validation is a bit of a rabbit hole.
We could use Google's GeoCoding API, but it's only free for 40k requests per month. Unlikely we'd go over that, but someone could just hammer us with requests and rack up charges.
I haven't found much else that's super helpful.
This has been an issue in the past, we periodically have to top up the prepaid card linked to a Google Cloud Maps API account. But so long as we are careful about storing the georeference in the db we should be able to use a single API call for each install request which is only a few cents.
That's a good point about someone doing fake requests. We should probably have some sort of alert if the API call fails. Or maybe just a unit test that runs each night.
If it ain't broke don't fix it, but would OpenStreetMap be a better choice for this?
https://wiki.openstreetmap.org/wiki/API We want the Overpass API (read-only)
https://wiki.openstreetmap.org/wiki/Overpass_API
This would be cool assuming it is accurate. It would remove the need for the maps API.
In the past I had issues with other free services because they introduced an offset from the Google Maps data.
Complete via #76
I think I got email covered using
EmailField
, but we need a way to validate peoples' phone number formats, and their addresses.https://github.com/andybaumgar/meshdb/blob/90e51008b810cb1c305e8950396c85f0a7354263/src/meshapi/models.py#L31
https://github.com/andybaumgar/meshdb/blob/90e51008b810cb1c305e8950396c85f0a7354263/src/meshapi/models.py#L14-L17