Change geocoder to use OSM - #145
Merged
Merged
Conversation
rhodges
approved these changes
Sep 2, 2026
rhodges
left a comment
Member
There was a problem hiding this comment.
This looks great! I can't wait to see it in action!
| elif service.lower() == 'osm': | ||
| headers = { | ||
| "User-Agent": "Landmapper (Contact: ksdev@ecotrust.org)", | ||
| "Referer": "https://landmapper.ecotrust.org/" |
Member
There was a problem hiding this comment.
Hrm. This might be oregon.landmapper.ecotrust.org or washington.landmapper.ecotrust.org. It's probably best to leave this alone for now, rather than insert a constant from .env/settings.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
asana task
Changes the default service in the
geocodeview to use OSM's Nominatim. I kept in the logic to support using an ArcGIS geocoding service, but I am open to removing the code since we don't plan on using this service.One key piece of logic we needed to change is hard-coding the
contextual_hits, as opposed to hitting the geocoding API with thecontext. This was necessary because the Nominatim API only allows max 1 request per second, so hitting it again would violate the usage policy.Also, for the ArcGIS geocoding API, we are using the geocoder python library. This library has not been updated to support the required headers for Nominatim API, so we have to just hit the API directly.