001package fr.ifremer.adagio.core.service.referential.location;
002
003/*
004 * #%L
005 * SIH-Adagio :: Core
006 * $Id: LocationService.java 12089 2014-05-20 19:37:05Z bl05b3e $
007 * $HeadURL: https://forge.ifremer.fr/svn/sih-adagio/tags/adagio-3.5.6/core/src/main/java/fr/ifremer/adagio/core/service/referential/location/LocationService.java $
008 * %%
009 * Copyright (C) 2012 - 2013 Ifremer
010 * %%
011 * This program is free software: you can redistribute it and/or modify
012 * it under the terms of the GNU Affero General Public License as published by
013 * the Free Software Foundation, either version 3 of the License, or
014 * (at your option) any later version.
015 * 
016 * This program is distributed in the hope that it will be useful,
017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
019 * GNU General Public License for more details.
020 * 
021 * You should have received a copy of the GNU Affero General Public License
022 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
023 * #L%
024 */
025
026import org.springframework.transaction.annotation.Transactional;
027
028/**
029 * Service used to access locations
030 * 
031 * @author Benoit Lavenier
032 * 
033 */
034@Transactional(readOnly = true)
035public interface LocationService {
036
037    /**
038     * Return location label from a longitude and a latitude (in decimal degrees - WG84).
039     * 
040     * @param latitude
041     *            a latitude (in decimal degrees - WG84)
042     * @param longitude
043     *            a longitude (in decimal degrees - WG84)
044     * @return A location label (corresponding to a statistical rectangle), or null if no statistical rectangle exists
045     *         for this position
046     */
047    String getLocationLabelByLatLong(Float latitude, Float longitude);
048
049    /**
050     * Return a location Id, from a longitude and a latitude (in decimal degrees - WG84).
051     * This method typically use getLocationLabelByLatLong().
052     * 
053     * @param latitude
054     *            a latitude (in decimal degrees - WG84)
055     * @param longitude
056     *            a longitude (in decimal degrees - WG84)
057     * @return A location Id (corresponding to a statistical rectangle), or null if no statistical rectangle exists for
058     *         this position
059     */
060    Integer getLocationIdByLatLong(Float latitude, Float longitude);
061}