Having issues with different locations
Closed this issue · 4 comments
Hi there, thanks a lot for reporting this issue. Sadly, the algorithm not working universally with every city is a problem which is dependent on many factors and thus cannot be solved with a simple fix. One of the problems being OpenStreetMap itself, by not having unique city / state / country name patterns. But thanks to the visualization you attached, it's safe to say that it at least definitely downloaded data for the input you provided. However, it looks like the algorithm, perhaps the Bresenham part, had a problem with processing and calculating the data.
Could you provide some test data (city, state and country parameters) you used so I can investigate that problem in detail?
Actually, I have changed to (city, state, country) parameters to bounding box. The sample debug data is attached. This is the re-writen data crawler using bbox. https://github.com/Lasith-Niro/arnis/blob/main/src/getData.py
I like your bounding box approach - I tried it at some point too because of the OSM naming unreliability which really bothers me. Unfortunately I failed to implement it into the project because the processData.py algorithm is designed for the street / state / country input and the bounding box approach returns a slightly different data scheme which cannot be processed with the current design of the Arnis algorithm. To be honest I don't remember every detail anymore, but as far as I know this was the reason and I guess this is also the problem in your case.
For your case, can you try if the following code (to be changed in getData.py) works for you? Run it with --city "Ballina" --state "Mayo" --country "Ireland"
. According to Overpass-Turbo it should return exactly what you need.
query1 = (
"""
[out:json];
(
way(around:10000, 54.114136, -9.155093);
)->.region;
area[name="""
+ '"'
+ city
+ '"'
+ """]->.city;
area[name="""
+ '"'
+ state
+ '"'
+ """]->.state;
area[name="""
+ '"'
+ country
+ '"'
+ """]->.country;
way(area.country)(area.state)(area.city)[!power][!place][!ferry];
(._;>;);
out;
"""
)
Implementing a reliable city fetching approach is definitely one of the highest priority tasks on the TODO list for this project. But I guess this requires a very time consuming deep dive into the code and a complete redesign of the algorithm. Finding a reliable identifier for a city which is the same in every country is really a challenge. I noticed quite a wave of new people showing interest in this open source project lately, so I might invest some time into implementing this.
Hi there, better late then never! I just merged an awesome PR containing a bounding box implementation as well as a general refactoring of a huge portion of the code which should hopefully address this issue. :)