org.geotools.geometry.iso.primitive
Class SurfaceImpl
java.lang.Object
org.geotools.geometry.iso.root.GeometryImpl
org.geotools.geometry.iso.primitive.PrimitiveImpl
org.geotools.geometry.iso.primitive.OrientablePrimitiveImpl
org.geotools.geometry.iso.primitive.OrientableSurfaceImpl
org.geotools.geometry.iso.primitive.SurfaceImpl
- All Implemented Interfaces:
- java.io.Serializable, org.opengis.geometry.coordinate.GenericSurface, org.opengis.geometry.Geometry, org.opengis.geometry.primitive.OrientablePrimitive, org.opengis.geometry.primitive.OrientableSurface, org.opengis.geometry.primitive.Primitive, org.opengis.geometry.primitive.Surface, org.opengis.geometry.TransfiniteSet
- Direct Known Subclasses:
- PolyhedralSurfaceImpl
public class SurfaceImpl
- extends OrientableSurfaceImpl
- implements org.opengis.geometry.primitive.Surface
Surface (Figure 12) a subclass of Primitive and is the basis for
2-dimensional geometry. Unorientable surfaces such as the Möbius band are not
allowed. The orientation of a surface chooses an "up" direction through the
choice of the upward normal, which, if the surface is not a cycle, is the
side of the surface from which the exterior boundary appears
counterclockwise. Reversal of the surface orientation reverses the curve
orientation of each boundary component, and interchanges the conceptual "up"
and "down" direction of the surface. If the surface is the boundary of a
solid, the "up" direction is usually outward. For closed surfaces, which have
no boundary, the up direction is that of the surface patches, which must be
consistent with one another. Its included SurfacePatches describe the
interior structure of a Surface
NOTE Other than the restriction on orientability, no other "validity"
condition is required for Surface.
- Author:
- Jackson Roehrig & Sanjay Jena
- See Also:
- Serialized Form
Field Summary |
protected java.util.ArrayList<? extends org.opengis.geometry.primitive.SurfacePatch> |
patch
The "Segmentation" association relates this Surface to a set of
SurfacePatches that shall be joined together to form this Surface. |
Constructor Summary |
SurfaceImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
java.util.List<? extends org.opengis.geometry.primitive.SurfacePatch> patch)
Constructor The first version of the constructor for Surface takes a list
of SurfacePatches with the appropriate side-toside relationships and
creates a Surface. |
SurfaceImpl(org.opengis.geometry.primitive.SurfaceBoundary boundary)
Constructor The second version, which is guaranteed to work always in 2D
coordinate spaces, constructs a Surface by indicating its boundary as a
collection of Curves organized into a SurfaceBoundary. |
Method Summary |
SurfaceImpl |
clone()
|
protected OrientablePrimitiveImpl |
createProxy()
|
boolean |
equals(java.lang.Object obj)
|
double |
getArea()
|
SurfaceBoundaryImpl |
getBoundary()
|
java.util.List<org.opengis.geometry.primitive.Ring> |
getBoundaryRings()
Returns a list of the rings which define the surface: First element is
the exterior ring (island), the following elements, if exist, define the
interior rings (holes) |
org.opengis.geometry.complex.CompositeSurface |
getComposite()
|
int |
getDimension(org.opengis.geometry.DirectPosition point)
|
org.opengis.geometry.Envelope |
getEnvelope()
|
java.util.List<? extends org.opengis.geometry.primitive.SurfacePatch> |
getPatches()
|
double |
getPerimeter()
|
org.opengis.geometry.primitive.Surface |
getPrimitive()
|
org.opengis.geometry.primitive.OrientableSurface[] |
getProxy()
Returns an array with two orientable primitives, whereas the first one is
"this" object and the second one the field proxy |
org.opengis.geometry.DirectPosition |
getRepresentativePoint()
|
double[] |
getUpNormal(org.opengis.geometry.DirectPosition point)
|
int |
hashCode()
|
boolean |
isSimple()
|
void |
setBoundary(SurfaceBoundaryImpl boundary)
Sets the Boundary of the Surface |
protected void |
setPatches(java.util.List<? extends org.opengis.geometry.primitive.SurfacePatch> surfacePatches)
Sets the Surface Patches and Boundary for the Surface |
java.lang.String |
toString()
|
org.opengis.geometry.Geometry |
transform(org.opengis.referencing.crs.CoordinateReferenceSystem newCRS,
org.opengis.referencing.operation.MathTransform transform)
|
Methods inherited from class org.geotools.geometry.iso.root.GeometryImpl |
castToGeometryImpl, castToGeometryImpl, contains, contains, cRelate, crosses, difference, disjoint, distance, equals, getBuffer, getCentroid, getClosure, getConvexHull, getCoordinateDimension, getCoordinateReferenceSystem, getDistance, getMbRegion, getPositionFactory, getPrecision, intersection, intersects, isCycle, isMutable, overlaps, relate, symmetricDifference, toImmutable, touches, transform, union, within |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengis.geometry.primitive.OrientablePrimitive |
getOrientation |
Methods inherited from interface org.opengis.geometry.primitive.Primitive |
getComplexes, getContainedPrimitives, getContainingPrimitives |
Methods inherited from interface org.opengis.geometry.Geometry |
distance, getBuffer, getCentroid, getClosure, getConvexHull, getCoordinateDimension, getCoordinateReferenceSystem, getMaximalComplex, getMbRegion, getPrecision, isCycle, isMutable, toImmutable, transform |
Methods inherited from interface org.opengis.geometry.TransfiniteSet |
contains, contains, difference, equals, intersection, intersects, symmetricDifference, union |
patch
protected java.util.ArrayList<? extends org.opengis.geometry.primitive.SurfacePatch> patch
- The "Segmentation" association relates this Surface to a set of
SurfacePatches that shall be joined together to form this Surface.
Depending on the interpolation method, the set of patches may require
significant additional structure. In general, the form of the patches
shall be defined in the application schema.
Surface::patch [1..n] : SurfacePatch SurfacePatch::surface [0,1] :
Reference
If the Surface.coordinateDimension is 2, then the entire Surface is one
logical patch defined by linear interpolation from the boundary.
NOTE In this standard, surface patches do not appear except in the
context of a surface, and therefore the cardinality of the surface role
in this association could be 1 which would preclude the use of surface
patches except in this manner. While this would not affect this Standard,
leaving the cardinality as 0..1 allows other standards based on this
one to use surface patches in a more open-ended manner.
SurfaceImpl
public SurfaceImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
java.util.List<? extends org.opengis.geometry.primitive.SurfacePatch> patch)
- Constructor The first version of the constructor for Surface takes a list
of SurfacePatches with the appropriate side-toside relationships and
creates a Surface.
Surface::Surface(patch[1..n] : SurfacePatch) : Surface
- Parameters:
crs
- patch
-
SurfaceImpl
public SurfaceImpl(org.opengis.geometry.primitive.SurfaceBoundary boundary)
- Constructor The second version, which is guaranteed to work always in 2D
coordinate spaces, constructs a Surface by indicating its boundary as a
collection of Curves organized into a SurfaceBoundary. In 3D coordinate
spaces, this second version of the constructor shall require all of the
defining boundary Curve instances to be coplanar (lie in a single plane)
which will define the surface interior.
Surface::Surface(bdy : SurfaceBoundary) : Surface
- Parameters:
boundary
- The SurfaceBoundary which defines the Surface
getBoundary
public SurfaceBoundaryImpl getBoundary()
- Specified by:
getBoundary
in interface org.opengis.geometry.Geometry
- Specified by:
getBoundary
in interface org.opengis.geometry.primitive.OrientableSurface
- Specified by:
getBoundary
in interface org.opengis.geometry.primitive.Primitive
- Specified by:
getBoundary
in class PrimitiveImpl
setBoundary
public void setBoundary(SurfaceBoundaryImpl boundary)
- Sets the Boundary of the Surface
- Parameters:
boundary
- The boundary to set.
setPatches
protected void setPatches(java.util.List<? extends org.opengis.geometry.primitive.SurfacePatch> surfacePatches)
- Sets the Surface Patches and Boundary for the Surface
- Parameters:
surfacePatches
- -
ArrayList of Surface Patches, which represent the SurfacesurfaceBoundary
- -
Surface Boundary of the Surface
getPatches
public java.util.List<? extends org.opengis.geometry.primitive.SurfacePatch> getPatches()
- Specified by:
getPatches
in interface org.opengis.geometry.primitive.Surface
getEnvelope
public org.opengis.geometry.Envelope getEnvelope()
- Specified by:
getEnvelope
in interface org.opengis.geometry.Geometry
- Specified by:
getEnvelope
in class GeometryImpl
createProxy
protected OrientablePrimitiveImpl createProxy()
- Specified by:
createProxy
in class OrientablePrimitiveImpl
- Returns:
- a new orientable primitive with negative orientation
clone
public SurfaceImpl clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface org.opengis.geometry.Geometry
- Specified by:
clone
in class GeometryImpl
- Throws:
java.lang.CloneNotSupportedException
getComposite
public org.opengis.geometry.complex.CompositeSurface getComposite()
- Specified by:
getComposite
in interface org.opengis.geometry.primitive.OrientableSurface
- Specified by:
getComposite
in interface org.opengis.geometry.primitive.Primitive
- Overrides:
getComposite
in class PrimitiveImpl
getPrimitive
public org.opengis.geometry.primitive.Surface getPrimitive()
- Specified by:
getPrimitive
in interface org.opengis.geometry.primitive.OrientablePrimitive
- Specified by:
getPrimitive
in interface org.opengis.geometry.primitive.OrientableSurface
- Overrides:
getPrimitive
in class OrientablePrimitiveImpl
getProxy
public org.opengis.geometry.primitive.OrientableSurface[] getProxy()
- Description copied from class:
OrientablePrimitiveImpl
- Returns an array with two orientable primitives, whereas the first one is
"this" object and the second one the field proxy
- Specified by:
getProxy
in interface org.opengis.geometry.primitive.Primitive
- Specified by:
getProxy
in interface org.opengis.geometry.primitive.Surface
- Overrides:
getProxy
in class OrientablePrimitiveImpl
- Returns:
- an array OrientablePrimitive[2] with the positive and the
negative orientable primitive
isSimple
public boolean isSimple()
- Specified by:
isSimple
in interface org.opengis.geometry.Geometry
getUpNormal
public double[] getUpNormal(org.opengis.geometry.DirectPosition point)
- Specified by:
getUpNormal
in interface org.opengis.geometry.coordinate.GenericSurface
getPerimeter
public double getPerimeter()
- Specified by:
getPerimeter
in interface org.opengis.geometry.coordinate.GenericSurface
getArea
public double getArea()
- Specified by:
getArea
in interface org.opengis.geometry.coordinate.GenericSurface
getDimension
public int getDimension(org.opengis.geometry.DirectPosition point)
- Specified by:
getDimension
in interface org.opengis.geometry.Geometry
- Specified by:
getDimension
in class GeometryImpl
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getBoundaryRings
public java.util.List<org.opengis.geometry.primitive.Ring> getBoundaryRings()
- Returns a list of the rings which define the surface: First element is
the exterior ring (island), the following elements, if exist, define the
interior rings (holes)
- Returns:
- List of Ring: First element is the exterior ring (island),
the following elements, if exist, define the interior rings
(holes)
getRepresentativePoint
public org.opengis.geometry.DirectPosition getRepresentativePoint()
- Specified by:
getRepresentativePoint
in interface org.opengis.geometry.Geometry
- Specified by:
getRepresentativePoint
in class GeometryImpl
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
transform
public org.opengis.geometry.Geometry transform(org.opengis.referencing.crs.CoordinateReferenceSystem newCRS,
org.opengis.referencing.operation.MathTransform transform)
throws org.opengis.referencing.operation.TransformException
- Specified by:
transform
in interface org.opengis.geometry.Geometry
- Overrides:
transform
in class GeometryImpl
- Throws:
org.opengis.referencing.operation.TransformException
Copyright © 1996-2010 Geotools. All Rights Reserved.