Test version

This commit is contained in:
Victor Shcherb 2012-03-19 00:39:04 +01:00
parent 8a2a0a2d08
commit 282101588b
5 changed files with 23 additions and 14 deletions

View file

@ -50,7 +50,7 @@ public class BinaryInspector {
// inspector(new String[]{"-v","C:\\Users\\tpd\\osmand\\Housenumbers.obf"});
//inspector(new String[]{"/home/victor/projects/OsmAnd/data/osm-gen/saved/Belarus-newzooms-new-rt.obf"});
// inspector(new String[]{"/home/victor/projects/OsmAnd/download/spain/Spain_europe_1_small.obf"});
inspector(new String[]{/*"-vmap", */"/home/victor/projects/OsmAnd/data/osm-gen/Luxembourg.obf"});
inspector(new String[]{"-vmap","/home/victor/projects/OsmAnd/data/osm-gen/Luxembourg.obf"});
// test case extract parts
@ -513,12 +513,14 @@ public class BinaryInspector {
}
TagValuePair pair = obj.getMapIndex().decodeType(types[j]);
if(pair == null) {
throw new NullPointerException("Type " + types[j] + "was not found");
System.err.println("Type " + types[j] + "was not found");
continue;
// throw new NullPointerException("Type " + obj.getAdditionalTypes()[j] + "was not found");
}
b.append(pair.toSimpleString()+"("+types[j]+")");
}
b.append("]");
if(obj.getAdditionalTypes() != null){
if(obj.getAdditionalTypes() != null && obj.getAdditionalTypes().length > 0){
b.append(" add_types [");
for(int j = 0; j<obj.getAdditionalTypes().length; j++){
if(j > 0) {
@ -526,7 +528,9 @@ public class BinaryInspector {
}
TagValuePair pair = obj.getMapIndex().decodeType(obj.getAdditionalTypes()[j]);
if(pair == null) {
throw new NullPointerException("Type " + obj.getAdditionalTypes()[j] + "was not found");
System.err.println("Type " + obj.getAdditionalTypes()[j] + "was not found");
continue;
// throw new NullPointerException("Type " + obj.getAdditionalTypes()[j] + "was not found");
}
b.append(pair.toSimpleString()+"("+obj.getAdditionalTypes()[j]+")");

View file

@ -1448,9 +1448,9 @@ public class BinaryMapIndexReader {
private static boolean testPoiSearch = false;
private static boolean testTransportSearch = false;
private static int sleft = MapUtils.get31TileNumberX(6.3);
private static int sright = MapUtils.get31TileNumberX(6.4);
private static int stop = MapUtils.get31TileNumberY(49.5);
private static int sbottom = MapUtils.get31TileNumberY(49.4);
private static int sright = MapUtils.get31TileNumberX(6.5);
private static int stop = MapUtils.get31TileNumberY(49.9);
private static int sbottom = MapUtils.get31TileNumberY(49.7);
private static int szoom = 15;
private static void println(String s){
@ -1696,7 +1696,7 @@ public class BinaryMapIndexReader {
b.append(pair.toSimpleString()+"("+types[j]+")");
}
b.append("]");
if(obj.getAdditionalTypes() != null){
if(obj.getAdditionalTypes() != null && obj.getAdditionalTypes().length > 0){
b.append(" add_types [");
for(int j = 0; j<obj.getAdditionalTypes().length; j++){
if(j > 0) {

View file

@ -626,9 +626,9 @@ public class IndexCreator {
long time = System.currentTimeMillis();
IndexCreator creator = new IndexCreator(new File("/home/victor/projects/OsmAnd/data/osm-gen/")); //$NON-NLS-1$
creator.setIndexMap(true);
creator.setIndexAddress(true);
creator.setIndexPOI(true);
creator.setIndexTransport(true);
creator.setIndexAddress(false);
creator.setIndexPOI(false);
creator.setIndexTransport(false);
creator.recreateOnlyBinaryFile = false;
creator.deleteDatabaseIndexes = false;

View file

@ -356,8 +356,8 @@ public class IndexVectorMapCreator extends AbstractIndexPartCreator {
if (visitedWays.contains(id)) {
continue;
}
visitedWays.add(id);
int level = rs.getInt(8);
int zoom = mapZooms.getLevel(level).getMaxZoom();
@ -458,6 +458,8 @@ public class IndexVectorMapCreator extends AbstractIndexPartCreator {
insertBinaryMapRenderObjectIndex(mapTree[level], res, null, namesUse, id, false, typeUse, addtypeUse, false);
}
}
// end cycle
}
@ -795,13 +797,13 @@ public class IndexVectorMapCreator extends AbstractIndexPartCreator {
}
for (int j = 0; j < types.size(); j++) {
try {
Algoritms.writeInt(bTypes, types.get(j));
Algoritms.writeSmallInt(bTypes, types.get(j));
} catch (IOException e) {
}
}
for (int j = 0; j < addTypes.size(); j++) {
try {
Algoritms.writeInt(bAddtTypes, addTypes.get(j));
Algoritms.writeSmallInt(bAddtTypes, addTypes.get(j));
} catch (IOException e) {
}
}

View file

@ -153,6 +153,9 @@ public class MapRenderingTypes {
if (rType.minzoom > zoom) {
continue;
}
if(rType.targetTagValue != null) {
rType = rType.targetTagValue;
}
rType.freq++;
if (rType.names != null) {
for (int i = 0; i < rType.names.length; i++) {