variable length tag descriptions (minor lookup versions, bugfixes)
This commit is contained in:
parent
f0b1889afd
commit
eba5737739
9 changed files with 90 additions and 48 deletions
|
|
@ -16,6 +16,7 @@ public final class NodesCache
|
|||
private String segmentDir;
|
||||
private OsmNodesMap nodesMap;
|
||||
private int lookupVersion;
|
||||
private int lookupMinorVersion;
|
||||
private boolean carMode;
|
||||
private String currentFileName;
|
||||
|
||||
|
|
@ -32,11 +33,12 @@ public final class NodesCache
|
|||
private long cacheSum = 0;
|
||||
private boolean garbageCollectionEnabled = false;
|
||||
|
||||
public NodesCache( String segmentDir, OsmNodesMap nodesMap, int lookupVersion, boolean carMode, NodesCache oldCache )
|
||||
public NodesCache( String segmentDir, OsmNodesMap nodesMap, int lookupVersion, int lookupMinorVersion, boolean carMode, NodesCache oldCache )
|
||||
{
|
||||
this.segmentDir = segmentDir;
|
||||
this.nodesMap = nodesMap;
|
||||
this.lookupVersion = lookupVersion;
|
||||
this.lookupMinorVersion = lookupMinorVersion;
|
||||
this.carMode = carMode;
|
||||
|
||||
if ( oldCache != null )
|
||||
|
|
@ -215,7 +217,7 @@ public final class NodesCache
|
|||
if ( f != null )
|
||||
{
|
||||
currentFileName = f.getName();
|
||||
ra = new PhysicalFile( f, iobuffer, lookupVersion );
|
||||
ra = new PhysicalFile( f, iobuffer, lookupVersion, lookupMinorVersion );
|
||||
}
|
||||
fileCache.put( filenameBase, ra );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ public class OsmNode implements OsmPos
|
|||
public static final int WRITEDESC_BITMASK = 0x10;
|
||||
public static final int SKIPDETAILS_BITMASK = 0x08;
|
||||
public static final int NODEDESC_BITMASK = 0x04;
|
||||
public static final int RESERVED1_BITMASK = 0x02;
|
||||
public static final int RESERVED2_BITMASK = 0x01;
|
||||
|
||||
public OsmNode()
|
||||
{
|
||||
|
|
@ -159,6 +161,16 @@ public class OsmNode implements OsmPos
|
|||
is.readFully( ab );
|
||||
nodeDescription = abUnifier.unify( ab );
|
||||
}
|
||||
if ( (bitField & RESERVED1_BITMASK ) != 0 )
|
||||
{
|
||||
byte[] ab = new byte[is.readByte()];
|
||||
is.readFully( ab );
|
||||
}
|
||||
if ( (bitField & RESERVED2_BITMASK ) != 0 )
|
||||
{
|
||||
byte[] ab = new byte[is.readByte()];
|
||||
is.readFully( ab );
|
||||
}
|
||||
if ( (bitField & SKIPDETAILS_BITMASK ) != 0 )
|
||||
{
|
||||
link.counterLinkWritten = true;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ final public class PhysicalFile
|
|||
try
|
||||
{
|
||||
byte[] iobuffer = new byte[65636];
|
||||
pf = new PhysicalFile( f, new byte[65636], -1 );
|
||||
pf = new PhysicalFile( f, new byte[65636], -1, -1 );
|
||||
for( int tileIndex=0; tileIndex<25; tileIndex++ )
|
||||
{
|
||||
OsmFile osmf = new OsmFile( pf, tileIndex, iobuffer );
|
||||
|
|
@ -55,7 +55,7 @@ final public class PhysicalFile
|
|||
return null;
|
||||
}
|
||||
|
||||
public PhysicalFile( File f, byte[] iobuffer, int lookupVersion ) throws Exception
|
||||
public PhysicalFile( File f, byte[] iobuffer, int lookupVersion, int lookupMinorVersion ) throws Exception
|
||||
{
|
||||
fileName = f.getName();
|
||||
|
||||
|
|
@ -67,11 +67,16 @@ final public class PhysicalFile
|
|||
{
|
||||
long lv = dis.readLong();
|
||||
short readVersion = (short)(lv >> 48);
|
||||
if ( readVersion != lookupVersion && lookupVersion != -1 )
|
||||
if ( i == 0 && lookupVersion != -1 && readVersion != lookupVersion )
|
||||
{
|
||||
throw new IllegalArgumentException( "lookup version mismatch (old rd5?) lookups.dat="
|
||||
+ lookupVersion + " " + f. getAbsolutePath() + "=" + readVersion );
|
||||
}
|
||||
if ( i == 1 && lookupMinorVersion != -1 && readVersion < lookupMinorVersion )
|
||||
{
|
||||
throw new IllegalArgumentException( "lookup minor version mismatch (old rd5?) lookups.dat="
|
||||
+ lookupMinorVersion + " " + f. getAbsolutePath() + "=" + readVersion );
|
||||
}
|
||||
fileIndex[i] = lv & 0xffffffffffffL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue