Constructor and Description |
---|
JtsPoint(Point pointGeom,
JtsSpatialContext ctx)
A simple constructor without normalization / validation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
The sub-classes of Shape generally implement the
same contract for
Object.equals(Object) and Object.hashCode()
amongst the same sub-interface type. |
double |
getArea(SpatialContext ctx)
Calculates the area of the shape, in square-degrees.
|
Rectangle |
getBoundingBox()
Get the bounding box for this Shape.
|
Circle |
getBuffered(double distance,
SpatialContext ctx)
Returns a buffered version of this shape.
|
Point |
getCenter()
Returns the center point of this shape.
|
Point |
getGeom() |
double |
getLat()
Convenience method that usually maps on
Point.getY() |
double |
getLon()
Convenience method that usually maps on
Point.getX() |
double |
getX()
The X coordinate, or Longitude in geospatial contexts.
|
double |
getY()
The Y coordinate, or Latitude in geospatial contexts.
|
boolean |
hasArea()
Does the shape have area? This will be false for points and lines.
|
int |
hashCode() |
boolean |
isEmpty()
Shapes can be "empty", which is to say it exists nowhere.
|
SpatialRelation |
relate(Shape other)
Describe the relationship between the two objects.
|
void |
reset(double x,
double y)
Expert: Resets the state of this shape given the arguments.
|
String |
toString() |
getContext
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getContext
public JtsPoint(Point pointGeom, JtsSpatialContext ctx)
public Point getGeom()
public boolean isEmpty()
Shape
public Point getCenter()
Shape
getBoundingBox().getCenter()
but it doesn't have to be.
Postcondition: this.relate(this.getCenter()) == CONTAINS
public boolean hasArea()
Shape
public double getArea(SpatialContext ctx)
Shape
public Rectangle getBoundingBox()
Shape
Postcondition: this.getBoundingBox().relate(this) == CONTAINS
getBoundingBox
in interface Shape
public Circle getBuffered(double distance, SpatialContext ctx)
Shape
getBuffered
in interface Shape
public SpatialRelation relate(Shape other)
Shape
If the shapes are equal then the result is CONTAINS (preferred) or WITHIN.
public double getX()
Point
public double getY()
Point
public double getLat()
Point
Point.getY()
public double getLon()
Point
Point.getX()
public void reset(double x, double y)
Point
public boolean equals(Object o)
Shape
Object.equals(Object)
and Object.hashCode()
amongst the same sub-interface type. This means, for example, that multiple
Point implementations of different classes are equal if they share the same x
& y.Copyright © 2020 LocationTech. All rights reserved.