001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2004-2013 Open Geospatial Consortium, Inc.
006     *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007     *
008     *    Permission to use, copy, and modify this software and its documentation, with
009     *    or without modification, for any purpose and without fee or royalty is hereby
010     *    granted, provided that you include the following on ALL copies of the software
011     *    and documentation or portions thereof, including modifications, that you make:
012     *
013     *    1. The full text of this NOTICE in a location viewable to users of the
014     *       redistributed or derivative work.
015     *    2. Notice of any changes or modifications to the OGC files, including the
016     *       date changes were made.
017     *
018     *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019     *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020     *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021     *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022     *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023     *
024     *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025     *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026     *
027     *    The name and trademarks of copyright holders may NOT be used in advertising or
028     *    publicity pertaining to the software without specific, written prior permission.
029     *    Title to copyright in this software and any associated documentation will at all
030     *    times remain with copyright holders.
031     */
032    package org.opengis.referencing.operation;
033    
034    import java.util.Set;
035    import org.opengis.metadata.Identifier;
036    import org.opengis.referencing.AuthorityFactory;
037    import org.opengis.referencing.NoSuchAuthorityCodeException;
038    import org.opengis.referencing.crs.CoordinateReferenceSystem;
039    import org.opengis.util.FactoryException;
040    import org.opengis.annotation.UML;
041    
042    import static org.opengis.annotation.Specification.*;
043    
044    
045    /**
046     * Creates coordinate transformation objects from codes. The codes are maintained by an
047     * external authority. A commonly used authority is <a href="http://www.epsg.org">EPSG</a>,
048     * which is also used in the GeoTIFF standard.
049     *
050     * @author  Martin Desruisseaux (IRD)
051     * @version 3.0
052     * @since   1.0
053     */
054    @UML(identifier="CT_CoordinateTransformationAuthorityFactory", specification=OGC_01009)
055    public interface CoordinateOperationAuthorityFactory extends AuthorityFactory {
056        /**
057         * Creates an operation method from a single code. The "{@linkplain Identifier#getAuthority
058         * authority}" and "{@linkplain Identifier#getCode code}" values of the created object will be
059         * set to the authority of this object, and the code specified by the client, respectively. The
060         * other metadata values may or may not be set.
061         *
062         * @param  code Coded value for operation method.
063         * @return The operation method for the given code.
064         * @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
065         * @throws FactoryException if the object creation failed for some other reason.
066         *
067         * @see CoordinateOperationFactory#getOperationMethod(String)
068         *
069         * @departure extension
070         *   This method has been added because OGC 01-009 does not define a factory
071         *   method for creating such object.
072         *
073         * @since 2.3
074         */
075        OperationMethod createOperationMethod(String code)
076                throws NoSuchAuthorityCodeException, FactoryException;
077    
078        /**
079         * Creates an operation from a single operation code. The "{@linkplain Identifier#getAuthority
080         * authority}" and "{@linkplain Identifier#getCode code}" values of the created object will be
081         * set to the authority of this object, and the code specified by the client, respectively. The
082         * other metadata values may or may not be set.
083         *
084         * @param  code Coded value for coordinate operation.
085         * @return The operation for the given code.
086         * @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
087         * @throws FactoryException if the object creation failed for some other reason.
088         */
089        @UML(identifier="createFromTransformationCode", specification=OGC_01009)
090        CoordinateOperation createCoordinateOperation(String code)
091                throws NoSuchAuthorityCodeException, FactoryException;
092    
093        /**
094         * Creates operations from {@linkplain CoordinateReferenceSystem coordinate reference system}
095         * codes. This method returns only the operations declared by the authority, with preferred
096         * operations first. This method doesn't need to compute operations from {@code source} to
097         * {@code target} CRS if no such operations were explicitly defined in the authority database.
098         * Computation of arbitrary operations can be performed by
099         * <code>{@linkplain CoordinateOperationFactory#createOperation(CoordinateReferenceSystem,
100         * CoordinateReferenceSystem) CoordinateOperationFactory.createOperation}(sourceCRS, targetCRS)</code>
101         * instead.
102         *
103         * @param  sourceCRS   Coded value of source coordinate reference system.
104         * @param  targetCRS   Coded value of target coordinate reference system.
105         * @return The operations from {@code sourceCRS} to {@code targetCRS}.
106         * @throws NoSuchAuthorityCodeException if a specified code was not found.
107         * @throws FactoryException if the object creation failed for some other reason.
108         */
109        @UML(identifier="createFromCoordinateSystemCodes", specification=OGC_01009)
110        Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS)
111                throws NoSuchAuthorityCodeException, FactoryException;
112    }