added turn restrictions
This commit is contained in:
parent
561b60c5cb
commit
e48cbd49cb
18 changed files with 383 additions and 32 deletions
|
|
@ -32,6 +32,8 @@ public class OsmNode extends OsmLink implements OsmPos
|
|||
* The node-tags, if any
|
||||
*/
|
||||
public byte[] nodeDescription;
|
||||
|
||||
public TurnRestriction firstRestriction;
|
||||
|
||||
/**
|
||||
* The links to other nodes
|
||||
|
|
@ -129,6 +131,22 @@ public class OsmNode extends OsmLink implements OsmPos
|
|||
public final void parseNodeBody2( MicroCache2 mc, OsmNodesMap hollowNodes, IByteArrayUnifier expCtxWay )
|
||||
{
|
||||
ByteArrayUnifier abUnifier = hollowNodes.getByteArrayUnifier();
|
||||
|
||||
// read turn restrictions
|
||||
while( mc.readBoolean() )
|
||||
{
|
||||
TurnRestriction tr = new TurnRestriction();
|
||||
tr.isPositive = mc.readBoolean();
|
||||
tr.fromLon = mc.readInt();
|
||||
tr.fromLat = mc.readInt();
|
||||
tr.toLon = mc.readInt();
|
||||
tr.toLat = mc.readInt();
|
||||
tr.next = firstRestriction;
|
||||
firstRestriction = tr;
|
||||
|
||||
System.out.println( "decoded tr: " + tr );
|
||||
|
||||
}
|
||||
|
||||
selev = mc.readShort();
|
||||
int nodeDescSize = mc.readVarLengthUnsigned();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* Container for a turn restriction
|
||||
*
|
||||
* @author ab
|
||||
*/
|
||||
package btools.mapaccess;
|
||||
|
||||
public final class TurnRestriction
|
||||
{
|
||||
public boolean isPositive;
|
||||
|
||||
public int fromLon;
|
||||
public int fromLat;
|
||||
|
||||
public int toLon;
|
||||
public int toLat;
|
||||
|
||||
public TurnRestriction next;
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "pos=" + isPositive + " fromLon=" + fromLon + " fromLat=" + fromLat + " toLon=" + toLon + " toLat=" + toLat;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue