Open timrobertson100 opened 3 years ago
It is in degrees, i.e. not 22 metres from the coast of Chile but very roughly 2½ km.
Did someone ask for this?
The distance
field is meant to show whether the point is inside or outside the feature, and to order the features the point is outside. I would need to check again how accurate it is, especially nearer the poles, as it is using PostGIS's fast Cartesian geometry functions rather than the version with full topological accuracy: https://postgis.net/docs/ST_Distance.html
Thanks for the explanation @MattBlissett
Did someone ask for this?
Not specifically - I was asked by someone using it what the unit was. Since I didn't know I made the suggestion since others will likely ask too.
distanceInDegrees
might be appropriate or if we don't want people to use it other than for ranking results perhaps sortOrder
or similar would avoid possible misuse (e.g. an inaccurate result at poles).
Thanks for the explanation. Renaming it would be good, to avoid further questions if nothing else. Calculating actual distance would probably be way too slow for an API and the results would be even more likely to raise questions of accuracy due to shape (im)precision.
The geocode API [example call] returns a
distance
field, such as:To improve the intuitiveness I suggest we rename the field to include the unit. I presume this is in kilometers so perhaps something along the lines of
distanceInKM
would be better?