org.deegree.geometry.standard.points
Class JTSPoints

java.lang.Object
  extended by org.deegree.geometry.standard.points.JTSPoints
All Implemented Interfaces:
com.vividsolutions.jts.geom.CoordinateSequence, Cloneable, Iterable<Point>, Points

public class JTSPoints
extends Object
implements Points

Points implementation based on a JTS coordinate sequence.

This implementation is useful when JTS geometries have to converted into Geometry objects.

Version:
$Revision: 31641 $, $Date: 2011-08-24 21:24:55 +0200 (Wed, 24 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from interface com.vividsolutions.jts.geom.CoordinateSequence
M, X, Y, Z
 
Constructor Summary
JTSPoints(ICRS crs, com.vividsolutions.jts.geom.CoordinateSequence seq)
           
 
Method Summary
 Object clone()
           
 com.vividsolutions.jts.geom.Envelope expandEnvelope(com.vividsolutions.jts.geom.Envelope env)
           
 Point get(int i)
          Provides acccess to an arbitrary Point in the sequence (expensive!).
 double[] getAsArray()
          Returns all coordinates of the contained Points as an array.
 com.vividsolutions.jts.geom.Coordinate getCoordinate(int index)
           
 void getCoordinate(int index, com.vividsolutions.jts.geom.Coordinate coord)
           
 com.vividsolutions.jts.geom.Coordinate getCoordinateCopy(int index)
           
 int getDimension()
          Returns the coordinate dimension, i.e. the dimension of the space that the points are embedded in.
 Point getEndPoint()
          Returns the last point of the sequence.
 double getOrdinate(int index, int ordinateIndex)
           
 Point getStartPoint()
          Returns the first point of the sequence.
 double getX(int index)
           
 double getY(int index)
           
 Iterator<Point> iterator()
           
 void setOrdinate(int index, int ordinateIndex, double value)
           
 int size()
          Returns the number of represented Points.
 com.vividsolutions.jts.geom.Coordinate[] toCoordinateArray()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTSPoints

public JTSPoints(ICRS crs,
                 com.vividsolutions.jts.geom.CoordinateSequence seq)
Method Detail

getDimension

public int getDimension()
Description copied from interface: Points
Returns the coordinate dimension, i.e. the dimension of the space that the points are embedded in.

Specified by:
getDimension in interface com.vividsolutions.jts.geom.CoordinateSequence
Specified by:
getDimension in interface Points
Returns:
the coordinate dimension

size

public int size()
Description copied from interface: Points
Returns the number of represented Points.

Specified by:
size in interface com.vividsolutions.jts.geom.CoordinateSequence
Specified by:
size in interface Points
Returns:
the number of points

get

public Point get(int i)
Provides acccess to an arbitrary Point in the sequence (expensive!).

Specified by:
get in interface Points
Returns:
the point at the specified position

iterator

public Iterator<Point> iterator()
Specified by:
iterator in interface Iterable<Point>

getAsArray

public double[] getAsArray()
Description copied from interface: Points
Returns all coordinates of the contained Points as an array.

NOTE: This method should be avoided, as it may involve expensive operations.

Specified by:
getAsArray in interface Points
Returns:
coordinates as a one-dimensional array

getEndPoint

public Point getEndPoint()
Description copied from interface: Points
Returns the last point of the sequence.

Specified by:
getEndPoint in interface Points
Returns:
the last point

getStartPoint

public Point getStartPoint()
Description copied from interface: Points
Returns the first point of the sequence.

Specified by:
getStartPoint in interface Points
Returns:
the first point

expandEnvelope

public com.vividsolutions.jts.geom.Envelope expandEnvelope(com.vividsolutions.jts.geom.Envelope env)
Specified by:
expandEnvelope in interface com.vividsolutions.jts.geom.CoordinateSequence

getCoordinate

public com.vividsolutions.jts.geom.Coordinate getCoordinate(int index)
Specified by:
getCoordinate in interface com.vividsolutions.jts.geom.CoordinateSequence

getCoordinate

public void getCoordinate(int index,
                          com.vividsolutions.jts.geom.Coordinate coord)
Specified by:
getCoordinate in interface com.vividsolutions.jts.geom.CoordinateSequence

getCoordinateCopy

public com.vividsolutions.jts.geom.Coordinate getCoordinateCopy(int index)
Specified by:
getCoordinateCopy in interface com.vividsolutions.jts.geom.CoordinateSequence

getOrdinate

public double getOrdinate(int index,
                          int ordinateIndex)
Specified by:
getOrdinate in interface com.vividsolutions.jts.geom.CoordinateSequence

getX

public double getX(int index)
Specified by:
getX in interface com.vividsolutions.jts.geom.CoordinateSequence

getY

public double getY(int index)
Specified by:
getY in interface com.vividsolutions.jts.geom.CoordinateSequence

setOrdinate

public void setOrdinate(int index,
                        int ordinateIndex,
                        double value)
Specified by:
setOrdinate in interface com.vividsolutions.jts.geom.CoordinateSequence

toCoordinateArray

public com.vividsolutions.jts.geom.Coordinate[] toCoordinateArray()
Specified by:
toCoordinateArray in interface com.vividsolutions.jts.geom.CoordinateSequence

clone

public Object clone()
Specified by:
clone in interface com.vividsolutions.jts.geom.CoordinateSequence
Overrides:
clone in class Object


Copyright © 2011. All Rights Reserved.