traccar / traccar

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
4.95k stars 2.51k forks source link

Photon Geocoder #5347

Closed jinzo closed 1 week ago

jinzo commented 1 week ago

This is a basic implementation of the open source Photon Geocoder for reverse geocoding. There isn't much documentation, but the source reveals that only the lang optional parameter is useful for Traccar. After some tests, it seems that the fields are mostly present always and there is little to no deviation (for example, Settlement is always in key city ect.)

jinzo commented 1 week ago

So I refactored the code as in the previous comment. Renamed Photon Geocoder to "standard" GeocodeJSON and refactored the Ban Geocoder based on it because Ban does not provide the country with it's output, and every other solution I thought about was worse. I changed the test (and Ban geocoder behaviour) in two ways:

This changes make Ban geocoder more in line with what other Geocoders store in Address but still does not break any actual running systems.

tananaev commented 1 week ago

Merged, thank you.