BinaryInspector: print restrictions and coordinates for roads

This commit is contained in:
Roman Inflianskas 2016-04-26 18:31:37 +03:00
parent 9072e1f6d3
commit ae04bf705a
2 changed files with 28 additions and 2 deletions

View file

@ -547,6 +547,21 @@ public class BinaryInspector {
b.append(" ").append(rr.getTag()).append("='").append(obj.getNames().get(key)).append("'");
}
}
if (obj.restrictions != null) {
b.append(" restrictions=");
for (int i = 0; i != obj.restrictions.length; i++) {
b.append(obj.getRestrictionId(i)).append(",");
}
b.append(" ");
}
if (vInfo.vmapCoordinates) {
b.append(" lat/lon : ");
for (int i = 0; i < obj.getPointsLength(); i++) {
float x = (float) MapUtils.get31LongitudeX(obj.getPoint31XTile(i));
float y = (float) MapUtils.get31LatitudeY(obj.getPoint31YTile(i));
b.append(y).append(" / ").append(x).append(" , ");
}
}
println(b.toString());
return false;
}

View file

@ -8,6 +8,7 @@ import java.text.MessageFormat;
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion;
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
public class RouteDataObject {
/*private */static final int RESTRICTION_SHIFT = 3;
@ -467,6 +468,16 @@ public class RouteDataObject {
assertTrueLength("15ft", 4.572f);
}
public String coordinates() {
StringBuilder b = new StringBuilder();
b.append(" lat/lon : ");
for (int i = 0; i < getPointsLength(); i++) {
float x = (float) MapUtils.get31LongitudeX(getPoint31XTile(i));
float y = (float) MapUtils.get31LatitudeY(getPoint31YTile(i));
b.append(y).append(" / ").append(x).append(" , ");
}
return b.toString();
}
@Override
public String toString() {