object Centroid
Computes the centroid of a {link Geometry} of any dimension.
If the geometry is nominally of higher dimension,
but has lower effective dimension
(i.e. contains only components
having zero length or area),
the centroid will be computed as for the equivalent lower-dimension geometry.
If the input geometry is empty, a
null Coordinate is returned.
Algorithm
- Dimension 2 - the centroid is computed
as the weighted sum of the centroids
of a decomposition of the area into (possibly overlapping) triangles.
Holes and multipolygons are handled correctly.
See
http://www.faqs.org/faqs/graphics/algorithms-faq/for further details of the basic approach. - Dimension 1 - Computes the average of the midpoints of all line segments weighted by the segment length. Zero-length lines are treated as points.
- Dimension 0 - Compute the average coordinate for all points. Repeated points are all included in the average.
- Version
1.7
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Centroid
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def getCentroid(geom: Geometry): Coordinate
Computes the centroid point of a geometry.
Computes the centroid point of a geometry.
- geom
the geometry to use return the centroid point, or null if the geometry is empty
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()