Changeset 11560 in josm


Ignore:
Timestamp:
2017-02-14T00:32:15+01:00 (6 months ago)
Author:
Don-vip
Message:

fix #14364 - Overpass wizard geocoding doesn't interpret Nominatim responses correctly

File:
1 edited

Legend:

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

    r11533 r11560  
    77import java.io.InputStream;
    88import java.util.EnumMap;
    9 import java.util.List;
    109import java.util.NoSuchElementException;
    1110import java.util.concurrent.TimeUnit;
     
    114113        idOffset.put(OsmPrimitiveType.RELATION, 3_600_000_000L);
    115114        try {
    116             final List<NameFinder.SearchResult> results = NameFinder.queryNominatim(area);
    117             final PrimitiveId osmId = results.get(0).getOsmId();
     115            final PrimitiveId osmId = NameFinder.queryNominatim(area).stream().filter(
     116                    x -> !OsmPrimitiveType.NODE.equals(x.getOsmId().getType())).iterator().next().getOsmId();
    118117            return String.format("area(%d)", osmId.getUniqueId() + idOffset.get(osmId.getType()));
    119118        } catch (IOException | NoSuchElementException | IndexOutOfBoundsException ex) {
Note: See TracChangeset for help on using the changeset viewer.