deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.io.shpapi.shape_new
Class ShapePoint

java.lang.Object
  extended by org.deegree.io.shpapi.shape_new.ShapePoint
All Implemented Interfaces:
Shape

public class ShapePoint
extends Object
implements Shape

ShapePoint corresponds to Point, PointZ and PointM in shapefile terminology.

Version:
$Revision: 9342 $, $Date: 2007-12-27 13:32:57 +0100 (Do, 27 Dez 2007) $
Author:
Andreas Schmitz, last edited by: $Author: apoth $

Field Summary
 boolean isM
           
 boolean isZ
           
 double m
          The m value.
 double x
          The x value.
 double y
          The y value.
 double z
          The z value.
 
Constructor Summary
ShapePoint(boolean z, boolean m)
          Constructs one without values, use read to fill it.
ShapePoint(byte[] bytes, int offset)
          Just reads x and y from the byte array.
ShapePoint(Point p)
          Creates a new PointZ from deegree Point.
ShapePoint(Position p)
          Creates a new PointZ from deegree Position.
 
Method Summary
 com.vividsolutions.jts.geom.Coordinate export()
           
 void extend(double mVal)
          Extends this point with m values, so it is a PointM
 void extend(double zVal, double mVal)
          Extends this point with z and m values, so it is a PointZ
 int getByteLength()
           
 ShapeEnvelope getEnvelope()
           
 Geometry getGeometry()
          This creates a Point object.
 int getType()
           
 int read(byte[] bytes, int offset)
          Reads the object from a byte array.
 String toString()
           
 int write(byte[] bytes, int offset)
          Writes the object to a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isZ

public boolean isZ

isM

public boolean isM

x

public double x
The x value.


y

public double y
The y value.


z

public double z
The z value.


m

public double m
The m value.

Constructor Detail

ShapePoint

public ShapePoint(boolean z,
                  boolean m)
Constructs one without values, use read to fill it.

Parameters:
z - if PointZ
m - if PointM

ShapePoint

public ShapePoint(Point p)
Creates a new PointZ from deegree Point.

Parameters:
p -

ShapePoint

public ShapePoint(Position p)
Creates a new PointZ from deegree Position.

Parameters:
p -

ShapePoint

public ShapePoint(byte[] bytes,
                  int offset)
Just reads x and y from the byte array.

Parameters:
bytes -
offset -
Method Detail

export

public com.vividsolutions.jts.geom.Coordinate export()
Returns:
the Point as (x, y, NaN), the PointZ as (x, y, z) Coordinate

extend

public void extend(double zVal,
                   double mVal)
Extends this point with z and m values, so it is a PointZ

Parameters:
zVal -
mVal -

extend

public void extend(double mVal)
Extends this point with m values, so it is a PointM

Parameters:
mVal -

getByteLength

public int getByteLength()
Specified by:
getByteLength in interface Shape
Returns:
the number of bytes necessary to write this instance.

read

public int read(byte[] bytes,
                int offset)
Description copied from interface: Shape
Reads the object from a byte array.

Specified by:
read in interface Shape
offset - where to start reading
Returns:
the new offset or -1, if the type was wrong.

write

public int write(byte[] bytes,
                 int offset)
Description copied from interface: Shape
Writes the object to a byte array.

Specified by:
write in interface Shape
Returns:
the new offset.

getType

public int getType()
Specified by:
getType in interface Shape
Returns:
the type of the shape

getEnvelope

public ShapeEnvelope getEnvelope()
Specified by:
getEnvelope in interface Shape
Returns:
null, points do not have an envelope
See Also:
Shape.getEnvelope()

getGeometry

public Geometry getGeometry()
                     throws ShapeGeometryException
This creates a Point object.

Specified by:
getGeometry in interface Shape
Returns:
the shape as deegree Geometry
Throws:
ShapeGeometryException - if the deegree geometry could not be constructed
See Also:
Shape.getGeometry()

toString

public String toString()
Overrides:
toString in class Object

deegree 2.2 (2008/12/22 11:33 build-3038-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net