Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-06-24 13:48:29 +02:00
commit ce4d377941

9
OsmAnd-java/src/net/osmand/osm/io/OsmBaseStorage.java Normal file → Executable file
View file

@ -205,8 +205,10 @@ public class OsmBaseStorage {
if (ELEM_NODE.equals(name)) { if (ELEM_NODE.equals(name)) {
currentParsedEntity = new Node(parseDouble(parser, ATTR_LAT, 0), parseDouble(parser, ATTR_LON, 0), currentParsedEntity = new Node(parseDouble(parser, ATTR_LAT, 0), parseDouble(parser, ATTR_LON, 0),
parseId(parser, ATTR_ID, -1)); parseId(parser, ATTR_ID, -1));
currentParsedEntity.setVersion(parseVersion(parser));
} else if (ELEM_WAY.equals(name)) { } else if (ELEM_WAY.equals(name)) {
currentParsedEntity = new Way(parseId(parser, ATTR_ID, -1)); currentParsedEntity = new Way(parseId(parser, ATTR_ID, -1));
currentParsedEntity.setVersion(parseVersion(parser));
} else if (ELEM_RELATION.equals(name)) { } else if (ELEM_RELATION.equals(name)) {
currentParsedEntity = new Relation(parseId(parser, ATTR_ID, -1)); currentParsedEntity = new Relation(parseId(parser, ATTR_ID, -1));
} else { } else {
@ -256,6 +258,13 @@ public class OsmBaseStorage {
} }
} }
private int parseVersion(XmlPullParser parser) {
if (parser.getAttributeName(parser.getAttributeCount() - 1).equals(ATTR_VERSION)) {
return Integer.valueOf(parser.getAttributeValue(parser.getAttributeCount() - 1));
}
return -1;
}
public void endElement(XmlPullParser parser, String name) { public void endElement(XmlPullParser parser, String name) {
EntityType type = null; EntityType type = null;
if (ELEM_NODE.equals(name)){ if (ELEM_NODE.equals(name)){