public class OGCESRIShape extends java.lang.Object implements Shape
POLYGON ((-89 43,-89 50,-97 50,-97 43,-89 43))
The binary representation can be generated from PostGIS by selecting
the geom column using a normal select statement. When a shape is parsed, we
detect the format and use the appropriate parser. When writing to text, we
always use the binary representation as it is faster and more compact. For
binary serialization/deserialization, we use the PostGIS writer and parser.| Modifier and Type | Field and Description |
|---|---|
OGCGeometry |
geom
The underlying geometry
|
| Constructor and Description |
|---|
OGCESRIShape() |
OGCESRIShape(OGCGeometry geom) |
| Modifier and Type | Method and Description |
|---|---|
Shape |
clone()
Returns a clone of this shape
|
double |
distanceTo(double x,
double y)
Gets the distance of this shape to the given point.
|
void |
draw(java.awt.Graphics g,
double xscale,
double yscale)
Draws the shape to the given graphics and scale.
|
void |
draw(java.awt.Graphics g,
Rectangle fileMBR,
int imageWidth,
int imageHeight,
double scale)
Draws a shape to the given graphics.
|
void |
drawESRIGeom(java.awt.Graphics g,
OGCGeometry geom,
double xscale,
double yscale) |
void |
fromText(Text text)
Retrieve information from the given text.
|
Rectangle |
getMBR()
Returns minimum bounding rectangle for this shape.
|
static byte[] |
hexToBytes(java.lang.String hex)
Convert a string containing a hex string to a byte array of binary.
|
boolean |
isIntersected(Shape s)
Returns true if this shape is intersected with the given shape
|
void |
readFields(java.io.DataInput in) |
java.lang.String |
toString() |
Text |
toText(Text text)
Store current object as string in the given text appending text already there.
|
void |
write(java.io.DataOutput out) |
public OGCESRIShape()
public OGCESRIShape(OGCGeometry geom)
public void write(java.io.DataOutput out)
throws java.io.IOException
java.io.IOExceptionpublic void readFields(java.io.DataInput in)
throws java.io.IOException
java.io.IOExceptionpublic static byte[] hexToBytes(java.lang.String hex)
hex - public Text toText(Text text)
TextSerializabletoText in interface TextSerializablepublic void fromText(Text text)
TextSerializablefromText in interface TextSerializablepublic Rectangle getMBR()
Shapepublic double distanceTo(double x,
double y)
ShapedistanceTo in interface Shapepublic boolean isIntersected(Shape s)
ShapeisIntersected in interface Shapepublic java.lang.String toString()
toString in class java.lang.Objectpublic void draw(java.awt.Graphics g,
Rectangle fileMBR,
int imageWidth,
int imageHeight,
double scale)
Shapedraw in interface Shapeg - - the graphics or canvas to draw tofileMBR - - the MBR of the file in which the shape is containedimageWidth - - width of the image to drawimageHeight - - height of the image to drawscale - - the scale used to convert shape coordinates to image coordinatespublic void draw(java.awt.Graphics g,
double xscale,
double yscale)
Shapepublic void drawESRIGeom(java.awt.Graphics g,
OGCGeometry geom,
double xscale,
double yscale)