org.deegree_impl.io.bnaapi
Class BNAGeometry

java.lang.Object
  extended byorg.deegree_impl.io.bnaapi.BNAGeometry

public class BNAGeometry
extends java.lang.Object

A BNA geometry is a point or an ordered sequence of points. Points are stored as GM_Positions. Ordered sequence can be a ring if the last point has the same coords of the first one. If a ring has _bLine = false, then it's a surface, else it's a polygon.

Version:
2003.08.04
Author:
Emanuele Tajariol

Field Summary
private  boolean _bLine
          Tells if it's a polygon or a surface
private  double _maxX
           
private  double _maxY
           
private  double _minX
           
private  double _minY
           
private  java.util.Vector _points
          The sequence of points
 
Constructor Summary
protected BNAGeometry()
          Construct a surface or a point
protected BNAGeometry(boolean isLine)
          Constructor
 
Method Summary
 void addPoint(GM_Position point)
          Adds a new point and recompute the envelope
 GM_Envelope getEnvelope()
           
 GM_Position getPoint(int index)
           
 GM_Position[] getPoints()
           
 boolean isLine()
           
 boolean isPoint()
           
 boolean isPoly()
           
 boolean isSurface()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_points

private java.util.Vector _points
The sequence of points


_bLine

private boolean _bLine
Tells if it's a polygon or a surface


_maxX

private double _maxX

_maxY

private double _maxY

_minX

private double _minX

_minY

private double _minY
Constructor Detail

BNAGeometry

protected BNAGeometry(boolean isLine)
Constructor

Parameters:
isLine - a boolean telling if this is a line or a surface.

BNAGeometry

protected BNAGeometry()
Construct a surface or a point

Method Detail

size

public int size()
Returns:
the number of point of this geometry

getPoint

public GM_Position getPoint(int index)
Returns:
the index-th point

getPoints

public GM_Position[] getPoints()
Returns:
this geometry as a GM_Position[]

addPoint

public void addPoint(GM_Position point)
Adds a new point and recompute the envelope


getEnvelope

public GM_Envelope getEnvelope()
Returns:

isSurface

public boolean isSurface()
Returns:
a boolean telling if this geometry is a surface.

isPoint

public boolean isPoint()
Returns:
a boolean telling if this geometry is a point.

isPoly

public boolean isPoly()
Returns:
a boolean telling if this geometry is a closed line.

isLine

public boolean isLine()
Returns:
a boolean telling if this geometry is an open line.