Package org.locationtech.spatial4j.shape
Interface Rectangle
-
- All Superinterfaces:
Shape
- All Known Implementing Classes:
RectangleImpl
public interface Rectangle extends Shape
A rectangle aligned with the axis (i.e. it is not at an angle).In geospatial contexts, it may cross the international date line (-180 longitude) if
getCrossesDateLine()
however it cannot pass the poles although it may span the globe. It spans the globe if the X coordinate (Longitude) goes from -180 to 180 as seen fromgetMinX()
andgetMaxX()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
getCrossesDateLine()
Only meaningful for geospatial contexts.double
getHeight()
The height.double
getMaxX()
The right edge of the X coordinate.double
getMaxY()
The top edge of the Y coordinate.double
getMinX()
The left edge of the X coordinate.double
getMinY()
The bottom edge of the Y coordinate.double
getWidth()
The width.SpatialRelation
relateXRange(double minX, double maxX)
A specialization ofShape.relate(Shape)
for a horizontal line.SpatialRelation
relateYRange(double minY, double maxY)
A specialization ofShape.relate(Shape)
for a vertical line.void
reset(double minX, double maxX, double minY, double maxY)
Expert: Resets the state of this shape given the arguments.-
Methods inherited from interface org.locationtech.spatial4j.shape.Shape
equals, getArea, getBoundingBox, getBuffered, getCenter, getContext, hasArea, isEmpty, relate
-
-
-
-
Method Detail
-
reset
void reset(double minX, double maxX, double minY, double maxY)
Expert: Resets the state of this shape given the arguments. This is a performance feature to avoid excessive Shape object allocation as well as some argument error checking. Mutable shapes is error-prone so use with care.
-
getWidth
double getWidth()
The width. In geospatial contexts, this is generally in degrees longitude and is aware of the dateline (aka anti-meridian). It will always be >= 0.
-
getHeight
double getHeight()
The height. In geospatial contexts, this is in degrees latitude. It will always be >= 0.
-
getMinX
double getMinX()
The left edge of the X coordinate.
-
getMinY
double getMinY()
The bottom edge of the Y coordinate.
-
getMaxX
double getMaxX()
The right edge of the X coordinate.
-
getMaxY
double getMaxY()
The top edge of the Y coordinate.
-
getCrossesDateLine
boolean getCrossesDateLine()
Only meaningful for geospatial contexts.
-
relateYRange
SpatialRelation relateYRange(double minY, double maxY)
A specialization ofShape.relate(Shape)
for a vertical line.
-
relateXRange
SpatialRelation relateXRange(double minX, double maxX)
A specialization ofShape.relate(Shape)
for a horizontal line.
-
-