Class OverpassClient
- java.lang.Object
-
- org.openstreetmap.atlas.generator.sharding.OverpassClient
-
public class OverpassClient extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description OverpassClient()OverpassClient(java.lang.String server)OverpassClient(java.lang.String server, org.apache.http.HttpHost proxy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbuildCompactQuery(java.lang.String type, org.openstreetmap.atlas.geography.Rectangle bounds)static java.lang.StringbuildCompoundQuery(java.lang.String type, java.lang.String key, java.lang.String value, org.openstreetmap.atlas.geography.Rectangle bounds)static java.lang.StringbuildQuery(java.lang.String type, java.lang.String key, java.lang.String value, org.openstreetmap.atlas.geography.Rectangle bounds)static java.lang.StringbuildQuery(java.lang.String type, org.openstreetmap.atlas.geography.Rectangle bounds)org.apache.http.client.methods.CloseableHttpResponsegetResponse(java.lang.String specificQuery)booleanhasTooMuchResponseData()booleanhasUnknownError()java.util.List<java.lang.String>nodeIdsFromWayQuery(java.lang.String query)Makes a way Overpass query, parses the response xml, and returns the identifiers of nodes that make up the ways that match the queryjava.util.List<OverpassOsmNode>nodesFromQuery(java.lang.String query)Makes a node Overpass query, parses the response xml, and returns the nodes that match the queryvoidresetTooMuchDataError()java.util.List<OverpassOsmWay>waysFromQuery(java.lang.String query)Makes a way Overpass query, parses the response xml, and returns the ways that match the query
-
-
-
Method Detail
-
buildCompactQuery
public static java.lang.String buildCompactQuery(java.lang.String type, org.openstreetmap.atlas.geography.Rectangle bounds)
-
buildCompoundQuery
public static java.lang.String buildCompoundQuery(java.lang.String type, java.lang.String key, java.lang.String value, org.openstreetmap.atlas.geography.Rectangle bounds)
-
buildQuery
public static java.lang.String buildQuery(java.lang.String type, org.openstreetmap.atlas.geography.Rectangle bounds)
-
buildQuery
public static java.lang.String buildQuery(java.lang.String type, java.lang.String key, java.lang.String value, org.openstreetmap.atlas.geography.Rectangle bounds)
-
getResponse
public org.apache.http.client.methods.CloseableHttpResponse getResponse(java.lang.String specificQuery) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
hasTooMuchResponseData
public boolean hasTooMuchResponseData()
-
hasUnknownError
public boolean hasUnknownError()
-
nodeIdsFromWayQuery
public java.util.List<java.lang.String> nodeIdsFromWayQuery(java.lang.String query) throws javax.xml.parsers.ParserConfigurationException, java.lang.UnsupportedOperationException, org.xml.sax.SAXException, java.io.IOExceptionMakes a way Overpass query, parses the response xml, and returns the identifiers of nodes that make up the ways that match the query- Parameters:
query- The Overpass query.- Returns:
- The identifiers of the nodes that make up all ways matching the query.
- Throws:
javax.xml.parsers.ParserConfigurationException- If a DocumentBuilder cannot be created which satisfies the configuration requested.java.lang.UnsupportedOperationException- If any IO errors occur.org.xml.sax.SAXException- If any parse errors occur.java.io.IOException- If is is null.
-
nodesFromQuery
public java.util.List<OverpassOsmNode> nodesFromQuery(java.lang.String query) throws java.lang.UnsupportedOperationException, org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
Makes a node Overpass query, parses the response xml, and returns the nodes that match the query- Parameters:
query- The node Overpass query.- Returns:
- The nodes that match the query.
- Throws:
java.lang.UnsupportedOperationException- If any IO errors occur.org.xml.sax.SAXException- If any parse errors occur.java.io.IOException- If is is null.javax.xml.parsers.ParserConfigurationException- If a DocumentBuilder cannot be created which satisfies the configuration requested.
-
resetTooMuchDataError
public void resetTooMuchDataError()
-
waysFromQuery
public java.util.List<OverpassOsmWay> waysFromQuery(java.lang.String query) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, java.lang.UnsupportedOperationException, org.xml.sax.SAXException
Makes a way Overpass query, parses the response xml, and returns the ways that match the query- Parameters:
query- The way Overpass query.- Returns:
- The nodes that match the query
- Throws:
javax.xml.parsers.ParserConfigurationException- If a DocumentBuilder cannot be created which satisfies the configuration requested.java.io.IOException- If it is null.java.lang.UnsupportedOperationException- Of any IO errors occur.org.xml.sax.SAXException- If any parse errors occur.
-
-