Formatting

This commit is contained in:
Roman Inflianskas 2016-05-17 15:20:56 +03:00
parent e01f700b66
commit ada4335ea5
3 changed files with 597 additions and 599 deletions

View file

@ -71,11 +71,6 @@ public class BinaryInspector {
// "-vrouting",
"-vaddress", "-vcities","-vstreetgroups",
"-vstreets", "-vbuildings", "-vintersections",
// "-zoom=15",
// "-bbox=1.74,51.17,1.75,51.16",
// "-vstats",
// "/Users/victorshcherb/osmand/maps/Synthetic_test_rendering.obf"
// "/Users/victorshcherb/osmand/maps/Netherlands_europe_2.road.obf"
"/Users/victorshcherb/osmand/maps/Argentina_southamerica_2.obf"
});
} else {
@ -211,7 +206,7 @@ public class BinaryInspector {
public void close() throws IOException {
if (osmOut != null) {
osmOut.close();;
osmOut.close();
osmOut = null;
}
@ -266,6 +261,7 @@ public class BinaryInspector {
printFileInformation(f);
}
}
public static final void writeInt(CodedOutputStream ous, int v) throws IOException {
ous.writeRawByte((v >>> 24) & 0xFF);
ous.writeRawByte((v >>> 16) & 0xFF);
@ -445,7 +441,6 @@ public class BinaryInspector {
printFileInformation(file);
}
public void printFileInformation(File file) throws IOException {
RandomAccessFile r = new RandomAccessFile(file.getAbsolutePath(), "r");
printFileInformation(r, file);
@ -462,7 +457,7 @@ public class BinaryInspector {
if (p instanceof MapIndex) {
partname = "Map";
} else if (p instanceof TransportIndex) {
partname = "Transport";
} else if (p instanceof RouteRegion) {
partname = "Routing";
} else if (p instanceof PoiRegion) {
@ -870,6 +865,7 @@ public class BinaryInspector {
}
return false;
}
@Override
public boolean isCancelled() {
return false;
@ -889,7 +885,6 @@ public class BinaryInspector {
}
private static void printMapDetails(BinaryMapDataObject obj, StringBuilder b, boolean vmapCoordinates) {
boolean multipolygon = obj.getPolygonInnerCoordinates() != null && obj.getPolygonInnerCoordinates().length > 0;
if (multipolygon) {
@ -1022,7 +1017,7 @@ public class BinaryInspector {
if (multipolygon) {
int[][] polygonInnerCoordinates = obj.getPolygonInnerCoordinates();
for (int j = 0; j < polygonInnerCoordinates.length; j++) {
ids.clear();;
ids.clear();
for (int i = 0; i < polygonInnerCoordinates[j].length; i += 2) {
float lon = (float) MapUtils.get31LongitudeX(polygonInnerCoordinates[j][i]);
float lat = (float) MapUtils.get31LatitudeY(polygonInnerCoordinates[j][i + 1]);
@ -1098,6 +1093,7 @@ public class BinaryInspector {
println(object.getType().getKeyName() + " : " + object.getSubType() + " " + object.getName() + " " + object.getLocation() + " id=" + (object.getId() >> 1) + " " + s);
return false;
}
@Override
public boolean isCancelled() {
return false;

View file

@ -66,7 +66,6 @@ public class BinaryMapAddressReaderAdapter {
return indexNameOffset;
}
public String getPartName() {
return "Address";
}

View file

@ -319,7 +319,6 @@ public class BinaryMapIndexReader {
return false;
}
public boolean containsPoiData(double topLatitude, double leftLongitude, double bottomLatitude, double rightLongitude) {
for (PoiRegion index : poiIndexes) {
if (index.rightLongitude >= leftLongitude && index.leftLongitude <= rightLongitude &&
@ -365,7 +364,6 @@ public class BinaryMapIndexReader {
}
public RandomAccessFile getRaf() {
return raf;
}
@ -397,7 +395,6 @@ public class BinaryMapIndexReader {
}
protected void skipUnknownField(int tag) throws IOException {
int wireType = WireFormat.getTagWireType(tag);
if (wireType == WireFormat.WIRETYPE_FIXED32_LENGTH_DELIMITED) {
@ -799,7 +796,6 @@ public class BinaryMapIndexReader {
}
public List<BinaryMapDataObject> searchMapIndex(SearchRequest<BinaryMapDataObject> req) throws IOException {
req.numberOfVisitedObjects = 0;
req.numberOfAcceptedObjects = 0;
@ -1421,7 +1417,6 @@ public class BinaryMapIndexReader {
}
public static <T> SearchRequest<T> buildAddressByNameRequest(ResultMatcher<T> resultMatcher, String nameRequest) {
SearchRequest<T> request = new SearchRequest<T>();
request.resultMatcher = resultMatcher;
@ -1506,8 +1501,6 @@ public class BinaryMapIndexReader {
}
public static SearchRequest<Amenity> buildSearchPoiRequest(int x, int y, String nameFilter, int sleft, int sright, int stop, int sbottom, ResultMatcher<Amenity> resultMatcher) {
SearchRequest<Amenity> request = new SearchRequest<Amenity>();
request.x = x;
@ -1681,6 +1674,7 @@ public class BinaryMapIndexReader {
public boolean limitExceeded() {
return limit != -1 && searchResults.size() > limit;
}
public boolean isCancelled() {
if (this.interrupted) {
return interrupted;
@ -1743,6 +1737,9 @@ public class BinaryMapIndexReader {
public static class MapIndex extends BinaryIndexPart {
public String getPartName() { return "Map"; }
public int getFieldNumber() { return OsmandOdb.OsmAndStructure.MAPINDEX_FIELD_NUMBER; }
List<MapRoot> roots = new ArrayList<MapRoot>();
Map<String, Map<String, Integer>> encodingRules = new HashMap<String, Map<String, Integer>>();
@ -1913,6 +1910,7 @@ public class BinaryMapIndexReader {
public int getMinZoom() {
return minZoom;
}
public int getMaxZoom() {
return maxZoom;
}
@ -1935,12 +1933,15 @@ public class BinaryMapIndexReader {
public int getLeft() {
return left;
}
public int getRight() {
return right;
}
public int getTop() {
return top;
}
public int getBottom() {
return bottom;
}
@ -1948,6 +1949,7 @@ public class BinaryMapIndexReader {
public int getLength() {
return length;
}
public int getFilePointer() {
return filePointer;
}
@ -2268,6 +2270,7 @@ public class BinaryMapIndexReader {
}
return false;
}
@Override
public boolean isCancelled() {
return false;
@ -2302,6 +2305,7 @@ public class BinaryMapIndexReader {
}
return false;
}
@Override
public boolean isCancelled() {
return false;
@ -2492,5 +2496,4 @@ public class BinaryMapIndexReader {
}
}