deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.shpapi.shape_new
Class ShapeEnvelope

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

public class ShapeEnvelope
extends java.lang.Object
implements Shape

ShapeEnvelope encapsulates a shapefile envelope.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Andreas Schmitz, last edited by: $Author: mschneider $

Field Summary
 double mmax
          The maximum m value.
 double mmin
          The minimum m value.
 double xmax
          The maximum x value.
 double xmin
          The minimum x value.
 double ymax
          The maximum y value.
 double ymin
          The minimum y value.
 double zmax
          The maximum z value.
 double zmin
          The minimum z value.
 
Constructor Summary
ShapeEnvelope(boolean z, boolean m)
          Creates a new envelope, with/out z and m dimensions as specified.
ShapeEnvelope(Envelope env)
          Construct one from deegree Envelope.
ShapeEnvelope(ShapeEnvelope s)
          Copy constructor.
 
Method Summary
 void extend(double m_min, double m_max)
          Extends this envelope to m direction.
 void extend(double z_min, double z_max, double m_min, double m_max)
          Extends this envelope to z and m direction.
 void fit(double x, double y)
          Extends the envelope so the given point fits in.
 void fit(double x, double y, double z)
          Extends the envelope so the given point fits in.
 void fit(ShapeEnvelope s)
          Extends the envelope so the given envelope fits in.
 int getByteLength()
           
 ShapeEnvelope getEnvelope()
           
 Geometry getGeometry()
           
 int getType()
           
 int read(byte[] bytes, int offset)
          Reads only x and y values.
 java.lang.String toString()
           
 int write(byte[] bytes, int offset)
          Writes only x and y values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xmin

public double xmin
The minimum x value.


xmax

public double xmax
The maximum x value.


ymin

public double ymin
The minimum y value.


ymax

public double ymax
The maximum y value.


zmin

public double zmin
The minimum z value.


zmax

public double zmax
The maximum z value.


mmin

public double mmin
The minimum m value.


mmax

public double mmax
The maximum m value.

Constructor Detail

ShapeEnvelope

public ShapeEnvelope(ShapeEnvelope s)
Copy constructor. Better to do with clone()?

Parameters:
s -

ShapeEnvelope

public ShapeEnvelope(boolean z,
                     boolean m)
Creates a new envelope, with/out z and m dimensions as specified.

Parameters:
z -
m -

ShapeEnvelope

public ShapeEnvelope(Envelope env)
Construct one from deegree Envelope.

Parameters:
env -
Method Detail

extend

public void extend(double z_min,
                   double z_max,
                   double m_min,
                   double m_max)
Extends this envelope to z and m direction.

Parameters:
z_min -
z_max -
m_min -
m_max -

extend

public void extend(double m_min,
                   double m_max)
Extends this envelope to m direction.

Parameters:
m_min -
m_max -

fit

public void fit(double x,
                double y)
Extends the envelope so the given point fits in.

Parameters:
x -
y -

fit

public void fit(double x,
                double y,
                double z)
Extends the envelope so the given point fits in.

Parameters:
x -
y -
z -

fit

public void fit(ShapeEnvelope s)
Extends the envelope so the given envelope fits in.

Parameters:
s -

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)
Reads only x and y values.

Specified by:
read in interface Shape
offset - where to start reading
Returns:
the new offset or -1, if the type was wrong.
See Also:
Shape.read(byte[], int)

write

public int write(byte[] bytes,
                 int offset)
Writes only x and y values.

Specified by:
write in interface Shape
Returns:
the new offset.
See Also:
Shape.write(byte[], int)

getType

public int getType()
Specified by:
getType in interface Shape
Returns:
zero, because the envelope does not have a type
See Also:
Shape.getType()

getEnvelope

public ShapeEnvelope getEnvelope()
Specified by:
getEnvelope in interface Shape
Returns:
itself, of course
See Also:
Shape.getEnvelope()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getGeometry

public Geometry getGeometry()
Specified by:
getGeometry in interface Shape
Returns:
null, because an envelope is not a geometry
See Also:
Shape.getGeometry()

deegree 2.5 (2011/06/29 09:44 build-8-official)

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