public class GeoUtils extends Object
|Constructor and Description|
|Modifier and Type||Method and Description|
Convert a sequence of
Computes the bounding box approximation for a "near" query (max distance from a point of origin).
origin- the point of origin, center for the query.
distance- the max distance to search within (negative distances will be multiplied by -1).
NullPointerException- if any of the origin and distance are null
public static void convertPointsTo2DRanges(com.couchbase.client.java.json.JsonArray startRange, com.couchbase.client.java.json.JsonArray endRange, boolean isBoundingBox, Point... points)
Pointsdescribing a polygon to a pair of
JsonArrayranges corresponding to that polygon's bounding box, and inject the coordinates into startRange and endRange. If it is already equivalent to a Box (upper-left Point + lower-right Point), set isBoundingBox to true. Otherwise, this method will attempt to find the bounding box by finding the lowest and highest X and Y coordinates.
startRange- the startRange to populate with this shape's data.
endRange- the endRange to populate with this shape's data.
isBoundingBox- true to skip finding min/max X and Y coordinates and use 2 Points as a
points- the sequence of Points.
IllegalArgumentException- if no points are provided, or in the case of isBoundingBox true if more or less than 2 points are provided or the 2 points are not ordered (a.x <= b.x && a.y <= b.y).
public static void convertShapeTo2DRanges(com.couchbase.client.java.json.JsonArray startRange, com.couchbase.client.java.json.JsonArray endRange, Shape shape)
Shapeto a pair of
JsonArrayranges, injected into startRange and endRange.
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.