Example usage for org.springframework.data.elasticsearch.core.geo GeoBox fromBox

List of usage examples for org.springframework.data.elasticsearch.core.geo GeoBox fromBox

Introduction

In this page you can find the example usage for org.springframework.data.elasticsearch.core.geo GeoBox fromBox.

Prototype

public static GeoBox fromBox(Box box) 

Source Link

Document

return a org.springframework.data.elasticsearch.core.geo.GeoBox from a org.springframework.data.geo.Box .

Usage

From source file:com.github.vanroy.springdata.jest.CriteriaFilterProcessor.java

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;/*ww w. j a  v  a  2s .  c o  m*/
    if (value instanceof Box) {
        Box sdbox = (Box) value;
        geoBBox = GeoBox.fromBox(sdbox);
    } else {
        geoBBox = (GeoBox) value;
    }

    filter.topLeft(geoBBox.getTopLeft().getLat(), geoBBox.getTopLeft().getLon());
    filter.bottomRight(geoBBox.getBottomRight().getLat(), geoBBox.getBottomRight().getLon());
}