Skip to content
Andreas W. Bartels edited this page Aug 16, 2017 · 13 revisions

OSM

maven

<dependency>
  <groupId>net.anwiba.spatial</groupId>
  <artifactId>anwiba-spatial-data-osm</artifactId>
  <version>1.0.52</version>
</dependency>

Overpass

see Overpass Json API see JSSD

usage

Nominatim

see description see JSSD

usage

    String urlString = "http://nominatim.openstreetmap.org/search/where am i?format=jsonv2&addressdetails=1&limit=20&polygon_geojson=1";

    NominatimJsonObjectsUnmarshaller<Place> unmarshaller = new NominatimJsonObjectsUnmarshallerFactory()
        .create(Place.class);

    IHttpRequestExecutor httpRequestExecutor = new HttpRequestExcecutorFactory(
        new HttpClientConnectionManagerProvider()).create();
    ConvertingHttpRequestExecutor requestExecutor = new ConvertingHttpRequestExecutor(httpRequestExecutor);
    List<Place> places = requestExecutor.execute(
        canceler,
        () -> RequestBuilder.get(urlString).build(),
        (IResultProducer<List<Place>>) (
            inputStream,
            statusCode,
            statusMessage,
            contentType,
            contentEncoding) -> unmarshaller.unmarshal(inputStream));

Clone this wiki locally