added turn restrictions

This commit is contained in:
Arndt 2016-11-20 22:31:10 +01:00
parent 561b60c5cb
commit e48cbd49cb
18 changed files with 383 additions and 32 deletions

View file

@ -96,6 +96,11 @@ public class OsmNodeP extends OsmLinkP
return null;
}
public RestrictionData getFirstRestriction()
{
return null;
}
public void writeNodeData( MicroCache mc ) throws IOException
{
boolean valid = true;
@ -164,6 +169,21 @@ public class OsmNodeP extends OsmLinkP
public boolean writeNodeData2( MicroCache2 mc ) throws IOException
{
boolean hasLinks = false;
// write turn restrictions
RestrictionData r = getFirstRestriction();
while( r != null )
{
mc.writeBoolean( true ); // restriction follows
mc.writeBoolean( r.isPositive );
mc.writeInt( r.fromLon );
mc.writeInt( r.fromLat );
mc.writeInt( r.toLon );
mc.writeInt( r.toLat );
r = r.next;
}
mc.writeBoolean( false ); // end restritions
mc.writeShort( getSElev() );
mc.writeVarBytes( getNodeDecsription() );