001 /*
002 * GeoAPI - Java interfaces for OGC/ISO standards
003 * http://www.geoapi.org
004 *
005 * Copyright (C) 2004-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.geometry.coordinate;
033
034 import org.opengis.geometry.DirectPosition;
035 import org.opengis.annotation.UML;
036
037 import static org.opengis.annotation.Obligation.*;
038 import static org.opengis.annotation.Specification.*;
039
040
041 /**
042 * Common interface for {@linkplain org.opengis.geometry.primitive.Surface surface} and
043 * {@linkplain org.opengis.geometry.primitive.SurfacePatch surface patch}. {@code Surface}
044 * and {@code SurfacePatch} represent sections of surface geometry,
045 * and therefore share a number of operation signatures.
046 *
047 * @version <A HREF="http://www.opengeospatial.org/standards/as">ISO 19107</A>
048 * @author Martin Desruisseaux (IRD)
049 * @since GeoAPI 1.0
050 *
051 * @todo Investigate why this interface doesn't extends {@link Geometry}, since it is a cause
052 * of difficulty with {@link org.opengis.coverage.Coverage}.
053 */
054 @UML(identifier="GM_GenericSurface", specification=ISO_19107)
055 public interface GenericSurface {
056 /**
057 * Returns a vector perpendicular to the {@code GenericSurface} at the
058 * {@linkplain DirectPosition direct position} passed, which must be on this
059 * {@code GenericSurface}. The upward normal always points upward in a
060 * manner consistent with the boundary. This means that the exterior boundary
061 * of the surface is counterclockwise when viewed from the side of the surface
062 * indicated by the {@code upNormal}. Interior boundaries are clockwise.
063 * The side of the surface indicated by the {@code upNormal} is referred
064 * to as the "top." The function "upNormal" shall be continuous and the length
065 * of the normal shall always be equal to 1.0.
066 *
067 * <blockquote><font size=2>
068 * <strong>NOTE:</strong> The upNormal along a boundary of a solid always points away from the
069 * solid. This is a slight semantics problem in dealing with voids within solids, where the
070 * upNormal (for sake of mathematical consistency) points into the center of the voided region,
071 * which linguistically can be considered the interior of the void. What the confusion is here
072 * is that the basic linguistic metaphors used in most languages for "interior of solid" and
073 * for "interior of container" use "inward" in inconsistent manners from a topological point
074 * of view. The void "in" rock is not inside the rock in the same manner as the solid material
075 * that makes up the substance of the rock. Nor is the coffee "in" the cup the same "in" as
076 * the ceramic glass "in" the cup. The use of these culturally derived metaphors may not be
077 * consistent across all languages, some of which may use different prepositions for these two
078 * different concepts. This specification uses the linguistically neutral concept of "interior"
079 * derived from mathematics (topology).
080 * </font></blockquote>
081 *
082 * @param point The point on this {@code GenericSurface} where to compute the upNormal.
083 * @return The upNormal unit vector.
084 */
085 @UML(identifier="upNormal", obligation=MANDATORY, specification=ISO_19107)
086 double[] getUpNormal(DirectPosition point);
087
088 /**
089 * Returns the sum of the lengths of all the boundary components of this
090 * {@code GenericSurface}. Since perimeter, like length, is an accumulation
091 * (integral) of distance, its return value shall be in a reference system appropriate
092 * for measuring distances.
093 *
094 * <blockquote><font size=2>
095 * <strong>NOTE:</strong> The perimeter is defined as the sum of the lengths of all boundary
096 * components. The length of a curve or of a collection of curves is always positive and
097 * non-zero (unless the curve is pathological). This means that holes in surfaces will
098 * contribute positively to the total perimeter.
099 * </font></blockquote>
100 *
101 * @return The perimeter.
102 * @unitof Length
103 */
104 @UML(identifier="perimeter", obligation=MANDATORY, specification=ISO_19107)
105 double getPerimeter();
106
107 /**
108 * Returns the area of this {@code GenericSurface}. The area of a 2-dimensional geometric
109 * object shall be a numeric measure of its surface area (in a square unit of distance). Since
110 * area is an accumulation (integral) of the product of two distances, its return value shall
111 * be in a unit of measure appropriate for measuring distances squared, such as meters squared
112 * (m<sup>2</sup>).
113 *
114 * <blockquote><font size=2>
115 * <strong>NOTE:</strong> Consistent with the definition of surface as a set of
116 * {@linkplain DirectPosition direct positions}, holes in the surfaces will not contribute to
117 * the total area. If the usual Green's Theorem (or more general Stokes' Theorem) integral is
118 * used, the integral around the holes in the surface are subtracted from the integral
119 * about the exterior of the surface patch.
120 * </font></blockquote>
121 *
122 * @return The area.
123 * @unitof Area
124 */
125 @UML(identifier="area", obligation=MANDATORY, specification=ISO_19107)
126 double getArea();
127 }