public class OverpassMapDataDao
extends java.lang.Object
| Constructor and Description |
|---|
OverpassMapDataDao(de.westnordost.osmapi.OsmConnection osm) |
OverpassMapDataDao(de.westnordost.osmapi.OsmConnection osm,
de.westnordost.osmapi.map.MapDataFactory mapDataFactory) |
| Modifier and Type | Method and Description |
|---|---|
OverpassStatus |
getStatus()
Get info about how many queries the user may make until reaching his quota
|
void |
killMyQueries()
Kills all the queries sent from this IP.
|
<T> T |
query(java.lang.String query,
de.westnordost.osmapi.ApiResponseReader<T> reader)
Executes the given query.
|
ElementCount |
queryCount(java.lang.String query)
Executes the given query to count the elements.
|
void |
queryElements(java.lang.String query,
de.westnordost.osmapi.map.handler.MapDataHandler handler)
Executes the given query and expects a response that is alike a map data query on the
OSM API, just returning the map data.
|
void |
queryElementsWithGeometry(java.lang.String query,
MapDataWithGeometryHandler handler)
Executes the given query that has the
geom modificator. |
void |
queryTable(java.lang.String query,
de.westnordost.osmapi.common.Handler<java.lang.String[]> handler) |
void |
queryTable(java.lang.String query,
de.westnordost.osmapi.common.Handler<java.lang.String[]> handler,
java.lang.String separator)
Executes the given query that has the output mode set to CSV.
|
public OverpassMapDataDao(@NotNull
de.westnordost.osmapi.OsmConnection osm,
@NotNull
de.westnordost.osmapi.map.MapDataFactory mapDataFactory)
public OverpassMapDataDao(@NotNull
de.westnordost.osmapi.OsmConnection osm)
public void queryElements(@NotNull
java.lang.String query,
@NotNull
de.westnordost.osmapi.map.handler.MapDataHandler handler)
out body;.query - Query string. Either Overpass QL or Overpass XML query string.handler - handler to feed the map data toOsmTooManyRequestsException - if the user is over his request quota. See getStatus, killMyQueriesde.westnordost.osmapi.common.errors.OsmBadUserInputException - if there is an error in the querypublic void queryElementsWithGeometry(@NotNull
java.lang.String query,
@NotNull
MapDataWithGeometryHandler handler)
geom modificator. For example a query with
out body geom;. See out statements.query - Query string. Either Overpass QL or Overpass XML query string. The query must
contain the geom modificator.handler - function to feed the map data and geometry toOsmTooManyRequestsException - if the user is over his request quota. See getStatus, killMyQueriesde.westnordost.osmapi.common.errors.OsmBadUserInputException - if there is an error in the querypublic void queryTable(@NotNull
java.lang.String query,
@NotNull
de.westnordost.osmapi.common.Handler<java.lang.String[]> handler,
@NotNull
java.lang.String separator)
query - Query string. Either Overpass QL or Overpass XML query string. The query must
use the output mode CSV.handler - function to feed the map data and geometry toseparator - The separator to expect in the CSV response. The default is the tab character.OsmTooManyRequestsException - if the user is over his request quota. See getStatus, killMyQueriesde.westnordost.osmapi.common.errors.OsmBadUserInputException - if there is an error in the querypublic void queryTable(@NotNull
java.lang.String query,
@NotNull
de.westnordost.osmapi.common.Handler<java.lang.String[]> handler)
queryTable(String, Handler)@NotNull public ElementCount queryCount(@NotNull java.lang.String query)
out count;. See out statements.query - Query string. Either Overpass QL or Overpass XML query string. The query must
end with out count;OsmTooManyRequestsException - if the user is over his request quota. See getStatus, killMyQueriesde.westnordost.osmapi.common.errors.OsmBadUserInputException - if there is an error in the querypublic <T> T query(@NotNull
java.lang.String query,
de.westnordost.osmapi.ApiResponseReader<T> reader)
T - what the type of object the reader returnsquery - Query string. Either Overpass QL or Overpass XML query stringreader - the object reading the responseOsmTooManyRequestsException - if the user is over his request quota. See getStatus, killMyQueriesde.westnordost.osmapi.common.errors.OsmBadUserInputException - if there is an error in the querypublic void killMyQueries()
public OverpassStatus getStatus()