NamedWriteable
, Writeable
, ToXContent
, ToXContentObject
public class CircleBuilder extends ShapeBuilder<org.locationtech.spatial4j.shape.Circle,CircleBuilder>
ShapeBuilder.Edge, ShapeBuilder.Orientation
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static ParseField |
FIELD_RADIUS |
|
static GeoShapeType |
TYPE |
AUTO_INDEX_JTS_GEOMETRY, AUTO_VALIDATE_JTS_GEOMETRY, coordinates, DATELINE, FACTORY, INTERSECTION_ORDER, LOGGER, MULTI_POLYGON_MAY_OVERLAP, SPATIAL_CONTEXT, wrapdateline, ZERO_ZERO
EMPTY_PARAMS
Constructor | Description |
---|---|
CircleBuilder() |
Creates a circle centered at [0.0, 0.0].
|
CircleBuilder(StreamInput in) |
Read from a stream.
|
Modifier and Type | Method | Description |
---|---|---|
org.locationtech.spatial4j.shape.Circle |
build() |
Create a new Shape from this builder.
|
org.locationtech.jts.geom.Coordinate |
center() |
Get the center of the circle
|
CircleBuilder |
center(double lon,
double lat) |
set the center of the circle
|
CircleBuilder |
center(org.locationtech.jts.geom.Coordinate center) |
Set the center of the circle
|
boolean |
equals(java.lang.Object obj) |
|
int |
hashCode() |
|
int |
numDimensions() |
tracks number of dimensions for this shape
|
double |
radius() |
Get the radius of the circle without unit
|
CircleBuilder |
radius(double radius,
java.lang.String unit) |
Set the radius of the circle
|
CircleBuilder |
radius(double radius,
DistanceUnit unit) |
Set the radius of the circle
|
CircleBuilder |
radius(java.lang.String radius) |
Set the radius of the circle.
|
CircleBuilder |
radius(DistanceUnit.Distance radius) |
Set the radius of the circle
|
java.lang.String |
toWKT() |
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
GeoShapeType |
type() |
get the shapes type
|
DistanceUnit |
unit() |
Get the radius unit of the circle
|
void |
writeTo(StreamOutput out) |
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contentToWKT, coordinate, coordinate, coordinateListToWKT, coordinates, coordinates, coordinates, coordinatesToXcontent, debugEnabled, getWriteableName, intersection, intersections, jtsGeometry, parse, readFromStream, shift, toString, toXContent, writeCoordinateTo
isFragment
public static final ParseField FIELD_RADIUS
public static final GeoShapeType TYPE
public CircleBuilder()
center(Coordinate)
later.public CircleBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
writeTo
in interface Writeable
writeTo
in class ShapeBuilder<org.locationtech.spatial4j.shape.Circle,CircleBuilder>
java.io.IOException
public CircleBuilder center(org.locationtech.jts.geom.Coordinate center)
center
- coordinate of the circles centerpublic CircleBuilder center(double lon, double lat)
lon
- longitude of the centerlat
- latitude of the centerpublic org.locationtech.jts.geom.Coordinate center()
public CircleBuilder radius(java.lang.String radius)
DistanceUnit
radius
- Value and unit of the circle combined in a stringpublic CircleBuilder radius(DistanceUnit.Distance radius)
radius
- radius of the circle (see DistanceUnit.Distance
)public CircleBuilder radius(double radius, java.lang.String unit)
radius
- value of the circles radiusunit
- unit name of the radius value (see DistanceUnit
)public CircleBuilder radius(double radius, DistanceUnit unit)
radius
- value of the circles radiusunit
- unit of the radius value (see DistanceUnit
)public double radius()
public DistanceUnit unit()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOException
public org.locationtech.spatial4j.shape.Circle build()
ShapeBuilder
build
in class ShapeBuilder<org.locationtech.spatial4j.shape.Circle,CircleBuilder>
Shape
defined by the builderpublic GeoShapeType type()
ShapeBuilder
type
in class ShapeBuilder<org.locationtech.spatial4j.shape.Circle,CircleBuilder>
public java.lang.String toWKT()
toWKT
in class ShapeBuilder<org.locationtech.spatial4j.shape.Circle,CircleBuilder>
public int numDimensions()
ShapeBuilder
numDimensions
in class ShapeBuilder<org.locationtech.spatial4j.shape.Circle,CircleBuilder>
public int hashCode()
hashCode
in class ShapeBuilder<org.locationtech.spatial4j.shape.Circle,CircleBuilder>
public boolean equals(java.lang.Object obj)
equals
in class ShapeBuilder<org.locationtech.spatial4j.shape.Circle,CircleBuilder>