public class BufferedLineString extends BaseShape<SpatialContext>
BufferedLine
shapes,
resulting in what some call a "Track" or "Polyline" (ESRI terminology).
The buffer can be 0. Note that BufferedLine isn't yet aware of geodesics (e.g. the dateline).Constructor and Description |
---|
BufferedLineString(List<Point> points,
double buf,
boolean expandBufForLongitudeSkew,
SpatialContext ctx) |
BufferedLineString(List<Point> points,
double buf,
SpatialContext ctx)
Needs at least 1 point, usually more than that.
|
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.
|
double |
getBuf() |
Shape |
getBuffered(double distance,
SpatialContext ctx)
Returns a buffered version of this shape.
|
Point |
getCenter()
Returns the center point of this shape.
|
List<Point> |
getPoints() |
ShapeCollection<BufferedLine> |
getSegments() |
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.
|
String |
toString() |
getContext
public BufferedLineString(List<Point> points, double buf, SpatialContext ctx)
public BufferedLineString(List<Point> points, double buf, boolean expandBufForLongitudeSkew, SpatialContext ctx)
points
- ordered control points. If empty then this shape is empty.buf
- Buffer >= 0expandBufForLongitudeSkew
- See #expandBufForLongitudeSkew(com.spatial4j.core.shape.Point,
com.spatial4j.core.shape.Point, double)
.
If true then the buffer for each segment
is computed.ctx
- public boolean isEmpty()
Shape
public Shape getBuffered(double distance, SpatialContext ctx)
Shape
public ShapeCollection<BufferedLine> getSegments()
public double getBuf()
public double getArea(SpatialContext ctx)
Shape
public SpatialRelation relate(Shape other)
Shape
public boolean hasArea()
Shape
public Point getCenter()
Shape
getBoundingBox().getCenter()
but it doesn't have to be.
Postcondition: this.relate(this.getCenter()) == CONTAINS
public Rectangle getBoundingBox()
Shape
this.getBoundingBox().relate(this) == CONTAINS
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 © 2015. All rights reserved.