Changeset 2971 in josm for trunk/src/org


Ignore:
Timestamp:
2010-02-12T23:23:11+01:00 (15 years ago)
Author:
jttt
Message:

Create all relations first in OsmReader to prevent (bogus) consistency errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r2953 r2971  
    469469     */
    470470    private void processRelationsAfterParsing() throws IllegalDataException {
     471
     472        // First add all relations to make sure that when relation reference other relation, the referenced will be already in dataset
     473        for (Long externalRelationId : relations.keySet()) {
     474            Relation relation = (Relation) externalIdMap.get(
     475                    new SimplePrimitiveId(externalRelationId, OsmPrimitiveType.RELATION)
     476            );
     477            ds.addPrimitive(relation);
     478        }
     479
    471480        for (Long externalRelationId : relations.keySet()) {
    472481            Relation relation = (Relation) externalIdMap.get(
     
    517526            }
    518527            relation.setMembers(relationMembers);
    519             ds.addPrimitive(relation);
    520528        }
    521529    }
Note: See TracChangeset for help on using the changeset viewer.