001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2005-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.coverage;
033    
034    import java.util.Set;
035    import java.util.Collection;
036    import org.opengis.util.Record;
037    import org.opengis.geometry.DirectPosition;
038    import org.opengis.geometry.coordinate.Tin;
039    import org.opengis.annotation.UML;
040    
041    import static org.opengis.annotation.Obligation.*;
042    import static org.opengis.annotation.Specification.*;
043    
044    
045    /**
046     * A {@linkplain ContinuousCoverage continuous coverage} characterized by a {@linkplain Tin TIN}.
047     * The feature attribute values are computed by interpolation within each triangle in the
048     * tessellation using the record of feature attribute values provided at each corner; that
049     * is, the feature attribute values are produced by an operation on {@link ValueTriangle}s.
050     * <p>
051     * The basic idea of a TIN is to partition the convex hull of the points in the domain of a
052     * discrete point coverage into a computationally unique set of non-overlapping triangles.
053     * Each triangle is formed by three of the points in the domain of the discrete point coverage.
054     * The Delaunay triangulation method is commonly used to produce TIN tessellations with triangles
055     * that are optimally equiangular in shape, and are generated in such a manner that the
056     * circumscribing circle containing each triangle contains no point of the discrete point
057     * coverage other than those at the vertices of the triangle. {@link Tin} describes a Delaunay
058     * triangulation.
059     *
060     * @version ISO 19123:2004
061     * @author  Alessio Fabiani
062     * @author  Martin Desruisseaux (IRD)
063     * @since   GeoAPI 2.1
064     *
065     * @todo Add a figure derived from figure 22 in ISO 19123.
066     */
067    @UML(identifier="CV_TINCoverage", specification=ISO_19123)
068    public interface TinCoverage extends ContinuousCoverage {
069        /**
070         * Returns the triangulated irregular network that provides the structure for evaluating the
071         * coverage. {@link Tin} includes a capability for using stop lines and break lines in the
072         * triangulation.
073         *
074         * @return The network that provides the structure for evaluating the coverage.
075         */
076        @UML(identifier="geometry", obligation=MANDATORY, specification=ISO_19123)
077        Tin getGeometry();
078    
079        /**
080         * Returns the interpolation method to be used in evaluating the coverage. The most common
081         * interpolation method is "{@linkplain InterpolationMethod#BARYCENTRIC barycentric}"
082         */
083        @UML(identifier="interpolationType", obligation=OPTIONAL, specification=ISO_19123)
084        InterpolationMethod getInterpolationMethod();
085    
086        /**
087         * Returns the set of value objects used to evaluate the coverage. This
088         * association is optional - an analytical coverage needs no value objects.
089         */
090        @UML(identifier="element", obligation=OPTIONAL, specification=ISO_19123)
091        Set<ValueTriangle> getElements();
092    
093        /**
094         * Returns the set of {@linkplain ValueTriangle value triangles} that contains the specified
095         * direct position.
096         */
097        @UML(identifier="locate", obligation=OPTIONAL, specification=ISO_19123)
098        Set<ValueTriangle> locate(DirectPosition p);
099    
100        /**
101         * Returns a set of records of feature attribute values for the specified direct position.
102         * Evaluation of a TIN coverage involves two steps. The first is to find the {@linkplain
103         * ValueTriangle value triangle} that contains the input direct position; the second is to
104         * interpolate the feature attribute values at the direct position from the {@linkplain
105         * PointValuePair point-value pairs} at the vertices of the value triangle.
106         *
107         * @throws PointOutsideCoverageException if the point is outside the coverage domain.
108         * @throws CannotEvaluateException If the point can't be evaluated for some other reason.
109         */
110        @UML(identifier="evaluate", obligation=MANDATORY, specification=ISO_19123)
111        Set<Record> evaluate(DirectPosition p, Collection<String> list) throws CannotEvaluateException;
112    }