Changeset 23278 in osm


Ignore:
Timestamp:
2010-09-19T22:18:49+02:00 (14 years ago)
Author:
upliner
Message:

'fix bug with handling for incomplete relation members'

Location:
applications/editors/josm/plugins/reverter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/build.xml

    r23273 r23278  
    3131
    3232        <!-- enter the SVN commit message -->
    33         <property name="commit.message" value="fix #j5160, update MultiOsmReader, some refactoring, some small bugfixes" />
     33        <property name="commit.message" value="fix bug with handling for incomplete relation members" />
    3434        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    3535        <property name="plugin.main.version" value="3403" />
  • applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java

    r23273 r23278  
    180180            nds = rdr.parseOsm(progressMonitor.createSubTaskMonitor(1, true));
    181181            for (OsmPrimitive p : nds.allPrimitives()) {
    182                 if (!p.isIncomplete()) addMissingIds(Collections.singleton(p));
     182                if (!p.isIncomplete()) {
     183                    addMissingIds(Collections.singleton(p));
     184                } else {
     185                    if (ds.getPrimitiveById(p.getPrimitiveId()) == null) {
     186                        switch (p.getType()) {
     187                        case NODE: ds.addPrimitive(new Node(p.getUniqueId())); break;
     188                        case WAY: ds.addPrimitive(new Way(p.getUniqueId())); break;
     189                        case RELATION: ds.addPrimitive(new Relation(p.getUniqueId())); break;
     190                        }
     191                    }
     192                }
    183193            }
    184194        } finally {
Note: See TracChangeset for help on using the changeset viewer.