Search in sources :

Example 1 with Rectangle

use of org.hibernate.search.spatial.impl.Rectangle in project cdmlib by cybertaxonomy.

the class RectanglePropertyEditor method setAsText.

/*
     * (non-Javadoc)
     *
     * @see java.beans.PropertyEditorSupport#setAsText(java.lang.String)
     */
@Override
public void setAsText(String text) {
    String[] values = text.split(",");
    Assert.isTrue(values.length == 4, "A rectangle string must contain four values");
    setValue(new Rectangle(// Points are constructed as : latitude, longitude
    Point.fromDegreesInclusive(Double.parseDouble(values[1]), Double.parseDouble(values[0])), Point.fromDegreesInclusive(Double.parseDouble(values[3]), Double.parseDouble(values[2]))));
}
Also used : Rectangle(org.hibernate.search.spatial.impl.Rectangle)

Aggregations

Rectangle (org.hibernate.search.spatial.impl.Rectangle)1