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 Detail

      • 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

        java.util.Collection<PointOfInterest> findInRect​(org.mapsforge.core.model.BoundingBox bb,
                                                         PoiCategoryFilter filter,
                                                         java.util.List<org.mapsforge.core.model.Tag> patterns,
                                                         int limit)
        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).
        limit - max number of PointOfInterest to be returned.
        Returns:
        Collection of PointOfInterest matching a given PoiCategoryFilter and data pattern contained in the rectangle specified by the given BoundingBox.
      • findNearPosition

        java.util.Collection<PointOfInterest> findNearPosition​(org.mapsforge.core.model.LatLong point,
                                                               int distance,
                                                               PoiCategoryFilter filter,
                                                               java.util.List<org.mapsforge.core.model.Tag> patterns,
                                                               int limit)
        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).
        limit - max number of PointOfInterest to be returned.
        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

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

        PoiFileInfo getPoiFileInfo()
        Returns:
        the metadata for the current POI file.
      • 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.