com.moximedia.ows.geom
Class Points

java.lang.Object
  extended bycom.moximedia.ows.geom.Points
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Points
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Author:
jdc
See Also:
Serialized Form

Constructor Summary
Points()
          Creates new Points
Points(com.vividsolutions.jts.geom.Point[] points)
          Creates a new Points object from a com.vividsolutions.jts.geom.Point array.
Points(java.lang.String commaSeparatedPoints)
          Creates a new Points collection from a string of x,y values that are separated by commas between the x and y values and the other coordinates (e.g.
 
Method Summary
 boolean add(int index, Point pt)
           
 void add(Point pt)
           
 boolean addVertexToSegmentAtDistance(Point pt, double segmentDistance)
           
 void clear()
           
 java.lang.Object clone()
          Creates a clone of this object.
 void close()
           
 Point get(int index)
           
 Point getClosestPointTo(Point pt)
          Returns the point in the points list that is closest to the specified point.
 Points getCopy()
          Creates a copy of this object.
 double getDistanceToClosestLineSegment(Point pt)
          Returns the distance from the specified point to the closest segment of the line defined between a pair of points in the points object.
 Envelope getExtent()
          Returns the extent of the points list, or null if the list has no points.
 boolean hasPoint(Point pt)
           
 boolean isClockwise()
          Returns whether the points list is clockwise.
 java.util.Iterator iterator()
           
 Points project(Projection projection)
           
 Points project(Projection fromProjection, Projection toProjection)
           
 Point remove(int index)
           
 boolean remove(Point pt, boolean isLineString)
          Removes a point from the array.
 Point replace(int index, Point pt)
           
 void reverse()
          Reverses the points in the points list
 void setClockwise()
          Sets the points list to clockwise.
 void setCoordinates(java.lang.String coordinates)
           
 void setCounterClockwise()
          Sets the points list to counterclockwise.
 void setXmlAttribute(java.lang.String element, java.lang.String name, java.lang.String value)
           
 int size()
           
 Point[] toArray()
           
 java.lang.String toGmlCoordinatesString()
           
 java.lang.String toGmlCoordString()
           
 java.lang.String toGmlLinearRingString()
           
 java.lang.String toGmlLineStringString()
           
 java.lang.String toGmlLineStringString(java.lang.String srs)
           
 com.vividsolutions.jts.geom.Coordinate[] toJtsCoordinateArray()
          Returns this object as a com.vividsolutions.jts.geom.Coordinate array.
 com.vividsolutions.jts.geom.LinearRing toJtsLinearRing()
          Returns this object as a com.vividsolutions.jts.geom.LinearRing
 com.vividsolutions.jts.geom.Geometry toJtsLineString()
          Returns this object as a com.vividsolutions.jts.geom.LineString
 com.vividsolutions.jts.geom.Geometry toJtsMultiPoint()
          Returns this object as a com.vividsolutions.jts.geom.MultiPoint
 com.vividsolutions.jts.geom.Point[] toJtsPointArray()
          Returns this object as a com.vividsolutions.jts.geom.Point array.
 java.util.ArrayList toLineSegments()
          Returns the points array as an ArrayList of java.awt.geom.Line2D.Double objects representing the line segments between points.
 Points unproject(Projection projection)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Points

public Points()
Creates new Points


Points

public Points(java.lang.String commaSeparatedPoints)
Creates a new Points collection from a string of x,y values that are separated by commas between the x and y values and the other coordinates (e.g. "0,0,100,100").

Parameters:
commaSeparatedPoints - The string containing coordinates.

Points

public Points(com.vividsolutions.jts.geom.Point[] points)
Creates a new Points object from a com.vividsolutions.jts.geom.Point array.

Parameters:
points - A com.vividsolutions.jts.geom.Point array.
Method Detail

add

public void add(Point pt)

add

public boolean add(int index,
                   Point pt)

clear

public void clear()

clone

public java.lang.Object clone()
Creates a clone of this object. Must be cast back to the correct object type before using.

Returns:
The clone of this object.

getCopy

public Points getCopy()
Creates a copy of this object.

Returns:
The copy of this object.

close

public void close()

get

public Point get(int index)

getExtent

public Envelope getExtent()
Returns the extent of the points list, or null if the list has no points.

Returns:
An Envelope containing the extent.

isClockwise

public boolean isClockwise()
Returns whether the points list is clockwise.

Returns:
True if the list is clockwise, otherwise false.

iterator

public java.util.Iterator iterator()

remove

public Point remove(int index)

replace

public Point replace(int index,
                     Point pt)

reverse

public void reverse()
Reverses the points in the points list


setCounterClockwise

public void setCounterClockwise()
Sets the points list to counterclockwise.


setClockwise

public void setClockwise()
Sets the points list to clockwise.


size

public int size()

toArray

public Point[] toArray()

toJtsCoordinateArray

public com.vividsolutions.jts.geom.Coordinate[] toJtsCoordinateArray()
Returns this object as a com.vividsolutions.jts.geom.Coordinate array.

Returns:
A com.vividsolutions.jts.geom.Coordinate array.

toJtsPointArray

public com.vividsolutions.jts.geom.Point[] toJtsPointArray()
Returns this object as a com.vividsolutions.jts.geom.Point array.

Returns:
A com.vividsolutions.jts.geom.Point array.

toJtsLinearRing

public com.vividsolutions.jts.geom.LinearRing toJtsLinearRing()
Returns this object as a com.vividsolutions.jts.geom.LinearRing

Returns:
A com.vividsolutions.jts.geom.LinearRing

toJtsLineString

public com.vividsolutions.jts.geom.Geometry toJtsLineString()
Returns this object as a com.vividsolutions.jts.geom.LineString

Returns:
A com.vividsolutions.jts.geom.LineString

toJtsMultiPoint

public com.vividsolutions.jts.geom.Geometry toJtsMultiPoint()
Returns this object as a com.vividsolutions.jts.geom.MultiPoint

Returns:
A com.vividsolutions.jts.geom.MultiPoint

toGmlLinearRingString

public java.lang.String toGmlLinearRingString()

toGmlLineStringString

public java.lang.String toGmlLineStringString()

toGmlLineStringString

public java.lang.String toGmlLineStringString(java.lang.String srs)

toGmlCoordString

public java.lang.String toGmlCoordString()

toGmlCoordinatesString

public java.lang.String toGmlCoordinatesString()

setCoordinates

public void setCoordinates(java.lang.String coordinates)

setXmlAttribute

public void setXmlAttribute(java.lang.String element,
                            java.lang.String name,
                            java.lang.String value)

project

public Points project(Projection projection)

project

public Points project(Projection fromProjection,
                      Projection toProjection)

unproject

public Points unproject(Projection projection)

getClosestPointTo

public Point getClosestPointTo(Point pt)
Returns the point in the points list that is closest to the specified point.

Parameters:
pt - The point used in the search.
Returns:
The closest point, or null if there are no points in the points list.

getDistanceToClosestLineSegment

public double getDistanceToClosestLineSegment(Point pt)
Returns the distance from the specified point to the closest segment of the line defined between a pair of points in the points object.

Parameters:
pt - The point to measure from.
Returns:
The distance.

toLineSegments

public java.util.ArrayList toLineSegments()
Returns the points array as an ArrayList of java.awt.geom.Line2D.Double objects representing the line segments between points.

Returns:
A vector of ava.awt.geom.Line2D.Double objects.

addVertexToSegmentAtDistance

public boolean addVertexToSegmentAtDistance(Point pt,
                                            double segmentDistance)

remove

public boolean remove(Point pt,
                      boolean isLineString)
Removes a point from the array. If the linestring flag is true, removing the first or last points will result in a polygon that still closes.

Parameters:
pt - The point to remove,
Returns:
True if the point is removed, otherwise false.

hasPoint

public boolean hasPoint(Point pt)


Internet Mapping Framework for OpenGIS Java Object Model API (v1.3.007)
Copyright © 2005 Moxi Media Inc. and Province of British Columbia. All Rights Reserved.