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

Allow flag “access=private” in vehicleprofile #1265

Open
kashortiexda opened this issue Jun 22, 2024 · 3 comments
Open

Allow flag “access=private” in vehicleprofile #1265

kashortiexda opened this issue Jun 22, 2024 · 3 comments
Labels
good first issue Good for newcomers maptool

Comments

@kashortiexda
Copy link

Hi, I stay in an area that I s designated with flag “access=private” . The navigation won’t start at my location and takes me all sorts of places except to/from the area where I stay.
I have tried all sorts of combinations in navit.xml vehicleprofile
Any pointers on how to access these areas (ie allow access=private) or at least NOT avoid areas marked as access=private

@mvglasow
Copy link
Contributor

Not sure how that is currently being implemented in Navit, but deciding whether it’s OK to use a certain way with access restrictions such as “private”, “customers”, “destination” etc. is complex.

access=private means this way is OK to use this way if you are the owner, or you have permission from the owner or someone authorized to give such permissions on the owner’s behalf. The tricky part is that you would have to tell your navigation system which ways you have this permission for, so it can route you along these ways as needed but not send you on a private road you’re not authorized to use.

A workaround would be to treat access flags like private, customers in a manner similar to access=destination – assume that the user has the right to use these ways if they are the last stretch to the user’s destination or the first stretch from there. Such ways may be used if they are the nearest way from the destination, or from the current location. They can only be used at the start or at the end of the route, even multiple ways, but not in between. Once the vehicle goes from a public to a non-public way, it stays on non-public ways until it reaches its destination.

However, I can’t tell off the top of my head how Navit currently handles access=destination. Does anyone happen to know?

@OLFDB
Copy link
Contributor

OLFDB commented Jun 23, 2024

In maptool/osm.c for access, only destination is handled:

    if (! g_strcmp0(k,"access")) {
        if (g_strcmp0(v,"destination"))
            flagsa[access_value(v)] |=
                AF_DANGEROUS_GOODS|AF_EMERGENCY_VEHICLES|AF_TRANSPORT_TRUCK|AF_DELIVERY_TRUCK|AF_PUBLIC_BUS|AF_TAXI|AF_HIGH_OCCUPANCY_CAR|AF_CAR|AF_MOTORCYCLE|AF_MOPED|AF_HORSE|AF_BIKE|AF_PEDESTRIAN;
        else
            flags[0] |= AF_THROUGH_TRAFFIC_LIMIT;
        if (! g_strcmp0(v,"hov"))
            flags[0] |= AF_HIGH_OCCUPANCY_CAR_ONLY;
        level=5;
    }

For destination AF_THROUGH_TRAFFIC_LIMIT is set in flags[0].

So changing if (g_strcmp0(v,"destination")) to if (g_strcmp0(v,"destination") || g_strcmp0(v,"private")) should achieve what you want.

You need to build maptool and create your map from scratch using the new maptool.

@kashortiexda
Copy link
Author

@OLFDB thank you, this helped fix it.

@jkoan jkoan added maptool good first issue Good for newcomers labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers maptool
Projects
None yet
Development

No branches or pull requests

4 participants