|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.postgis.Geometry
public abstract class Geometry
The base class of all geometries
Field Summary | |
---|---|
static java.lang.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 (no srid) is -1 |
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. |
Constructor Summary | |
---|---|
protected |
Geometry(int type)
Constructor for subclasses |
Method Summary | |
---|---|
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(java.lang.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. |
java.lang.String |
getTypeString()
Return the Type as String |
static java.lang.String |
getTypeString(int type)
The Text representations of the geometry types |
java.lang.String |
getValue()
backwards compatibility method |
int |
hashCode()
java.lang.Object hashCode implementation |
protected java.lang.String |
initSRID(java.lang.String value)
Splits the SRID=4711; part of a EWKT rep if present and sets the srid. |
protected abstract void |
innerWKT(java.lang.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(java.lang.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(java.lang.StringBuffer sb)
|
void |
outerWKT(java.lang.StringBuffer sb,
boolean putM)
Render the WKT version of this Geometry (without SRID) into the given StringBuffer. |
void |
setSrid(int srid)
Recursively sets the srid on this geometry and all contained subgeometries |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 java.lang.String[] ALLTYPES
public int dimension
public boolean haveMeasure
public final int type
public int srid
Constructor Detail |
---|
protected Geometry(int type)
type
- has to be given by all subclasses.Method Detail |
---|
public static java.lang.String getTypeString(int type)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
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;
java.lang.ArrayIndexOutOfBoundsException
- in case of an emtpy geometry or
bad index.public abstract Point getFirstPoint()
public abstract Point getLastPoint()
public int getType()
public java.lang.String getTypeString()
public boolean isMeasured()
public int getDimension()
public int getSrid()
public void setSrid(int srid)
public java.lang.String toString()
toString
in class java.lang.Object
public void outerWKT(java.lang.StringBuffer sb, boolean putM)
public final void outerWKT(java.lang.StringBuffer sb)
protected void mediumWKT(java.lang.StringBuffer sb)
protected abstract void innerWKT(java.lang.StringBuffer SB)
public java.lang.String getValue()
public boolean checkConsistency()
protected java.lang.String initSRID(java.lang.String value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |