public class Point2D extends AbstractPrimitive implements Point, DirectPosition
Geometry.DIMENSIONS, Geometry.OPERATIONS, Geometry.SUBTYPES, Geometry.TYPES, Geometry.ValidationStatus
Modifier and Type | Field and Description |
---|---|
protected static String |
COORDINATES_FIELD |
protected double |
x |
protected double |
y |
geometryType, geomManager, id, logger, projection
BEST, E, EXTENDED_GEOMSUBTYPE_OFFSET, EXTENDED_GEOMTYPE_OFFSET, N, NE, NW, S, SE, SELECTHANDLER, STRETCHINGHANDLER, SW, W
Constructor and Description |
---|
Point2D(double x,
double y) |
Point2D(GeometryType geometryType)
The constructor with the GeometryType like and argument
is used by the
GeometryType #create() to create the
geometry |
Point2D(GeometryType geometryType,
double x,
double y) |
Point2D(int type,
int subtype) |
Point2D(Point2D point) |
Modifier and Type | Method and Description |
---|---|
FShape |
cloneFShape()
Creates and returns a shape equal and independent of this one.
|
boolean |
contains(double x,
double y) |
boolean |
contains(double x,
double y,
double w,
double h) |
boolean |
contains(Point2D p) |
boolean |
contains(Rectangle2D r) |
boolean |
equals(Object other) |
Rectangle |
getBounds() |
Rectangle2D |
getBounds2D()
Returns this geometry's boundary rectangle.
|
double |
getCoordinateAt(int dimension)
Gets the coordinate in a concrete dimension
|
double[] |
getCoordinates()
Returns an array of coordinates.
|
int |
getDimension()
Returns the largest number n such that each direct position in a
geometric set can be associated with a subset that has the direct
position in its interior and is similar (isomorphic) to Rn, Euclidean
n-space.
|
DirectPosition |
getDirectPosition()
Gets the
of a point , that is
composed by a set of ordinates |
Envelope |
getEnvelope()
Returns the minimum bounding box for this Geometry.
|
protected String |
getFullTypeName() |
GeneralPathX |
getGeneralPath()
Get GeneralPathIterator, to do registered operations to it.
|
double |
getOrdinate(int dim)
Returns the ordinate of the given dimension.
|
PathIterator |
getPathIterator(AffineTransform at)
If applies an affine transformation and returns the GeneralPathXIterator
with this geometry's information.
|
PathIterator |
getPathIterator(AffineTransform at,
double flatness)
If applies an affine transformation and returns the GeneralPathXIterator
with this geometry's information.
|
Handler[] |
getSelectHandlers()
Returns the handlers used to select the geometries.
|
Shape |
getShape(AffineTransform affineTransform) |
int |
getShapeType()
Gets the geometry type of this shape.
|
Handler[] |
getStretchingHandlers()
Returns the handlers they utilized to stretch the geometries.
|
int |
getType()
If this geometry is a predefined interface then this method returns one
of
Geometry.TYPES contants. |
double |
getX()
Returns the X coordinate
|
double |
getY()
Returns the Y coordinate
|
boolean |
intersects(double x,
double y,
double w,
double h) |
boolean |
intersects(Rectangle2D r)
Returns true if this geometry intersects the rectangle passed as
parameter.
|
void |
reProject(ICoordTrans ct)
Reprojects this geometry by the coordinate transformer passed as
parameter.
|
void |
setCoordinateAt(int dimension,
double value)
Sets a ordinate in a concrete dimension
|
void |
setCoordinates(double[] values)
Sets the point coordinates
|
void |
setX(double x)
Sets the X coordinate
|
void |
setY(double y)
Sets the Y coordinate
|
MultiPoint |
toPoints()
Converts the geometry to be points and makes with them a multiPoint
|
String |
toString() |
void |
transform(AffineTransform at)
Aplica la transformaciónn de la matriz de transformación que se pasa como
parámetro.
|
area, buffer, centroid, cloneGeometry, closestPoints, compareTo, contains, containsPoint, containsRectangle, convertToWKB, convertToWKB, convertToWKBForcingType, convertToWKT, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, fastIntersects, getGeometryType, getHandlers, getId, getInteriorPoint, getInternalShape, getShape, getSRS, getValidationStatus, intersection, intersects, intersectsRectangle, invokeOperation, invokeOperation, isCCW, isSimple, isValid, isWithinDistance, makeValid, move, overlaps, perimeter, rotate, scale, snapTo, toJTS, touches, transform, union, within
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
area, buffer, centroid, cloneGeometry, closestPoints, contains, convertToEWKB, convertToEWKB, convertToEWKBForcingType, convertToWKB, convertToWKB, convertToWKBForcingType, convertToWKT, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, ensureOrientation, fastIntersects, flip, getGeometryType, getHandlers, getInteriorPoint, getInternalShape, getShape, getValidationStatus, intersection, intersects, invokeOperation, invokeOperation, isCCW, isSimple, isValid, isWithinDistance, makeValid, move, offset, out, overlaps, perimeter, rotate, scale, snapTo, toLines, toPolygons, touches, union, within
compareTo
protected static final String COORDINATES_FIELD
protected double x
protected double y
public Point2D(GeometryType geometryType)
GeometryType
#create()
to create the
geometrytype
- The geometry typepublic Point2D(double x, double y)
public Point2D(GeometryType geometryType, double x, double y)
public Point2D(int type, int subtype)
public Point2D(Point2D point)
public void transform(AffineTransform at)
transform
in interface FShape
transform
in interface Geometry
at
- Matriz de transformación.AffineTransform
public boolean contains(double x, double y, double w, double h)
public boolean intersects(double x, double y, double w, double h)
intersects
in interface Shape
public double getX()
Point
public double getY()
Point
public Rectangle2D getBounds2D()
Geometry
getBounds2D
in interface Shape
getBounds2D
in interface Geometry
public boolean contains(Rectangle2D r)
public boolean intersects(Rectangle2D r)
Geometry
intersects
in interface Shape
intersects
in interface Geometry
r
- Rectangle.this
intersects r
.public Shape getShape(AffineTransform affineTransform)
getShape
in interface Geometry
getShape
in class AbstractPrimitive
public PathIterator getPathIterator(AffineTransform at)
Geometry
getPathIterator
in interface Shape
getPathIterator
in interface Geometry
at
- The transformation to apply.public PathIterator getPathIterator(AffineTransform at, double flatness)
Geometry
getPathIterator
in interface Shape
getPathIterator
in interface Geometry
at
- The affine transformation.public int getShapeType()
FShape
getShapeType
in interface FShape
getShapeType
in class AbstractPrimitive
public FShape cloneFShape()
FShape
cloneFShape
in interface FShape
public void reProject(ICoordTrans ct)
Geometry
public Handler[] getStretchingHandlers()
FShape
getStretchingHandlers
in interface FShape
public Handler[] getSelectHandlers()
FShape
getSelectHandlers
in interface FShape
public int getDimension()
Geometry
getDimension
in interface DirectPosition
getDimension
in interface Geometry
public Envelope getEnvelope()
Geometry
Returns the minimum bounding box for this Geometry. This shall be the coordinate region spanning the minimum and maximum value for each ordinate taken on by DirectPositions in this Geometry. The simplest representation for an envelope consists of two DirectPositions, the first one containing all the minimums for each ordinate, and second one containing all the maximums.
getEnvelope
in interface Geometry
public GeneralPathX getGeneralPath()
Geometry
getGeneralPath
in interface Geometry
public DirectPosition getDirectPosition()
Point
of a point
, that is
composed by a set of ordinatesgetDirectPosition
in interface Point
public double getOrdinate(int dim)
DirectPosition
getOrdinate
in interface DirectPosition
dim
- The dimension to retrievepublic boolean equals(Object other)
equals
in class AbstractPrimitive
public double[] getCoordinates()
Point
#setCoordinateAt(int, double))
, #setX(double))
or #setY(double))
methods instead.getCoordinates
in interface Point
public double getCoordinateAt(int dimension)
Point
getCoordinateAt
in interface Point
dimension
- The ordinate dimensionpublic void setCoordinateAt(int dimension, double value)
Point
setCoordinateAt
in interface Point
dimension
- The dimension to setvalue
- The value to setpublic void setCoordinates(double[] values)
Point
setCoordinates
in interface Point
public void setX(double x)
Point
public void setY(double y)
Point
public String toString()
toString
in class AbstractPrimitive
protected String getFullTypeName()
public int getType()
Geometry
Geometry.TYPES
contants.getType
in interface Geometry
getType
in class AbstractPrimitive
Geometry.TYPES
or a runtime constant if it is an extended
type.public MultiPoint toPoints() throws GeometryException
Geometry
toPoints
in interface Geometry
GeometryException