added turn restrictions
This commit is contained in:
parent
561b60c5cb
commit
e48cbd49cb
18 changed files with 383 additions and 32 deletions
|
|
@ -210,12 +210,17 @@ public class BPbfBlobDecoder
|
|||
}
|
||||
}
|
||||
|
||||
private long fromWid;
|
||||
private long toWid;
|
||||
private long viaNid;
|
||||
|
||||
private LongList buildRelationMembers(
|
||||
List<Long> memberIds, List<Integer> memberRoles, List<Osmformat.Relation.MemberType> memberTypes,
|
||||
BPbfFieldDecoder fieldDecoder )
|
||||
{
|
||||
LongList wayIds = new LongList( 16 );
|
||||
|
||||
fromWid = toWid = viaNid = 0;
|
||||
|
||||
Iterator<Long> memberIdIterator = memberIds.iterator();
|
||||
Iterator<Integer> memberRoleIterator = memberRoles.iterator();
|
||||
|
|
@ -235,6 +240,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 ( memberType == Osmformat.Relation.MemberType.NODE ) // currently just waymembers
|
||||
{
|
||||
if ( "via".equals( role ) ) viaNid = refId;
|
||||
}
|
||||
}
|
||||
return wayIds;
|
||||
|
|
@ -249,7 +260,7 @@ public class BPbfBlobDecoder
|
|||
LongList wayIds = buildRelationMembers( relation.getMemidsList(), relation.getRolesSidList(),
|
||||
relation.getTypesList(), fieldDecoder);
|
||||
|
||||
parser.addRelation( relation.getId(), tags, wayIds );
|
||||
parser.addRelation( relation.getId(), tags, wayIds, fromWid, toWid, viaNid );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public class OsmParser extends MapCreatorBase
|
|||
}
|
||||
}
|
||||
|
||||
public void addRelation( long rid, Map<String, String> tags, LongList wayIds )
|
||||
public void addRelation( long rid, Map<String, String> tags, LongList wayIds, long fromWid, long toWid, long viaNid )
|
||||
{
|
||||
RelationData r = new RelationData( rid, wayIds );
|
||||
r.setTags( (HashMap<String,String>)tags );
|
||||
|
|
@ -100,6 +100,7 @@ public class OsmParser extends MapCreatorBase
|
|||
try
|
||||
{
|
||||
rListener.nextRelation( r );
|
||||
rListener.nextRestriction( r, fromWid, toWid, viaNid );
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
javac -d . -cp protobuf.jar;osmosis.jar;brouter.jar BPbfFieldDecoder.java BPbfBlobDecoder.java OsmParser.java
|
||||
javac -d . -cp pbfparser.jar;brouter.jar BPbfFieldDecoder.java BPbfBlobDecoder.java OsmParser.java
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue