Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ce4d377941
1 changed files with 9 additions and 0 deletions
9
OsmAnd-java/src/net/osmand/osm/io/OsmBaseStorage.java
Normal file → Executable file
9
OsmAnd-java/src/net/osmand/osm/io/OsmBaseStorage.java
Normal file → Executable file
|
@ -205,8 +205,10 @@ public class OsmBaseStorage {
|
|||
if (ELEM_NODE.equals(name)) {
|
||||
currentParsedEntity = new Node(parseDouble(parser, ATTR_LAT, 0), parseDouble(parser, ATTR_LON, 0),
|
||||
parseId(parser, ATTR_ID, -1));
|
||||
currentParsedEntity.setVersion(parseVersion(parser));
|
||||
} else if (ELEM_WAY.equals(name)) {
|
||||
currentParsedEntity = new Way(parseId(parser, ATTR_ID, -1));
|
||||
currentParsedEntity.setVersion(parseVersion(parser));
|
||||
} else if (ELEM_RELATION.equals(name)) {
|
||||
currentParsedEntity = new Relation(parseId(parser, ATTR_ID, -1));
|
||||
} 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) {
|
||||
EntityType type = null;
|
||||
if (ELEM_NODE.equals(name)){
|
||||
|
|
Loading…
Reference in a new issue