Changeset 13335 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2018-01-19T20:15:02+01:00 (23 months ago)
Author:
Don-vip
Message:

fix #15800 - autofix common issues in overpass queries, like overpass turbo

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassDownloadSource.java

    r13130 r13335  
    192192            };
    193193
    194             return new OverpassDownloadData(query, errorReporter);
     194            return new OverpassDownloadData(OverpassDownloadReader.fixQuery(query), errorReporter);
    195195        }
    196196
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r12841 r13335  
    394394        return ds;
    395395    }
     396
     397    /**
     398     * Fixes Overpass API query to make sure it will be accepted by JOSM.
     399     * @param query Overpass query to check
     400     * @return fixed query
     401     * @since 13335
     402     */
     403    public static String fixQuery(String query) {
     404        return query.replaceFirst("out( body| skel| ids)?( id| qt)?;", "out meta$2;");
     405    }
    396406}
Note: See TracChangeset for help on using the changeset viewer.