no_entry/no_exit TRs
This commit is contained in:
parent
997beb0e96
commit
7889bf85db
4 changed files with 33 additions and 12 deletions
|
@ -210,9 +210,19 @@ public class BPbfBlobDecoder
|
|||
}
|
||||
}
|
||||
|
||||
private long fromWid;
|
||||
private long toWid;
|
||||
private long viaNid;
|
||||
private LongList fromWid;
|
||||
private LongList toWid;
|
||||
private LongList viaNid;
|
||||
|
||||
private LongList addLong( LongList ll, long l )
|
||||
{
|
||||
if ( ll == null )
|
||||
{
|
||||
ll = new LongList( 1 );
|
||||
}
|
||||
ll.add( l );
|
||||
return ll;
|
||||
}
|
||||
|
||||
private LongList buildRelationMembers(
|
||||
List<Long> memberIds, List<Integer> memberRoles, List<Osmformat.Relation.MemberType> memberTypes,
|
||||
|
@ -220,7 +230,7 @@ public class BPbfBlobDecoder
|
|||
{
|
||||
LongList wayIds = new LongList( 16 );
|
||||
|
||||
fromWid = toWid = viaNid = 0;
|
||||
fromWid = toWid = viaNid = null;
|
||||
|
||||
Iterator<Long> memberIdIterator = memberIds.iterator();
|
||||
Iterator<Integer> memberRoleIterator = memberRoles.iterator();
|
||||
|
@ -240,12 +250,12 @@ public class BPbfBlobDecoder
|
|||
if ( memberType == Osmformat.Relation.MemberType.WAY ) // currently just waymembers
|
||||
{
|
||||
wayIds.add( refId );
|
||||
if ( "from".equals( role ) ) fromWid = refId;
|
||||
if ( "to".equals( role ) ) toWid = refId;
|
||||
if ( "from".equals( role ) ) fromWid = addLong( fromWid, refId );
|
||||
if ( "to".equals( role ) ) toWid = addLong( toWid, refId );
|
||||
}
|
||||
if ( memberType == Osmformat.Relation.MemberType.NODE ) // currently just waymembers
|
||||
{
|
||||
if ( "via".equals( role ) ) viaNid = refId;
|
||||
if ( "via".equals( role ) ) viaNid = addLong( viaNid, refId );
|
||||
}
|
||||
}
|
||||
return wayIds;
|
||||
|
|
|
@ -92,7 +92,7 @@ public class OsmParser extends MapCreatorBase
|
|||
}
|
||||
}
|
||||
|
||||
public void addRelation( long rid, Map<String, String> tags, LongList wayIds, long fromWid, long toWid, long viaNid )
|
||||
public void addRelation( long rid, Map<String, String> tags, LongList wayIds, LongList fromWid, LongList toWid, LongList viaNid )
|
||||
{
|
||||
RelationData r = new RelationData( rid, wayIds );
|
||||
r.setTags( (HashMap<String,String>)tags );
|
||||
|
@ -100,7 +100,17 @@ public class OsmParser extends MapCreatorBase
|
|||
try
|
||||
{
|
||||
rListener.nextRelation( r );
|
||||
rListener.nextRestriction( r, fromWid, toWid, viaNid );
|
||||
if ( fromWid == null || toWid == null || viaNid == null || viaNid.size() != 1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
for( int fi = 0; fi < fromWid.size(); fi++ )
|
||||
{
|
||||
for( int ti = 0; ti < toWid.size(); ti++ )
|
||||
{
|
||||
rListener.nextRestriction( r, fromWid.get( fi ), toWid.get( ti ), viaNid.get( 0 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
|
|
|
@ -18,5 +18,6 @@ brouter.jar in this folder
|
|||
-> pack all the compiled class files together in a jar
|
||||
"pbfparser.jar" with "jar cf pbfparser.jar btools/**/*.class"
|
||||
|
||||
Alternatively, you can run the Mapcreator against a *xml.bz2 Database-Extract,
|
||||
then you don't need the pbf-parser.
|
||||
Alternatively, just for testing you can run the Mapcreator against a *xml.bz2 Database-Extract,
|
||||
then you don't need the pbf-parser. However, the XML-Parser does not (yet) parse
|
||||
Turn-Restrictions, so really just for testing...
|
||||
|
|
|
@ -1 +1 @@
|
|||
javac -d . -cp pbfparser.jar;brouter.jar BPbfFieldDecoder.java BPbfBlobDecoder.java OsmParser.java OsmParser2.java
|
||||
javac -d . -cp pbfparser.jar;brouter.jar BPbfFieldDecoder.java BPbfBlobDecoder.java OsmParser.java
|
||||
|
|
Loading…
Reference in a new issue