com.moximedia.ows.geom
Class Point

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

public class Point
extends java.lang.Object
implements Geometry, GeometryType, java.lang.Cloneable, java.io.Serializable

Author:
jdc
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.moximedia.ows.types.GeometryType
GEOMETRY_TYPE_COLLECTION, GEOMETRY_TYPE_ENVELOPE, GEOMETRY_TYPE_LINE, GEOMETRY_TYPE_MULTILINE, GEOMETRY_TYPE_MULTIPOINT, GEOMETRY_TYPE_MULTIPOLYGON, GEOMETRY_TYPE_POINT, GEOMETRY_TYPE_POLYGON, GEOMETRY_TYPE_UNKNOWN
 
Constructor Summary
Point()
           
Point(double x, double y)
           
Point(java.lang.String xy)
           
Point(java.lang.String xy, java.lang.String cs)
           
 
Method Summary
 Polygon buffer(double distance)
           
 java.lang.Object clone()
          Creates a clone of this object.
 boolean equals(Point anotherPt)
           
 double getAngleTo(Point pt)
          Returns the trigonometric angle to another point.
 Point getClosestPointTo(Point pt)
          Gets the closest vertex in this object to the specified point.
 Point getCopy()
          Creates a copy of this object.
 double getDistanceTo(Point pt)
          Returns the distance between two points.
 Envelope getExtent()
           
 int getGeometryType()
          Returns the geometry type of this geometry.
 java.lang.String getGid()
           
 double getX()
           
 double getY()
           
 boolean intersects(Geometry geometry)
           
 boolean isGeometryType(int geometryType)
          Compares a geometry type with another value.
 boolean isValid()
          Returns an indicator of whether this shape is valid.
 Geometry project(Projection projection)
           
 Geometry project(Projection fromProjection, Projection toProjection)
           
 void setLocation(java.lang.String xy)
           
 void setLocation(java.lang.String xy, java.lang.String cs)
           
 void setSrs(java.lang.String srs)
           
 void setX(double x)
           
 void setX(java.lang.String x)
           
 void setXmlAttribute(java.lang.String element, java.lang.String name, java.lang.String value)
           
 void setY(double y)
           
 void setY(java.lang.String y)
           
 java.lang.String toCommaSeparatedString()
          Returns a text representation of of this object.
 java.lang.String toGmlCoordString()
          Returns the GML text string representing this point.
 java.lang.String toGmlString()
          Returns the GML text string representing this point.
 com.vividsolutions.jts.geom.Coordinate toJtsCoordinate()
          Returns this object as a JTS Coordinate
 com.vividsolutions.jts.geom.Geometry toJtsGeometry()
          Returns this object as a JTS Geometry
 com.vividsolutions.jts.geom.Point toJtsPoint()
          Returns this object as a JTS Point
 java.awt.geom.Point2D.Double toPoint2D()
           
 java.lang.String toString()
          Returns a text representation of of this object.
 java.lang.String toWktString()
          Returns the well known string representation of this object.
 Geometry unproject(Projection projection)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Point

public Point()

Point

public Point(double x,
             double y)

Point

public Point(java.lang.String xy)

Point

public Point(java.lang.String xy,
             java.lang.String cs)
Method Detail

clone

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

Specified by:
clone in interface Geometry
Returns:
The clone of this object.

getCopy

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

Returns:
The copy of this object.

equals

public boolean equals(Point anotherPt)

getAngleTo

public double getAngleTo(Point pt)
Returns the trigonometric angle to another point.

Parameters:
pt - The other point.
Returns:
The angle from this point to the other point in degrees.

getDistanceTo

public double getDistanceTo(Point pt)
Returns the distance between two points.

Parameters:
pt - The other point.
Returns:
the distance between the two points.

getExtent

public Envelope getExtent()
Specified by:
getExtent in interface Geometry

getGeometryType

public int getGeometryType()
Returns the geometry type of this geometry.

Specified by:
getGeometryType in interface Geometry
Returns:
The geometry type of this geometry.

intersects

public boolean intersects(Geometry geometry)
Specified by:
intersects in interface Geometry

isGeometryType

public boolean isGeometryType(int geometryType)
Compares a geometry type with another value.

Specified by:
isGeometryType in interface Geometry
Parameters:
geometryType - An enumerated value.
Returns:
True if the type of this geometry is the same, otherwise false.

getGid

public java.lang.String getGid()

setLocation

public void setLocation(java.lang.String xy)

setLocation

public void setLocation(java.lang.String xy,
                        java.lang.String cs)

getX

public double getX()

getY

public double getY()

setX

public void setX(double x)

setX

public void setX(java.lang.String x)

setY

public void setY(double y)

setY

public void setY(java.lang.String y)

setXmlAttribute

public void setXmlAttribute(java.lang.String element,
                            java.lang.String name,
                            java.lang.String value)
Specified by:
setXmlAttribute in interface Geometry

toCommaSeparatedString

public java.lang.String toCommaSeparatedString()
Returns a text representation of of this object.

Returns:
A string describing the object

toGmlCoordString

public java.lang.String toGmlCoordString()
Returns the GML text string representing this point.

Returns:
The GML text string representing this point.

toGmlString

public java.lang.String toGmlString()
Returns the GML text string representing this point.

Specified by:
toGmlString in interface Geometry
Returns:
The GML text string representing this point.

toJtsCoordinate

public com.vividsolutions.jts.geom.Coordinate toJtsCoordinate()
Returns this object as a JTS Coordinate

Returns:
A JTS Coordinate representing this shape.

toJtsGeometry

public com.vividsolutions.jts.geom.Geometry toJtsGeometry()
Returns this object as a JTS Geometry

Specified by:
toJtsGeometry in interface Geometry
Returns:
A JTS Geometry representing this shape.

toJtsPoint

public com.vividsolutions.jts.geom.Point toJtsPoint()
Returns this object as a JTS Point

Returns:
A JTS Coordinate representing this shape.

toPoint2D

public java.awt.geom.Point2D.Double toPoint2D()

toString

public java.lang.String toString()
Returns a text representation of of this object.

Returns:
A string describing the object

project

public Geometry project(Projection fromProjection,
                        Projection toProjection)
Specified by:
project in interface Geometry

project

public Geometry project(Projection projection)
Specified by:
project in interface Geometry

setSrs

public void setSrs(java.lang.String srs)
Specified by:
setSrs in interface Geometry

unproject

public Geometry unproject(Projection projection)
Specified by:
unproject in interface Geometry

isValid

public boolean isValid()
Returns an indicator of whether this shape is valid.

Specified by:
isValid in interface Geometry
Returns:
True if this shape is valid, otherwise false.

buffer

public Polygon buffer(double distance)

getClosestPointTo

public Point getClosestPointTo(Point pt)
Gets the closest vertex in this object to the specified point.

Specified by:
getClosestPointTo in interface Geometry
Parameters:
pt - The point to compare the vertexes to.
Returns:
The closest vertex to the specified point, or null if there are no points in this object.

toWktString

public java.lang.String toWktString()
Returns the well known string representation of this object.

Specified by:
toWktString in interface Geometry
Returns:
The well known text.


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.