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