|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.renderer.geom.Geometry org.geotools.renderer.geom.Point
A wrapper around a single JTS Coordinate object to adapt it to the the Geometry hierarchy.
Field Summary |
Fields inherited from class org.geotools.renderer.geom.Geometry |
DEFAULT_COORDINATE_SYSTEM |
Constructor Summary | |
Point(com.vividsolutions.jts.geom.Coordinate coord,
CoordinateSystem cs)
Creates a new instance of Point. |
|
Point(com.vividsolutions.jts.geom.Coordinate coord,
CoordinateTransformation ct)
Creates a new instance of Point |
Method Summary | |
float |
compress(CompressionLevel level)
Point compression is not supported as it makes no sense for points. |
boolean |
contains(java.awt.geom.Point2D p)
This method returns true if p has the same coordinates as
this object, false otherwise. |
boolean |
contains(java.awt.Shape shape)
This method returns true if the shape is another Point
object with the same coordinates, false otherwise. |
java.awt.geom.Rectangle2D |
getBounds2D()
Returns the bounds of this points, that is, an immutable and empty rectangle centered on the current coordinates. |
CoordinateSystem |
getCoordinateSystem()
Returns the polyline's coordinate system, or null if
unknown. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
Returns a path iterator for this point. |
int |
getPointCount()
Returns the number of coordinates contained in this geometry, as such, the result will always be 1 |
Statistics |
getResolution()
Implemented for compatibility, but it makes no sense to compute resolution for a single point |
float |
getX()
Returns the x coordinate of the point, projected to the new coordinate system if the user has specified an non identity CoordinateTransform |
float |
getY()
Returns the y coordinate of the point, projected to the new coordinate system if the user has specified an non identity CoordinateTransform |
boolean |
intersects(java.awt.Shape shape)
Returns true if the shape contains the point |
boolean |
isFrozen()
Always returns false, the point will never be frozen |
void |
setCoordinateSystem(CoordinateSystem coordinateSystem)
Sets the polyline's coordinate system. |
void |
setResolution(double resolution)
Emtpy method, provided for compatibility with base class. |
Methods inherited from class org.geotools.renderer.geom.Geometry |
clip, clone, contains, contains, contains, equals, getBounds, getID, getName, getPathIterator, getRenderingResolution, getStyle, getUserObject, hashCode, intersects, intersects, isEmpty, setID, setRenderingResolution, setStyle, setUserObject, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Point(com.vividsolutions.jts.geom.Coordinate coord, CoordinateTransformation ct)
coord
- The point coordinatesct
- The coordinate transformation to be applied to the coordinates
(which are supposed to be unprojected)public Point(com.vividsolutions.jts.geom.Coordinate coord, CoordinateSystem cs)
coord
- The point coordinatescs
- The source coordinate system.Method Detail |
public float compress(CompressionLevel level)
compress
in class Geometry
level
- The compression level (or algorithm) to use. See the CompressionLevel
javadoc for an explanation of available
algorithms.
public boolean contains(java.awt.Shape shape)
Point
object with the same coordinates, false otherwise. The point's
coordinates must be expressed according to the current coordinate
system, that is getCoordinateSystem()
.
contains
in class Geometry
public boolean contains(java.awt.geom.Point2D p)
p
has the same coordinates as
this object, false otherwise. The point p
coordinates
must be expressed according to the current coordinate system, that is
getCoordinateSystem()
.
contains
in interface java.awt.Shape
contains
in class Geometry
p
- the specified point in this geometry coordinate system.
true
if the specified point is inside
the geometry boundary; false
otherwise.public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
getBounds2D
in class Geometry
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
getPathIterator
in interface java.awt.Shape
getPathIterator
in class Geometry
public int getPointCount()
getPointCount
in class Geometry
public Statistics getResolution()
getResolution
in class Geometry
null
if this geometry doesn't
contains any point. If non-null, the statistics object contains
minimum,
maximum,
mean,
root mean square and
standard deviation
always in linear units.public boolean intersects(java.awt.Shape shape)
intersects
in class Geometry
public void setResolution(double resolution) throws org.opengis.referencing.operation.TransformException, UnmodifiableGeometryException
setResolution
in class Geometry
resolution
- Desired resolution, in the same linear units than Geometry.getResolution()
.
UnmodifiableGeometryException
- if modifying this geometry would corrupt a container.
To avoid this exception, clone this geometry before to modify it.
org.opengis.referencing.operation.TransformException
- If some coordinate transformations were needed and failed.
There is no guaranteed on geometry's state in case of failure.public float getX()
public float getY()
public boolean isFrozen()
Geometry#isFrozen()
public CoordinateSystem getCoordinateSystem()
null
if
unknown.
getCoordinateSystem
in class Geometry
public void setCoordinateSystem(CoordinateSystem coordinateSystem) throws org.opengis.referencing.operation.TransformException, UnmodifiableGeometryException
setCoordinateSystem
in class Geometry
coordinateSystem
- The new coordinate system. A null
value resets the coordinate system given at construction time.
org.opengis.referencing.operation.TransformException
- If a transformation failed. In case of
failure, the state of this object will stay unchanged (as if
this method has never been invoked).
UnmodifiableGeometryException
- if modifying this geometry would
corrupt a container. To avoid this exception, this geometry before to modify it.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |