public abstract class Geometry extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String[] |
ALLTYPES |
int |
dimension
The dimensionality of this feature (2,3)
|
static int |
GEOMETRYCOLLECTION
The OGIS geometry type number for feature collections.
|
boolean |
haveMeasure
Do we have a measure (4th dimension)
|
static int |
LINEARRING
Fake type for linear ring
|
static int |
LINESTRING
The OGIS geometry type number for lines.
|
static int |
MULTILINESTRING
The OGIS geometry type number for aggregate lines.
|
static int |
MULTIPOINT
The OGIS geometry type number for aggregate points.
|
static int |
MULTIPOLYGON
The OGIS geometry type number for aggregate polygons.
|
static int |
POINT
The OGIS geometry type number for points.
|
static int |
POLYGON
The OGIS geometry type number for polygons.
|
int |
srid
The spacial reference system id of this geometry, default is no srid
|
int |
type
The OGIS geometry type of this feature. this is final as it never
changes, it is bound to the subclass of the instance.
|
static int |
UNKNOWN_SRID
Official UNKNOWN srid value
|
Modifier | Constructor and Description |
---|---|
protected |
Geometry(int type)
Constructor for subclasses
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkConsistency()
Do some internal consistency checks on the geometry.
|
boolean |
equals(Geometry other)
geometry specific equals implementation - only defined for non-null
values
|
boolean |
equals(Object other)
java.lang.Object equals implementation
|
protected abstract boolean |
equalsintern(Geometry other)
Whether test coordinates for geometry - subclass specific code
Implementors can assume that dimensin, type, srid and haveMeasure are
equal, other !
|
int |
getDimension()
Queries the number of geometric dimensions of this geometry.
|
abstract Point |
getFirstPoint()
Same as getPoint(0);
|
abstract Point |
getLastPoint()
Same as getPoint(numPoints()-1);
|
abstract Point |
getPoint(int n)
Get the nth Point of the geometry
|
int |
getSrid()
The OGIS geometry type number of this geometry.
|
int |
getType()
The OGIS geometry type number of this geometry.
|
String |
getTypeString()
Return the Type as String
|
static String |
getTypeString(int type)
The Text representations of the geometry types
|
String |
getValue()
backwards compatibility method
|
int |
hashCode()
java.lang.Object hashCode implementation
|
protected String |
initSRID(String value)
Splits the SRID=4711; part of a EWKT rep if present and sets the srid.
|
protected abstract void |
innerWKT(StringBuffer SB)
Render the "inner" part of the WKT (inside the brackets) into the
StringBuffer.
|
boolean |
isMeasured()
Returns whether we have a measure
|
protected void |
mediumWKT(StringBuffer sb)
Render the WKT without the type name, but including the brackets into the
StringBuffer
|
abstract int |
numPoints()
Return the number of Points of the geometry
|
void |
outerWKT(StringBuffer sb) |
void |
outerWKT(StringBuffer sb,
boolean putM)
Render the WKT version of this Geometry (without SRID) into the given
StringBuffer.
|
static int |
parseSRID(int srid)
Parse a SRID value, anything <= 0 is unknown
|
void |
setSrid(int srid)
Recursively sets the srid on this geometry and all contained
subgeometries
|
String |
toString() |
public static final int LINEARRING
public static final int POINT
public static final int LINESTRING
public static final int POLYGON
public static final int MULTIPOINT
public static final int MULTILINESTRING
public static final int MULTIPOLYGON
public static final int GEOMETRYCOLLECTION
public static final String[] ALLTYPES
public int dimension
public boolean haveMeasure
public final int type
public static final int UNKNOWN_SRID
public int srid
protected Geometry(int type)
type
- has to be given by all subclasses.public static String getTypeString(int type)
public static int parseSRID(int srid)
public int hashCode()
public boolean equals(Object other)
public boolean equals(Geometry other)
protected abstract boolean equalsintern(Geometry other)
public abstract int numPoints()
public abstract Point getPoint(int n)
n
- the index of the point, from 0 to numPoints()-1;ArrayIndexOutOfBoundsException
- in case of an emtpy geometry or bad index.public abstract Point getFirstPoint()
public abstract Point getLastPoint()
public int getType()
public String getTypeString()
public boolean isMeasured()
public int getDimension()
public int getSrid()
public void setSrid(int srid)
public void outerWKT(StringBuffer sb, boolean putM)
public final void outerWKT(StringBuffer sb)
protected void mediumWKT(StringBuffer sb)
protected abstract void innerWKT(StringBuffer SB)
public String getValue()
public boolean checkConsistency()
Copyright © 2014. All rights reserved.