-
Notifications
You must be signed in to change notification settings - Fork 1
OSM
Andreas W. Bartels edited this page Aug 16, 2017
·
13 revisions
<dependency>
<groupId>net.anwiba.spatial</groupId>
<artifactId>anwiba-spatial-data-osm</artifactId>
<version>1.0.52</version>
</dependency>
see Overpass Json API see JSSD
see description
see JSSD
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));