Search in sources :

Example 1 with GeoBox

use of org.springframework.data.elasticsearch.core.geo.GeoBox in project spring-data-elasticsearch by spring-projects.

the class CriteriaFilterProcessor method oneParameterBBox.

private void oneParameterBBox(GeoBoundingBoxQueryBuilder filter, Object value) {
    Assert.isTrue(value instanceof GeoBox || value instanceof Box, "single-element of boundedBy filter must be type of GeoBox or Box");
    GeoBox geoBBox;
    if (value instanceof Box) {
        geoBBox = GeoBox.fromBox((Box) value);
    } else {
        geoBBox = (GeoBox) value;
    }
    filter.setCorners(geoBBox.getTopLeft().getLat(), geoBBox.getTopLeft().getLon(), geoBBox.getBottomRight().getLat(), geoBBox.getBottomRight().getLon());
}
Also used : GeoBox(org.springframework.data.elasticsearch.core.geo.GeoBox) GeoBox(org.springframework.data.elasticsearch.core.geo.GeoBox) Box(org.springframework.data.geo.Box)

Aggregations

GeoBox (org.springframework.data.elasticsearch.core.geo.GeoBox)1 Box (org.springframework.data.geo.Box)1