Class OsmSearcher

java.lang.Object
org.ka2ddo.yaac.osm.OsmSearcher

public class OsmSearcher extends Object
This class provides a standardized mechanism to search the imported OSM tiles for a landmark matching the specified name string.
Author:
Andrew Pavlin, KA2DDO
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    maximum number of matches that searcher is allowed to return.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OsmSearcher(File baseDir)
    Create an OsmSearcher using the specified base directory for the collection of OSM tile files.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    search(String matchString, int flagsToFind, double lat, double lon, double radius, OsmSearcherProgressListener listener)
    Search the OpenStreetMap tile files for the specified landmark name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_MATCH_LIST_SIZE

      public static final int MAX_MATCH_LIST_SIZE
      maximum number of matches that searcher is allowed to return. Closer entries will still be kept, while further-out ones will be discarded.
      See Also:
  • Constructor Details

    • OsmSearcher

      public OsmSearcher(File baseDir)
      Create an OsmSearcher using the specified base directory for the collection of OSM tile files.
      Parameters:
      baseDir - File specifying where the YAAC-imported OSM tile files are located
  • Method Details

    • search

      public void search(String matchString, int flagsToFind, double lat, double lon, double radius, OsmSearcherProgressListener listener)
      Search the OpenStreetMap tile files for the specified landmark name.
      Parameters:
      matchString - case-insensitive String to search for, or null if not searching by partial string match
      flagsToFind - int bit mask of GenericTaggedNode.flags set bits to look for (zero if not searching by flags)
      lat - search center latitude in fractional degrees North
      lon - search center longitude in fractional degrees East
      radius - maximum radius in meters for the search
      listener - OsmSearcherProgressListener to be informed of finds and tile changes during the search, or null if not interested in progress reports