Class OverpassClient


  • public class OverpassClient
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String buildCompactQuery​(java.lang.String type, org.openstreetmap.atlas.geography.Rectangle bounds)  
      static java.lang.String buildCompoundQuery​(java.lang.String type, java.lang.String key, java.lang.String value, org.openstreetmap.atlas.geography.Rectangle bounds)  
      static java.lang.String buildQuery​(java.lang.String type, java.lang.String key, java.lang.String value, org.openstreetmap.atlas.geography.Rectangle bounds)  
      static java.lang.String buildQuery​(java.lang.String type, org.openstreetmap.atlas.geography.Rectangle bounds)  
      org.apache.http.client.methods.CloseableHttpResponse getResponse​(java.lang.String specificQuery)  
      boolean hasTooMuchResponseData()  
      boolean hasUnknownError()  
      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 query
      java.util.List<OverpassOsmNode> nodesFromQuery​(java.lang.String query)
      Makes a node Overpass query, parses the response xml, and returns the nodes that match the query
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OverpassClient

        public OverpassClient()
      • OverpassClient

        public OverpassClient​(java.lang.String server)
      • OverpassClient

        public OverpassClient​(java.lang.String server,
                              org.apache.http.HttpHost proxy)
    • 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.IOException
        Makes 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.
      • 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.