Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search by latitude & longitude succeeds inconsistently #2366

Open
dredmorbius opened this issue Sep 3, 2019 · 14 comments · May be fixed by #5147
Open

Search by latitude & longitude succeeds inconsistently #2366

dredmorbius opened this issue Sep 3, 2019 · 14 comments · May be fixed by #5147

Comments

@dredmorbius
Copy link

dredmorbius commented Sep 3, 2019

I'll frequently search for a location by latitude and longitude, in either degrees/minutes/seconds, or decimal degrees.

Even using the same format, some queries succeed and display an appropriate map, others fail to find a location.

Search by latitude and longitude should accept reasonably configured inputs, and show the corresponding location on the map.

Examples of input which should be accepted (others may also apply):

28.59° N, 81.60° W
28.59 N, 81.60 W
28.59, -81.60
28°10'20" N, 81°10'20" W
28°10'20" -81°10'20"

Location corresponds to Lake Apopka, north of Winter Garden, FL, USA.

@tomhughes
Copy link
Member

We do already accept a large number of versions as you can see from the large number of tests starting at https://github.com/openstreetmap/openstreetmap-website/blob/master/test/controllers/geocoder_controller_test.rb#L49 but there is a fairly large number of possibilities.

Reasonable patches to extend what can be recognised would of course be welcome.

@tomhughes
Copy link
Member

tomhughes commented Sep 3, 2019

I suspect your main problem may be putting the cardinal direction after the number rather than before judging by the tests? There are some with it after though so not entirely sure.

@tomhughes
Copy link
Member

Two of your examples (the second and third) actually work anyway!

@dredmorbius
Copy link
Author

dredmorbius commented Sep 3, 2019 via email

@tomhughes
Copy link
Member

Also mixing decimals degrees and then adding in minutes and seconds via sexagesimal notation seems a little odd...

@tomhughes
Copy link
Member

It's not going to be transient.

@dredmorbius
Copy link
Author

dredmorbius commented Sep 3, 2019 via email

@dredmorbius
Copy link
Author

Also mixing decimals degrees and then adding in minutes and seconds via sexagesimal notation seems a little odd...

Wups. That was an error on my part, I've edited & corrected the issue.

@dredmorbius
Copy link
Author

An example of a failed lookup:

@tomhughes
Copy link
Member

The actual code is at https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/geocoder_controller.rb#L293 and as you can see the patterns we recognise are already pretty... complicated...

I think the only two of your examples which don't work are the first one, because we don't allow a degree symbol when using decimal degrees, and the last one because we don't allow use of +/- when using sexagesimal notation - we expect N/S/E/W instead.

@dredmorbius
Copy link
Author

dredmorbius commented Sep 3, 2019

Example of a successful lookup:

@dieterdreist
Copy link

dieterdreist commented Sep 3, 2019 via email

@tomhughes
Copy link
Member

Please don't confuse matters @dieterdreist. This is talking about coordinate searches, which are done internally by rails and have nothing to do with Nominatim.

Yes Nominatim may also give results but the "internal" engine should return a position purely based on the coordinates, which is what we are discussing here.

@richlv
Copy link

richlv commented May 16, 2022

Not sure whether this is related closely enough, but from the usability perspective it would be great to be more permissive.
For example, some locales use comma as the decimal separator. Copying coordinates from some software returns no results on osm.org:
28° 34' 31,098" N 16° 11' 14,592" W

Manually changing commas to dots works, but isn't something many users would figure out.
28° 34' 31.098" N 16° 11' 14.592" W

@AntonKhorev AntonKhorev linked a pull request Sep 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants