tr bike exceptions

This commit is contained in:
Arndt 2016-12-10 19:49:24 +01:00
parent e629a2b2b2
commit f15c5b923e
8 changed files with 55 additions and 5 deletions

View file

@ -224,9 +224,23 @@ public class OsmCutter extends MapCreatorBase
{
return;
}
short exceptions = 0;
String except = r.getTag( "except" );
if ( except != null )
{
exceptions |= toBit( "bicycle" , 0, except );
exceptions |= toBit( "motorcar" , 1, except );
exceptions |= toBit( "agricultural" , 2, except );
exceptions |= toBit( "forestry" , 2, except );
exceptions |= toBit( "psv" , 3, except );
exceptions |= toBit( "hgv" , 4, except );
}
// System.out.println( "restriction id = " + r.rid + " isPositive=" + isPositive + " fromWid = " + fromWid + " toWid = " + toWid+ " viaNid = " + viaNid );
RestrictionData res = new RestrictionData();
res.isPositive = isPositive;
res.exceptions = exceptions;
res.fromWid = fromWid;
res.toWid = toWid;
res.viaNid = viaNid;
@ -234,6 +248,11 @@ public class OsmCutter extends MapCreatorBase
}
private static short toBit( String tag, int bitpos, String s )
{
return (short) ( s.indexOf( tag ) < 0 ? 0 : 1 << bitpos );
}
private int getTileIndex( int ilon, int ilat )
{
int lon = ilon / 45000000;