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

Street appears like uncharted territory #1274

Open
Eldkatten opened this issue Sep 15, 2024 · 10 comments
Open

Street appears like uncharted territory #1274

Eldkatten opened this issue Sep 15, 2024 · 10 comments

Comments

@Eldkatten
Copy link

Hello,

while the problem descirbed in #1273 was caused by outdated map information, I now have the problem that route calculation fails because the start or destination street appears as if it were uncharted territory.

In www.openstreetmap.org that's the street:

OSM_Altstrasse

This means that the street is designated to bicycles, but motorized vehicles are allowed.

When I switch the vehicle profile to "pedestrian", this is the route I get, setting both start and destination in the street in question:

pedestrian

Note that at the start it already looks as if there were no street at all, but open field, because the route leads straight through buildings, ignoring the streets (corner "Altstrasse" and "Clermontstrasse")

When I switch to "bicycle", this is what I get:

bike

Note how the route switches from following the street until the end of the blind alley branching off "Virchowstrasse", where it seems to treat the area again as if it where open field.

When I switch to "car" profile, I either get something similar to "bicycle" or no route at all, the latter especially when the destination is not on "Altstrasse" as well, but somewhere farther away.

I tried to find out what's the crucial difference between "bicycle" and "pedestrian" in the profile, before I would try to find out why "car" doesn't work at all. Unfortunately, I didn't find any entries that would make at least the "bicycle" route the same or at least close to the "pedestrian" route, so I didn't even try with the "car" profile.

Sorry for the lengthy description. The issue is quite important for me, since I live in the neighbourhood of that street (and the effect seems to apply to other streets, too, like "Clermontstrasse"), so most routes start or end there. While driving "home" isn't exactly the problem, because I know the route, but Navit doesn't calculate a route when I'm near my "home" position, so it is impossible to have a look at a route before I start, like ETA and total distance.

Does someone have an idea if this is a problem with the map data, or something about how Navit vaildates the streets and calculates the route? Maybe someone knows how to fix it?

Thanks a lot for reading so far, and for any potential hints to a solution.
Have a good day.

@mvglasow
Copy link
Contributor

Some background to start with:

  • Position and destination may be off-road, in which case Navit tries to route from/to a nearby point on a street, and add a short off-road stretch at either end of the route. However, it is odd that in both your examples Navit does not seem to route from your current position but from a nearby position (Altstrasse, in front of house no. 3).
  • Roads which are inaccessible for the current type of vehicle are treated as nonexistent (iirc) – that means, your position could be smack on the road and Navit would treat that as being in the middle of a meadow, sending you along the shortest path to the nearest way your vehicle type is allowed to use.

That Navit does not consider Altstrasse for bikes at all (but does so for pedestrians) indicates a problem with access flags. To figure that out: tap Altstrasse, then Vehicle Position (vehicle icon) > POIs > Search (magnifying glass) > enter Altstrasse > select the closes occurrence from the list > View Attributes.

The attribute list should have a flags attribute, roughly of the following form:

flags:0xfff00040:|AF_SPEED_LIMIT|AF_ALL

These flags tell Navit what vehicles may use this particular stretch of road, and what other restrictions apply (speed limit, one-way etc.). What are the access flags for the street in question?

@Eldkatten
Copy link
Author

Eldkatten commented Sep 15, 2024

Hello and thank you for the detailed instructions, I would have been lost otherwise :)
So, the flags are: 0xa0000040:|AF_SPEED_LIMIT|AF_HORSE|AF_PEDESTRIAN
I think that means the street is only available for pedestrians and... horses. Well, that would explain the problem.
Is there a way to change those access-flags?

Thanks a lot so far, though we might not be able to solve the issue, if the problem lies within the map data itself.

P.S.: I just see that the same flags apply to Clermontstrasse as well.
2nd P.S.: I checked another "Fahrradstrasse" (bicycle road) a bit further away, with no direct connection to the area I was talking about, and it shows the same flags: 0xa0000040:|AF_SPEED_LIMIT|AF_HORSE|AF_PEDESTRIAN
All surrounding streets have 0xa0000040:|AF_SPEED_LIMIT|AF_ALL

@mvglasow
Copy link
Contributor

That looks indeed like Navit treats it as allowing only horses and pedestrians. If you tried to calculate a horseback route, Navit probably would send you down Altstraße (similar to the pedestrian route), but a car route would avoid it (similar to the bike route).

Does Clermontstraße have the same access restrictions in OSM? That would indicate a bug in maptool, wild guess is that it’s tripping over designated.

@Eldkatten
Copy link
Author

Sorry, our posts overlapped, I answered your question in my original post before yours.

@Eldkatten
Copy link
Author

Eldkatten commented Sep 15, 2024

Also, someone from OSM directed me to this page:
https://wiki.openstreetmap.org/wiki/DE:Tag:bicycle_road%3Dyes#Zusatzzeichen

It says that "Fahrradstrasse" keeps the tag 'vehicle=no', but depending on additional permits it gets additional tags like 'motor_vehicle=yes' or 'motorcycle=yes'

@mvglasow
Copy link
Contributor

As far as I can see, Altstraße should be tagged bicycle=designated; motor_vehicle=yes. In any case, flags in Navit should be such that bicycles are allowed, which does not seem to be the case.

@Eldkatten
Copy link
Author

Is there anything I can do?
I treated the *.bin as *.zip and searched in the unpacked files for "Altstra" (without the "ße"), and tried to figure out which bytes the flag are. Didn't work.

@mvglasow
Copy link
Contributor

I doubt there’s much to be gained from poking around in binary map files – what you posted is quite a clear indication that the flags on the way are incorrect in the map data. This would need to be fixed in the tool with which the map was generated, most likely maptool.

If you feel like getting your hands dirty on Navit code (which would be much appreciated), you can clone the repo and build maptool from source. The code in question, i.e. where access tags get converted into flags, is most likely in navit/maptool/osm.c, in or around osm_add_tag().

To test changes made there, grab an OSM extract of the area in which you are experiencing the issue. Build maptool and process the OSM extract into a map file.

Then feed that map file into Navit, making sure it is not using any other map files of the same area. You don’t need to build Navit yourself – any recent prebuilt binary will do, for example the latest (or reasonably recent) CI artifacts from trunk. You can run Navit on your desktop PC to do these tests, which may be easier than messing with whatever device you use for actual navigation.

Now determine the flags for the way in question as described in my last post and examine them. (Btw, access flags are defined in navit/attr.h, starting around line 38.) Flags should include AF_BIKE or one of the flags which include AF_BIKE, i.e. AF_PBH or AF_ALL.

@Eldkatten
Copy link
Author

Thank you for all the information 😊
I expected that I would need to compile Maptool myself after I changed things. I'm not afraid of software, it's just that I usually use IDEs like MS Visual Studio or Embarcadero RAD Studio, and it has been ages since I used a tool chain with command line compiler and linker. It will probably be fun to set it up again, but it will take a while.
So, I think I'll close this thread now, ok?

Thanks again for your valuable help 😃

@mvglasow
Copy link
Contributor

For a quicker test, you could also fork the repo on Github, commit and push your changes and let CI do the rest – if you don’t need too many build runs (CI job runtime is limited).

If we have a confirmed bug in Maptool, it would make sense to leave the issue open as long as it is not resolved – it might affect other users as well.

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

No branches or pull requests

2 participants