Ignore:
Timestamp:
2009-09-27T18:01:21+02:00 (17 years ago)
Author:
Gubaer
Message:

fixed #3553: Error on join overlapped areas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java

    r2181 r2202  
    2525import org.openstreetmap.josm.data.osm.Tag;
    2626import org.openstreetmap.josm.data.osm.TagCollection;
     27import org.openstreetmap.josm.data.osm.TigerUtils;
    2728import org.openstreetmap.josm.data.osm.Way;
    2829import org.openstreetmap.josm.data.osm.BackreferencedDataSet.RelationToChildReference;
     
    9394
    9495    /**
     96     * Combines tags from TIGER data
     97     *
     98     * @param tc the tag collection
     99     */
     100    protected static void combineTigerTags(TagCollection tc) {
     101        for (String key: tc.getKeys()) {
     102            if (TigerUtils.isTigerTag(key)) {
     103                tc.setUniqueForKey(key, TigerUtils.combineTags(key, tc.getValues(key)));
     104            }
     105        }
     106    }
     107
     108    /**
    95109     * Selects a node out of a collection of candidate nodes. The selected
    96110     * node will become the target node the remaining nodes are merged to.
     
    153167     * Fixes the parent ways referring to one of the nodes.
    154168     *
    155      * Replies null, if the ways could not be fixed, i.e. because a way would have to be delted
     169     * Replies null, if the ways could not be fixed, i.e. because a way would have to be deleted
    156170     * which is referred to by a relation.
    157171     *
     
    159173     * @param nodesToDelete the collection of nodes to be deleted
    160174     * @param targetNode the target node the other nodes are merged to
    161      * @return a list of command; null, the ways could not be fixed
     175     * @return a list of commands; null, if the ways could not be fixed
    162176     */
    163177    protected static List<Command> fixParentWays(BackreferencedDataSet backreferences, Collection<OsmPrimitive> nodesToDelete, Node targetNode) {
     
    207221    /**
    208222     * Merges the nodes in <code>node</code> onto one of the nodes. Uses the dataset
    209      * managed by <code>layer</code> as reference. <code>backreferences</code> is precomputed
     223     * managed by <code>layer</code> as reference. <code>backreferences</code> is a precomputed
    210224     * collection of all parent/child references in the dataset.
    211225     *
    212226     * @param layer layer the reference data layer. Must not be null.
    213      * @param backreferences if null, backreferneces are first computed from layer.data; otherwise
    214      *    backreferences.getSource() == layer.data must hold
     227     * @param backreferences if null, backreferences are first computed from layer.data; otherwise
     228     *    backreferences.getSource() == layer.data must be true
    215229     * @param nodes the collection of nodes. Ignored if null.
    216230     * @param targetNode the target node the collection of nodes is merged to. Must not be null.
     
    235249        //
    236250        TagCollection nodeTags = TagCollection.unionOfAllPrimitives(nodes);
     251        combineTigerTags(nodeTags);
    237252        completeTagCollectionWithMissingTags(nodeTags, nodes);
    238253        TagCollection nodeTagsToEdit = new TagCollection(nodeTags);
     
    258273        nodesToDelete.remove(targetNode);
    259274
    260         // change the ways referring to at least one of the merge nodes
     275        // fix the ways referring to at least one of the merged nodes
    261276        //
    262277        Collection<Way> waysToDelete= new HashSet<Way>();
     
    287302
    288303    /**
    289      * Enable the "Merge Nodes" menu option if more then one node is selected
     304     * Enable the "Merge Nodes" menu option if more than one node is selected
    290305     */
    291306    @Override
Note: See TracChangeset for help on using the changeset viewer.