Class NameFinder


  • public final class NameFinder
    extends java.lang.Object
    Search for names and related items.
    Since:
    11002
    • Method Detail

      • buildNominatimURL

        public static java.net.URL buildNominatimURL​(java.lang.String searchExpression)
        Builds the Nominatim URL for performing the given search
        Parameters:
        searchExpression - the Nominatim query
        Returns:
        the Nominatim URL
      • buildNominatimURL

        public static java.net.URL buildNominatimURL​(java.lang.String searchExpression,
                                                     java.util.Collection<NameFinder.SearchResult> excludeResults)
        Builds the Nominatim URL for performing the given search and excluding the results (of a previous search)
        Parameters:
        searchExpression - the Nominatim query
        excludeResults - the results to exclude
        Returns:
        the Nominatim URL
        See Also:
        Result limitation in Nominatim Documentation
      • queryNominatim

        public static java.util.List<NameFinder.SearchResultqueryNominatim​(java.lang.String searchExpression)
                                                                      throws java.io.IOException
        Performs a Nominatim search.
        Parameters:
        searchExpression - Nominatim search expression
        Returns:
        search results
        Throws:
        java.io.IOException - if any IO error occurs.
      • query

        public static java.util.List<NameFinder.SearchResultquery​(java.net.URL url)
                                                             throws java.io.IOException
        Performs a custom search.
        Parameters:
        url - search URL to any Nominatim instance
        Returns:
        search results
        Throws:
        java.io.IOException - if any IO error occurs.
      • parseSearchResults

        public static java.util.List<NameFinder.SearchResultparseSearchResults​(java.io.Reader reader)
                                                                          throws java.io.IOException,
                                                                                 javax.xml.parsers.ParserConfigurationException,
                                                                                 org.xml.sax.SAXException
        Parse search results as returned by Nominatim.
        Parameters:
        reader - reader
        Returns:
        search results
        Throws:
        javax.xml.parsers.ParserConfigurationException - if a parser cannot be created which satisfies the requested configuration.
        org.xml.sax.SAXException - for SAX errors.
        java.io.IOException - if any IO error occurs.