added main method to text-decode an rd5
This commit is contained in:
parent
2121a8d57f
commit
8f02ee8351
2 changed files with 21 additions and 4 deletions
|
@ -60,7 +60,7 @@ public final class MicroCache2 extends MicroCache
|
|||
int[] alon = size > dataBuffers.alon.length ? new int[size] : dataBuffers.alon;
|
||||
int[] alat = size > dataBuffers.alat.length ? new int[size] : dataBuffers.alat;
|
||||
|
||||
if ( debug ) System.out.println( "*** decoding cache of size=" + size );
|
||||
if ( debug ) System.out.println( "*** decoding cache of size=" + size + " for lonIdx=" + lonIdx + " latIdx=" + latIdx );
|
||||
|
||||
bc.decodeSortedArray( faid, 0, size, 0x20000000, 0 );
|
||||
|
||||
|
@ -124,7 +124,7 @@ public final class MicroCache2 extends MicroCache
|
|||
writeVarBytes( nodeTags == null ? null : nodeTags.data );
|
||||
|
||||
int links = bc.decodeNoisyNumber( 1 );
|
||||
if ( debug ) System.out.println( "*** decoding node with links=" + links );
|
||||
if ( debug ) System.out.println( "*** decoding node " + ilon + "/" + ilat + " with links=" + links );
|
||||
for( int li=0; li<links; li++ )
|
||||
{
|
||||
int sizeoffset = 0;
|
||||
|
@ -145,6 +145,8 @@ public final class MicroCache2 extends MicroCache
|
|||
dlon_remaining = extLonDiff.decodeSignedValue();
|
||||
dlat_remaining = extLatDiff.decodeSignedValue();
|
||||
}
|
||||
if ( debug ) System.out.println( "*** decoding link to " + (ilon+dlon_remaining) + "/" + (ilat+dlat_remaining) + " extern=" + (nodeIdx == n) );
|
||||
|
||||
TagValueWrapper wayTags = wayTagCoder.decodeTagValueSet();
|
||||
|
||||
if ( wayTags != null )
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.io.IOException;
|
|||
import java.io.RandomAccessFile;
|
||||
|
||||
import btools.codec.DataBuffers;
|
||||
import btools.codec.MicroCache;
|
||||
import btools.util.ByteDataReader;
|
||||
import btools.util.Crc32;
|
||||
|
||||
|
@ -26,6 +27,20 @@ final public class PhysicalFile
|
|||
|
||||
public int divisor = 80;
|
||||
|
||||
public static void main( String[] args )
|
||||
{
|
||||
MicroCache.debug = true;
|
||||
|
||||
String message = checkFileIntegrity( new File( args[0] ) );
|
||||
|
||||
if ( message != null )
|
||||
{
|
||||
System.out.println( "************************************" );
|
||||
System.out.println( message );
|
||||
System.out.println( "************************************" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the integrity of the file using the build-in checksums
|
||||
*
|
||||
|
@ -47,7 +62,7 @@ final public class PhysicalFile
|
|||
if ( osmf.hasData() )
|
||||
for ( int lonIdx = 0; lonIdx < div; lonIdx++ )
|
||||
for ( int latIdx = 0; latIdx < div; latIdx++ )
|
||||
osmf.createMicroCache( lonDegree * div + lonIdx, latDegree * div + latIdx, dataBuffers, null, null, false );
|
||||
osmf.createMicroCache( lonDegree * div + lonIdx, latDegree * div + latIdx, dataBuffers, null, null, MicroCache.debug );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue