001package de.deepamehta.geomaps;
002
003import de.deepamehta.geomaps.model.GeoCoordinate;
004import de.deepamehta.geomaps.model.Geomap;
005import de.deepamehta.core.Topic;
006
007
008
009public interface GeomapsService {
010
011    Geomap getGeomap(long geomapId);
012
013    /**
014     * Finds the domain topic that corresponds to a Geo Coordinate topic.
015     */
016    Topic getDomainTopic(long geoCoordId);
017
018    /**
019     * Returns the geo coordinate of a geo-facetted topic (e.g. an Address),
020     * or <code>null</code> if no geo coordinate is stored.
021     *
022     * @return  the geo coordinate, or <code>null</code>.
023     */
024    GeoCoordinate getGeoCoordinate(Topic geoTopic);
025
026    /**
027     * Returns the geo coordinate encoded in a Geo Coordinate topic.
028     */
029    GeoCoordinate geoCoordinate(Topic geoCoordTopic);
030
031    /**
032     * Adds a Geo Coordinate topic to a geomap.
033     */
034    void addCoordinateToGeomap(long geomapId, long geoCoordId);
035
036    void setGeomapState(long geomapId, double lon, double lat, int zoom);
037
038    /**
039     * Calculates the distance between 2 geo coordinates in kilometer.
040     */
041    double getDistance(GeoCoordinate coord1, GeoCoordinate coord2);
042}