org.geotools.geometry.iso.complex
Class ComplexImpl
java.lang.Object
org.geotools.geometry.iso.root.GeometryImpl
org.geotools.geometry.iso.complex.ComplexImpl
- All Implemented Interfaces:
- java.io.Serializable, org.opengis.geometry.complex.Complex, org.opengis.geometry.Geometry, org.opengis.geometry.TransfiniteSet
- Direct Known Subclasses:
- BoundaryImpl, CompositeImpl
public abstract class ComplexImpl
- extends GeometryImpl
- implements org.opengis.geometry.complex.Complex
A Complex is a collection of geometrically disjoint, simple Primitives. If a
Primitive (other than a Point) is in a particular Complex, then there exists
a set of primitives of lower dimension in the same complex that form the
boundary of this primitive.
NOTE A geometric complex can be thought of as a set in two distinct ways.
First, it is a finite set of objects (via delegation to its elements member)
and, second, it is an infinite set of point values as a subtype of geometric
object. The dual use of delegation and subtyping is to disambiguate the two
types of set interface. To determine if a Primitive P is an element of a
Complex C, call: C.element().contains(P).
The "element" attribute allows Complex to inherit the behavior of Set
without confusing the same sort of behavior inherited from TransfiniteSet
inherited through Object. Complexes shall be used in application schemas
where the sharing of geometry is important, such as in the use of
computational topology. In a complex, primitives may be aggregated
many-to-many into composites for use as attributes of features. Examples of
this are provided in the schemas in annex D.
- Author:
- Jackson Roehrig & Sanjay Jena
- See Also:
- Serialized Form
Field Summary |
protected java.util.List<? extends org.opengis.geometry.primitive.Primitive> |
elements
The association "Complex" is defined by the "contains" operation in
Object that is inherited from TransfiniteSet. |
Constructor Summary |
ComplexImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Constructs a Complex Elements have to be added after |
ComplexImpl(java.util.List<? extends org.opengis.geometry.primitive.Primitive> elements)
|
Method Summary |
protected void |
addSubComplex(org.opengis.geometry.complex.Complex subComplex1)
Adds an associated Sub Complex |
protected void |
addSuperComplex(ComplexImpl superComplex1)
Adds an associated Super Complex |
abstract java.util.Set<org.opengis.geometry.complex.Complex> |
createBoundary()
|
java.util.Collection<? extends org.opengis.geometry.primitive.Primitive> |
getElements()
Returns elements contained in this Complex |
java.util.Set<org.opengis.geometry.complex.Complex> |
getMaximalComplex()
As a set of primitives, a Complex may be contained as a set in another
larger Complex, referred to as a "super complex" of the original. |
org.opengis.geometry.complex.Complex[] |
getSubComplexes()
|
org.opengis.geometry.complex.Complex[] |
getSuperComplexes()
|
boolean |
isMaximal()
The Boolean valued operation "isMaximal" shall return TRUE if and only if
this Complex is maximal. |
void |
setElements(java.util.List<? extends org.opengis.geometry.primitive.Primitive> element)
Sets the elements contained by this Complex |
Methods inherited from class org.geotools.geometry.iso.root.GeometryImpl |
castToGeometryImpl, castToGeometryImpl, clone, contains, contains, cRelate, crosses, difference, disjoint, distance, equals, getBoundary, getBuffer, getCentroid, getClosure, getConvexHull, getCoordinateDimension, getCoordinateReferenceSystem, getDimension, getDistance, getEnvelope, getMbRegion, getPositionFactory, getPrecision, getRepresentativePoint, intersection, intersects, isCycle, isMutable, overlaps, relate, symmetricDifference, toImmutable, touches, transform, transform, union, within |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opengis.geometry.Geometry |
clone, distance, getBoundary, getBuffer, getCentroid, getClosure, getConvexHull, getCoordinateDimension, getCoordinateReferenceSystem, getDimension, getEnvelope, getMbRegion, getPrecision, getRepresentativePoint, isCycle, isMutable, isSimple, toImmutable, transform, transform |
Methods inherited from interface org.opengis.geometry.TransfiniteSet |
contains, contains, difference, equals, intersection, intersects, symmetricDifference, union |
elements
protected java.util.List<? extends org.opengis.geometry.primitive.Primitive> elements
- The association "Complex" is defined by the "contains" operation in
Object that is inherited from TransfiniteSet.
Complex::element [1..n] : Primitive If a complex contains a Primitive,
then it must also contain the elements of its boundary. Complex: --
closed under the boundary operation
self?forAll(self?includesAll(boundary()))
ArrayList of Primitive [1..n]
ComplexImpl
public ComplexImpl(java.util.List<? extends org.opengis.geometry.primitive.Primitive> elements)
- Parameters:
elements
-
ComplexImpl
public ComplexImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
- Constructs a Complex Elements have to be added after
- Parameters:
crs
-
setElements
public void setElements(java.util.List<? extends org.opengis.geometry.primitive.Primitive> element)
- Sets the elements contained by this Complex
- Parameters:
element
-
createBoundary
public abstract java.util.Set<org.opengis.geometry.complex.Complex> createBoundary()
- Returns:
- Set
getElements
public java.util.Collection<? extends org.opengis.geometry.primitive.Primitive> getElements()
- Returns elements contained in this Complex
- Specified by:
getElements
in interface org.opengis.geometry.complex.Complex
- Returns:
- the primitives
isMaximal
public boolean isMaximal()
- The Boolean valued operation "isMaximal" shall return TRUE if and only if
this Complex is maximal. Complex::isMaximal() : Boolean
- Specified by:
isMaximal
in interface org.opengis.geometry.complex.Complex
- Returns:
- true if this complex is maximal
addSubComplex
protected void addSubComplex(org.opengis.geometry.complex.Complex subComplex1)
- Adds an associated Sub Complex
- Parameters:
subComplex1
-
addSuperComplex
protected void addSuperComplex(ComplexImpl superComplex1)
- Adds an associated Super Complex
- Parameters:
superComplex1
-
getSuperComplexes
public org.opengis.geometry.complex.Complex[] getSuperComplexes()
- Specified by:
getSuperComplexes
in interface org.opengis.geometry.complex.Complex
getSubComplexes
public org.opengis.geometry.complex.Complex[] getSubComplexes()
- Specified by:
getSubComplexes
in interface org.opengis.geometry.complex.Complex
getMaximalComplex
public java.util.Set<org.opengis.geometry.complex.Complex> getMaximalComplex()
- As a set of primitives, a Complex may be contained as a set in another
larger Complex, referred to as a "super complex" of the original. A
Complex is maximal if there is no such larger super complex. The
operation "maximalComplex" shall return the set of maximal Complexes
within which this Object is contained.
Object::maximalComplex() : Set
If the application schema used does not include Complex, then this
operation shall return a NULL value.
NOTE The usual semantics of maximal complexes does not allow any
Primitive to be in more than one maximal complex, making it a strong
aggregation. This is not an absolute, and depending on the semantics of
the implementation, the association between Primitives and maximal
Complexes could be many to many. From a programming point of view, this
would be a difficult (but not impossible) dynamic structure to maintain,
but as a static query-only structure, it could be quite useful in
minimizing redundant data inherent in two representations of the same
primitive geometric object.
- Specified by:
getMaximalComplex
in interface org.opengis.geometry.Geometry
- Returns:
- the set containing only this object if it is a maximal complex or
its maximum complexes
Copyright © 1996-2010 Geotools. All Rights Reserved.