Ignore:
Timestamp:
2016-01-05T23:48:02+01:00 (4 years ago)
Author:
simon04
Message:

see #7670 fix #7647 - Fetching objects via Overpass API recurses down

Thus, there is no need for separately querying way nodes, or relation members.

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

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

    r9242 r9325  
    3131        return OverpassServerPreference.getOverpassServer();
    3232    }
     33
     34    @Override
     35    protected boolean recursesDown() {
     36        // see https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Recurse_down_.28.3E.29 for documentation
     37        // accomplished using >; in the query string above
     38        return true;
     39    }
    3340}
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r9324 r9325  
    171171        if (way == null) return this;
    172172        if (way.isNew()) return this;
    173         for (Node node: way.getNodes()) {
     173        for (Node node: !recursesDown() ? way.getNodes() : Collections.<Node>emptyList()) {
    174174            if (!node.isNew()) {
    175175                remember(node.getPrimitiveId());
     
    190190        if (relation.isNew()) return this;
    191191        remember(relation.getPrimitiveId());
    192         for (RelationMember member : relation.getMembers()) {
     192        for (RelationMember member : !recursesDown() ? relation.getMembers() : Collections.<RelationMember>emptyList()) {
    193193            if (OsmPrimitiveType.from(member.getMember()).equals(OsmPrimitiveType.RELATION)) {
    194194                // avoid infinite recursion in case of cyclic dependencies in relations
     
    403403    public Set<PrimitiveId> getMissingPrimitives() {
    404404        return missingPrimitives;
     405    }
     406
     407    /**
     408     * Whether this reader fetches nodes when loading ways, or members when loading relations.
     409     *
     410     * @return {@code true} if the reader recurses down
     411     */
     412    protected boolean recursesDown() {
     413        return false;
    405414    }
    406415
Note: See TracChangeset for help on using the changeset viewer.