Interface PoiPersistenceManager

All Known Implementing Classes:
AbstractPoiPersistenceManager

public interface PoiPersistenceManager
Abstracts from an underlying Storage/DB by providing methods for inserting / deleting / searching PointOfInterest objects in named Storage/DB.

Remember to call the close() method as soon as you are done manipulating the Storage/DB via this PoiPersistenceManager.

  • Method Details

    • close

      void close()
      Use this to free claimed resources. After that you might no longer be able to query for points of interest. This should always be called a soon as you are done querying.
    • findInRect

      Collection<PointOfInterest> findInRect(org.mapsforge.core.model.BoundingBox bb, PoiCategoryFilter filter, List<org.mapsforge.core.model.Tag> patterns, org.mapsforge.core.model.LatLong orderBy, int limit, boolean findCategories)
      Find all PointOfInterest in a rectangle specified by the given BoundingBox. Only the POIs that are allowed by the PoiCategoryFilter object and matching the data pattern will be returned.
      Parameters:
      bb - BoundingBox specifying the rectangle.
      filter - POI category filter object that helps determining whether a POI should be added to the set or not (may be null).
      patterns - the patterns to search in points of interest data (may be null).
      orderBy - LatLong location of the sort.
      limit - max number of PointOfInterest to be returned.
      findCategories - find POI categories.
      Returns:
      Collection of PointOfInterest matching a given PoiCategoryFilter and data pattern contained in the rectangle specified by the given BoundingBox.
    • findNearPosition

      Collection<PointOfInterest> findNearPosition(org.mapsforge.core.model.LatLong point, int distance, PoiCategoryFilter filter, List<org.mapsforge.core.model.Tag> patterns, org.mapsforge.core.model.LatLong orderBy, int limit, boolean findCategories)
      Fetch PointOfInterest from underlying storage near a given position. Only the POIs that are allowed by the PoiCategoryFilter object and matching the data pattern will be returned.
      Parameters:
      point - LatLong center of the search.
      distance - in meters
      filter - POI category filter object that helps determining whether a POI should be added to the set or not (may be null).
      patterns - the patterns to search in points of interest data (may be null).
      orderBy - LatLong location of the sort.
      limit - max number of PointOfInterest to be returned.
      findCategories - find POI categories.
      Returns:
      Collection of PointOfInterest matching a given PoiCategoryFilter and data pattern near the given position.
    • findPointByID

      PointOfInterest findPointByID(long poiID)
      Parameters:
      poiID - the id of the point of interest that shall be returned.
      Returns:
      a single PointOfInterest p where p.id == poiID.
    • getCategoryManager

      PoiCategoryManager getCategoryManager()
      Returns:
      The persistence manager's category manager for retrieving and editing POI categories.
    • getPoiFile

      String getPoiFile()
      Returns:
      the current POI file.
    • getPoiFileInfo

      PoiFileInfo getPoiFileInfo()
      Returns:
      the metadata for the current POI file.
    • insertPointOfInterest

      void insertPointOfInterest(PointOfInterest poi)
      Inserts a single PointOfInterest into storage.
      Parameters:
      poi - PointOfInterest to insert into storage.
    • insertPointsOfInterest

      void insertPointsOfInterest(Collection<PointOfInterest> pois)
      Inserts PointOfInterest into storage.
      Parameters:
      pois - collection of PointOfInterest to insert into storage.
    • isClosed

      boolean isClosed()
      Returns:
      true if the manager is closed.
    • isValidDataBase

      boolean isValidDataBase()
      Returns:
      true if the database is a valid POI database.
    • readPoiFileInfo

      void readPoiFileInfo()
      Reads the metadata for the current POI file.
    • removePointOfInterest

      void removePointOfInterest(PointOfInterest poi)
      Removes a point of interest from storage.
      Parameters:
      poi - the PointOfInterest to be removed.
    • setCategoryManager

      void setCategoryManager(PoiCategoryManager categoryManager)
      Sets this manager's PoiCategoryManager for retrieving and editing POI categories.
      Parameters:
      categoryManager - The category manager to be set.