geocoder
geocoder copied to clipboard
Documentation and/or consistency issue
Hi @alexreisner,
first off: thank you, amazing work 💯
I'm a little confused by the following:
- Using
Geocoder.searchleads to@datacontaining"lat"and"lon". - The documentation suggests stubbing
"coordinates". - When using
Model.geocode, it is expected that the coordinates are present within@datain"latitude"and"longitude"
My questions:
- Is there a reason for this deviation?
- Is stubbing
coordinatesmaybe deprecated? - What are the arguments against either using the short form (
lat) or the long form (latitude) consistently?
Cheers,
Finn
Thanks for the good question! To look at each of the cases you mention:
-
@datareflects what's returned by the geocoding API, and each API returns data with potentially a different format. Some uselat, some uselatitude, and I believe at least one returns a 2-element array. Part of the point of Geocoder is to hide these differences, so I think we should ignore the formatting in your Nominatim result when talking about this issue. - Stubbing
coordinatesis recommended. We could have chosen lat/lon instead, but there was a reason for not doing it. Unfortunately I no longer recall what it was, and now we have this convention. - Yes, because that's where they often are. But again, this has more to do with the API responses than with where the data should be stored.
Does that all make sense? Does it clarify anything?