public class JtsPoint extends BaseShape<JtsSpatialContext> implements Point
Point.| Constructor and Description |
|---|
JtsPoint(org.locationtech.jts.geom.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.
|
org.locationtech.jts.geom.Point |
getGeom() |
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() |
getContextclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContextpublic JtsPoint(org.locationtech.jts.geom.Point pointGeom,
JtsSpatialContext ctx)
public org.locationtech.jts.geom.Point getGeom()
public boolean isEmpty()
Shapepublic Point getCenter()
ShapegetBoundingBox().getCenter() but it doesn't have to be.
Postcondition: this.relate(this.getCenter()) == CONTAINS
public boolean hasArea()
Shapepublic double getArea(SpatialContext ctx)
Shapepublic Rectangle getBoundingBox()
Shape
Postcondition: this.getBoundingBox().relate(this) == CONTAINS
getBoundingBox in interface Shapepublic Circle getBuffered(double distance, SpatialContext ctx)
ShapegetBuffered in interface Shapepublic SpatialRelation relate(Shape other)
ShapeIf the shapes are equal then the result is CONTAINS (preferred) or WITHIN.
public double getX()
Pointpublic double getY()
Pointpublic void reset(double x,
double y)
Pointpublic boolean equals(Object o)
ShapeObject.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 © 2025 LocationTech. All rights reserved.