001 /*
002 * GeoAPI - Java interfaces for OGC/ISO standards
003 * http://www.geoapi.org
004 *
005 * Copyright (C) 2005-2012 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 org.opengis.geometry.DirectPosition;
036 import org.opengis.geometry.primitive.Curve;
037 import org.opengis.annotation.UML;
038
039 import static org.opengis.annotation.Obligation.*;
040 import static org.opengis.annotation.Specification.*;
041
042
043 /**
044 * Basis for interpolating within a {@linkplain SegmentedCurveCoverage segmented curve coverage}.
045 * A value curve is composed of a {@linkplain Curve curve} with additional information that supports
046 * the determination of feature attribute values at any position on that curve. Value curves depend
047 * upon the arc-length parameterization operations defined for {@link Curve}.
048 *
049 * @version ISO 19123:2004
050 * @author Alessio Fabiani
051 * @author Martin Desruisseaux (IRD)
052 * @since GeoAPI 2.1
053 */
054 @UML(identifier="CV_ValueCurve", specification=ISO_19123)
055 public interface ValueCurve extends ValueObject {
056 /**
057 * Returns the cruve that is the basis of this value curve.
058 */
059 @UML(identifier="geometry", obligation=MANDATORY, specification=ISO_19123)
060 DomainObject<Curve> getGeometry();
061
062 /**
063 * Returns the set of <var>point</var>-<var>value</var> pairs that provide control
064 * values for the interpolation along the value curve.
065 */
066 @UML(identifier="controlValue", obligation=MANDATORY, specification=ISO_19123)
067 Set<PointValuePair> getControlValues();
068
069 /**
070 * Returns the set of value segments nearest to the specified direct position. This method
071 * shall invoke the {@link Curve#getParamForPoint} method to obtain the distance parameter
072 * corresponding to the input direct position. The method {@code getParamForPoint} returns
073 * the parameter value for the position on the {@linkplain Curve curve} closest to the input
074 * direct position.
075 * <p>
076 * This method will normally return a single value segment. There are three cases for which
077 * it could return multiple value segments:
078 * <p>
079 * <ul>
080 * <li>The {@code ValueCurve} is not simple. The position on the curve that is closest to the
081 * input direct position is a point of self-intersection. The method {@code getParamForPoint}
082 * returns two or more parameter values. In this case, the method {@code segment} shall raise
083 * an exception.</li>
084 *
085 * <li>There are two or more positions on the {@code ValueCurve} that are at the same minimal
086 * distance from the input direct position. The method {@code getParamForPoint} returns
087 * two or more parameter values. In this case, the method {@code segment} shall raise an
088 * exception.</li>
089 *
090 * <li>The position on the {@code ValueCurve} that is closest to the input direct position is
091 * at the end of one {@code ValueSegment} and the start of the next. In this case, the
092 * method shall return both value segments.</li>
093 * </ul>
094 *
095 * @param p The position where to search for segments.
096 * @param tolerance The tolerance.
097 * @return The value segments nearest to the specified position.
098 *
099 * @todo I'm not sure to understand how the exception clause is related to the first sentence
100 * in the two first points?
101 */
102 @UML(identifier="segment", obligation=MANDATORY, specification=ISO_19123)
103 Set<ValueSegment> segment(DirectPosition p, double tolerance);
104 }