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 for intersections #123
Comments
Is this in somebody plans? |
Not in the immediate future. |
Hi @lonvia , I am relatively new to the OSM community. I want to help and I am particularly interested in search improvement and I would like to try and take on this specific issue. Before I just start digging into code and whatnot I thought I would reach out to you or someone that could provide any guidance, tips etc. |
Hi @VeryStupid, you are warmly welcome to tackle this issue. I don't have yet a clear idea how intersection search should be implemented, so let me just elaborate a bit more on the problem. There are basically two issues to solve. The first is how to detect in a free-form search term that the user is searching for an intersection. This part involves doing a bit of research in which countries intersection searches are commonly used and how they are formulated. Maybe there is a signal word that can be detected and be useful, maybe this needs another solution. The second problem is how to find the intersections in the database. The two extremes are: a) doing to searches and finding intersections between the results and b) precomputing all intersections in the world. They both have different implications for query speed and storage space that need to be explored. The actual solution is likely somewhere in between. The two issues are not completely separate. For example, if we'd really precompute all the intersections then they would have a name like any other object in the database (e.g. name='6th and 8th') and it wouldn't be necessary to 'detect' an intersection query at all. My recommendation would be to start with a small area extract and just get something working as a proof of concept, maybe trying the two extremes above. From the experiences collected, we can discuss how to best scale up. |
I'd love to see this added as well! Intersections are commonly used in Germany. While they aren't used for official addresses, they are frequently used as reference points, e.g. to describe your current position, or where to meet with your friend. If a building is located at an intersection, its location may also be given with the name of the intersection rather than the official address. Street names are usually unique within a German City. There are sometimes exceptions, but I haven't heard of two intersections of different streets existing twice within a City. To find an intersection of streets A and B, you could search for a street named A, then find its nodes that are also part of street B. In spoken German language, intersections are usually referenced as "A-Street, Ecke B-Street" (Ecke = corner). This is also common in written form, but the streets might also just be separated by a Google Maps seems to separate streets with Example:
Note that this example has a gotcha: The street has two intersections with the other street. |
Example for the US from Trac issue #3089: http://nominatim.openstreetmap.org/search?q=hollywood%20blvd%20and%20highland%20ave,%20los%20angeles,%20ca&format=xml&addressdetails=1 |
I would love to see an intersection feature too. To answer "The first is how to detect in a free-form search term that the user is searching for an intersection"
As for "The second problem is how to find the intersections in the database". Split the two streets and do a search in the city for them. It's twice the work for the DB, but after that you should be able to do the intersection work in memory. If the results of the two streets ever touch, then you got a match. If the city wasn't given, you can still limit the search by finding all the streets in the world for street A. Then limit the results for street B by only searching cities returned from street A. That would reduce the search matrix, which is still in memory so it should go fast once you had all the results. I'm not sure how detailed the DB is, but if you know the spoken languages of an area, you could further narrow down the search. If "con" (ESP) is used, then only find results in countries that speak ESP. But I don't think you need to be that picky. As a workaround for now, anytime I see "CON", I'm going to split the two streets and do the search for each in the city. I'll be building a heatmap so the middle of the street will mostly work. I could go a step further and take the lat/long of the two streets and find the middle (avg) between them. If I had to find the REAL intersection, I know tools exist that will tell you where line A intersects line B. But I think it's in JS and I'd rather eat my own head than touch that.
|
I'm creating a crime data analysis application where some of the locations provided by the law enforcement reports include cross streets as opposed to concrete addresses or block numbers. This would be a much appreciated feature for myself as well. I like the approach mentioned above looking for intersections by comparing latitude and longitude and will likely do something like that in the meantime. |
Converts Location column to latitude /longitude. -Selects 20 random records which haven't been geocoded. -Does some data cleaning. (Saves cleaned Location in "Processed Location" in MPD.GEOCODED. -"Solves" OSM Nominatim Intersection search, which seems to be an open problem (osm-search/Nominatim#123). Intersection solution tries 3 methods and utilizes linear regression & traveling salesman problem. The solution may result in lat/long coordinates that are not perfectly accurate, but it allows us to avoid using google API for bulk requests which would potentially cost us money. -Copies lat/long/processed_location to any records which haven't been geocoded IF those records have a Location value which has already been geocoded. This file will be put on a crontab Signed-off-by: calglu <82549313+calglu@users.noreply.github.com>
In Quito street numbering is almost nonexistent therefore it is very important we be able to search by cross streets.
Here is an example of the issue, you will see it cannot find the intersection.
http://www.openstreetmap.org/search?query=isla%20genovesa%20and%20rio%20coca#map=20/-0.20478/-78.49193&layers=HN
The text was updated successfully, but these errors were encountered: