GeometryFactory

@SerialVersionUID(-6820524753094095635L) class GeometryFactory(var precisionModel: PrecisionModel, var SRID: Int, var coordinateSequenceFactory: CoordinateSequenceFactory) extends Serializable
Companion
object
trait Serializable
class Object
trait Matchable
class Any

Value members

Constructors

def this(coordinateSequenceFactory: CoordinateSequenceFactory)

Constructs a GeometryFactory that generates Geometries having the given CoordinateSequence implementation, a double-precision floating PrecisionModel and a spatial-reference ID of 0.

Constructs a GeometryFactory that generates Geometries having the given CoordinateSequence implementation, a double-precision floating PrecisionModel and a spatial-reference ID of 0.

def this(precisionModel: PrecisionModel)

Constructs a GeometryFactory that generates Geometries having the given {link PrecisionModel} and the default CoordinateSequence implementation.

Constructs a GeometryFactory that generates Geometries having the given {link PrecisionModel} and the default CoordinateSequence implementation.

Value Params
precisionModel

the PrecisionModel to use

def this(precisionModel: PrecisionModel, SRID: Int)

Constructs a GeometryFactory that generates Geometries having the given {link PrecisionModel} and spatial-reference ID, and the default CoordinateSequence implementation.

Constructs a GeometryFactory that generates Geometries having the given {link PrecisionModel} and spatial-reference ID, and the default CoordinateSequence implementation.

Value Params
SRID

the SRID to use

precisionModel

the PrecisionModel to use

def this()

Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0.

Constructs a GeometryFactory that generates Geometries having a floating PrecisionModel and a spatial-reference ID of 0.

Concrete methods

def buildGeometry(geomList: Collection[Geometry]): Geometry

Build an appropriate <code>Geometry</code>, <code>MultiGeometry</code>, or <code>GeometryCollection</code> to contain the <code>Geometry</code>s in it. For example:<br>

Build an appropriate <code>Geometry</code>, <code>MultiGeometry</code>, or <code>GeometryCollection</code> to contain the <code>Geometry</code>s in it. For example:<br>

  • If <code>geomList</code> contains a single <code>Polygon</code>, the <code>Polygon</code> is returned.

  • If <code>geomList</code> contains several <code>Polygon</code>s, a <code>MultiPolygon</code> is returned.

  • If <code>geomList</code> contains some <code>Polygon</code>s and some <code>LineString</code>s, a <code>GeometryCollection</code> is returned.

  • If <code>geomList</code> is empty, an empty <code>GeometryCollection</code> is returned

Note that this method does not "flatten" Geometries in the input, and hence if any MultiGeometries are contained in the input a GeometryCollection containing them will be returned.

Value Params
geomList

the <code>Geometry</code>s to combine return a <code>Geometry</code> of the "smallest", "most type-specific" class that can contain the elements of <code>geomList</code> .

def createEmpty(dimension: Int): Geometry

Creates an empty atomic geometry of the given dimension. If passed a dimension of -1 will create an empty {link GeometryCollection}.

Creates an empty atomic geometry of the given dimension. If passed a dimension of -1 will create an empty {link GeometryCollection}.

Value Params
dimension

the required dimension (-1, 0, 1 or 2) return an empty atomic geometry of given dimension

Creates a deep copy of the input {link Geometry}. The {link CoordinateSequenceFactory} defined for this factory is used to copy the {link CoordinateSequence}s of the input geometry.

Creates a deep copy of the input {link Geometry}. The {link CoordinateSequenceFactory} defined for this factory is used to copy the {link CoordinateSequence}s of the input geometry.

This is a convenient way to change the <tt>CoordinateSequence</tt> used to represent a geometry, or to change the factory used for a geometry.

{link Geometry#copy()} can also be used to make a deep copy, but it does not allow changing the CoordinateSequence type.

return a deep copy of the input geometry, using the CoordinateSequence type of this factory

See also

Geometry#copy()

Constructs an empty {link GeometryCollection} geometry.

Constructs an empty {link GeometryCollection} geometry.

return an empty GeometryCollection

Creates a GeometryCollection using the given Geometries; a null or empty array will create an empty GeometryCollection.

Creates a GeometryCollection using the given Geometries; a null or empty array will create an empty GeometryCollection.

Value Params
geometries

an array of Geometries, each of which may be empty but not null, or null return the created GeometryCollection

Constructs an empty {link LineString} geometry.

Constructs an empty {link LineString} geometry.

return an empty LineString

def createLineString(coordinates: Array[Coordinate]): LineString

Creates a LineString using the given Coordinates. A null or empty array creates an empty LineString.

Creates a LineString using the given Coordinates. A null or empty array creates an empty LineString.

Value Params
coordinates

an array without null elements, or an empty array, or null

Creates a LineString using the given CoordinateSequence. A null or empty CoordinateSequence creates an empty LineString.

Creates a LineString using the given CoordinateSequence. A null or empty CoordinateSequence creates an empty LineString.

Value Params
coordinates

a CoordinateSequence (possibly empty), or null

Constructs an empty {link LinearRing} geometry.

Constructs an empty {link LinearRing} geometry.

return an empty LinearRing

def createLinearRing(coordinates: Array[Coordinate]): LinearRing

Creates a {link LinearRing} using the given {link Coordinate}s. A null or empty array creates an empty LinearRing. The points must form a closed and simple linestring.

Creates a {link LinearRing} using the given {link Coordinate}s. A null or empty array creates an empty LinearRing. The points must form a closed and simple linestring.

Value Params
coordinates

an array without null elements, or an empty array, or null return the created LinearRing throws IllegalArgumentException if the ring is not closed, or has too few points

Creates a {link LinearRing} using the given {link CoordinateSequence}. A null or empty array creates an empty LinearRing. The points must form a closed and simple linestring.

Creates a {link LinearRing} using the given {link CoordinateSequence}. A null or empty array creates an empty LinearRing. The points must form a closed and simple linestring.

Value Params
coordinates

a CoordinateSequence (possibly empty), or null return the created LinearRing throws IllegalArgumentException if the ring is not closed, or has too few points

Constructs an empty {link MultiLineString} geometry.

Constructs an empty {link MultiLineString} geometry.

return an empty MultiLineString

Creates a MultiLineString using the given LineStrings; a null or empty array will create an empty MultiLineString.

Creates a MultiLineString using the given LineStrings; a null or empty array will create an empty MultiLineString.

Value Params
lineStrings

LineStrings, each of which may be empty but not null return the created MultiLineString

Constructs an empty {link MultiPoint} geometry.

Constructs an empty {link MultiPoint} geometry.

return an empty MultiPoint

def createMultiPoint(point: Array[Point]): MultiPoint

Creates a {link MultiPoint} using the given {link Point}s. A null or empty array will create an empty MultiPoint.

Creates a {link MultiPoint} using the given {link Point}s. A null or empty array will create an empty MultiPoint.

Value Params
point

an array of Points (without null elements), or an empty array, or <code>null</code> return a MultiPoint object

def createMultiPoint(coordinates: Array[Coordinate]): MultiPoint

Creates a {link MultiPoint} using the given {link Coordinate}s. A null or empty array will create an empty MultiPoint.

Creates a {link MultiPoint} using the given {link Coordinate}s. A null or empty array will create an empty MultiPoint.

Value Params
coordinates

an array (without null elements), or an empty array, or <code>null</code> return a MultiPoint object

Creates a {link MultiPoint} using the points in the given {link CoordinateSequence}. A <code>null</code> or empty CoordinateSequence creates an empty MultiPoint.

Creates a {link MultiPoint} using the points in the given {link CoordinateSequence}. A <code>null</code> or empty CoordinateSequence creates an empty MultiPoint.

Value Params
coordinates

a CoordinateSequence (possibly empty), or <code>null</code> return a MultiPoint geometry

Creates a {link MultiPoint} using the given {link Coordinate}s. A null or empty array will create an empty MultiPoint.

Creates a {link MultiPoint} using the given {link Coordinate}s. A null or empty array will create an empty MultiPoint.

Value Params
coordinates

an array (without null elements), or an empty array, or <code>null</code> return a MultiPoint object

Constructs an empty {link MultiPolygon} geometry.

Constructs an empty {link MultiPolygon} geometry.

return an empty MultiPolygon

def createMultiPolygon(polygons: Array[Polygon]): MultiPolygon

Creates a MultiPolygon using the given Polygons; a null or empty array will create an empty Polygon. The polygons must conform to the assertions specified in the <A HREF="http://www.opengis.org/techno/specs.htm">OpenGIS Simple Features Specification for SQL</A>.

Creates a MultiPolygon using the given Polygons; a null or empty array will create an empty Polygon. The polygons must conform to the assertions specified in the <A HREF="http://www.opengis.org/techno/specs.htm">OpenGIS Simple Features Specification for SQL</A>.

Value Params
polygons

Polygons, each of which may be empty but not null return the created MultiPolygon

Constructs an empty {link Point} geometry.

Constructs an empty {link Point} geometry.

return an empty Point

def createPoint(coordinate: Coordinate): Point

Creates a Point using the given Coordinate. A null Coordinate creates an empty Geometry.

Creates a Point using the given Coordinate. A null Coordinate creates an empty Geometry.

Value Params
coordinate

a Coordinate, or null return the created Point

Creates a Point using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty Point.

Creates a Point using the given CoordinateSequence; a null or empty CoordinateSequence will create an empty Point.

Value Params
coordinates

a CoordinateSequence (possibly empty), or null return the created Point

def createPolygon(shell: LinearRing, holes: Array[LinearRing]): Polygon

Constructs a <code>Polygon</code> with the given exterior boundary and interior boundaries.

Constructs a <code>Polygon</code> with the given exterior boundary and interior boundaries.

Value Params
holes

the inner boundaries of the new <code>Polygon</code>, or <code>null</code> or empty <code>LinearRing</code> s if the empty geometry is to be created. throws IllegalArgumentException if a ring is invalid

shell

the outer boundary of the new <code>Polygon</code>, or <code>null</code> or an empty <code>LinearRing</code> if the empty geometry is to be created.

Constructs a <code>Polygon</code> with the given exterior boundary.

Constructs a <code>Polygon</code> with the given exterior boundary.

Value Params
shell

the outer boundary of the new <code>Polygon</code>, or <code>null</code> or an empty <code>LinearRing</code> if the empty geometry is to be created. throws IllegalArgumentException if the boundary ring is invalid

def createPolygon(shell: Array[Coordinate]): Polygon

Constructs an empty {link Polygon} geometry.

Constructs an empty {link Polygon} geometry.

return an empty polygon

Returns the PrecisionModel that Geometries created by this factory will be associated with.

Returns the PrecisionModel that Geometries created by this factory will be associated with.

return the PrecisionModel for this factory

def getSRID: Int

Gets the SRID value defined for this factory.

Gets the SRID value defined for this factory.

return the factory SRID value

def toGeometry(envelope: Envelope): Geometry

Creates a {link Geometry} with the same extent as the given envelope. The Geometry returned is guaranteed to be valid. To provide this behaviour, the following cases occur:

Creates a {link Geometry} with the same extent as the given envelope. The Geometry returned is guaranteed to be valid. To provide this behaviour, the following cases occur:

If the <code>Envelope</code> is:

  • null : returns an empty {link Point}

  • a point : returns a non-empty {link Point}

  • a line : returns a two-point {link LineString}

  • a rectangle : returns a {link Polygon} whose points are (minx, miny), (minx, maxy), (maxx, maxy), (maxx, miny), (minx, miny).

Value Params
envelope

the <code>Envelope</code> to convert return an empty <code>Point</code> (for null <code>Envelope</code>s), a <code>Point</code> (when min x = max x and min y = max y) or a <code>Polygon</code> (in all other cases)