Search in sources :

Example 1 with Coordinate

use of com.couchbase.client.java.util.Coordinate in project couchbase-jvm-clients by couchbase.

the class GeoPolygonQuery method injectParams.

@Override
protected void injectParams(final JsonObject input) {
    final JsonArray points = JsonArray.create();
    for (Coordinate coordinate : coordinates) {
        points.add(JsonArray.from(coordinate.lon(), coordinate.lat()));
    }
    input.put("polygon_points", points);
    if (field != null) {
        input.put("field", field);
    }
}
Also used : JsonArray(com.couchbase.client.java.json.JsonArray) Coordinate(com.couchbase.client.java.util.Coordinate)

Aggregations

JsonArray (com.couchbase.client.java.json.JsonArray)1 Coordinate (com.couchbase.client.java.util.Coordinate)1