/** * Constructs a new box shape which is identified by its south-west and north-east corner points * @param southWestLatitude * @param southWestLongitude * @param northEastLatitude * @param northEastLongitude * @return */ public static final Geoshape box(final double southWestLatitude, final double southWestLongitude, final double northEastLatitude, final double northEastLongitude) { return box((float)southWestLatitude,(float)southWestLongitude,(float)northEastLatitude,(float)northEastLongitude); }
if (len==2) shape= point(arr[0],arr[1]); else if (len==3) shape= circle(arr[0],arr[1],arr[2]); else if (len==4) shape= box(arr[0],arr[1],arr[2],arr[3]); else throw new IllegalArgumentException("Expected 2-4 coordinates to create Geoshape, but given: " + value); return shape;
return box(min(p0[1], p1[1], p2[1], p3[1]), min(p0[0], p1[0], p2[0], p3[0]), max(p0[1], p1[1], p2[1], p3[1]), max(p0[0], p1[0], p2[0], p3[0]));
assertEquals(ImmutableSet.of("doc2"), ImmutableSet.copyOf(result)); result = tx.query(new IndexQuery(store, PredicateCondition.of("location", Geo.WITHIN, Geoshape.box(46.5, -0.5, 50.5, 10.5)))); assertEquals(3,result.size()); assertEquals(ImmutableSet.of("doc1", "doc2", "doc3"), ImmutableSet.copyOf(result));
final Geoshape shape = Geoshape.box(10.0, 10.0, 20.0, 20.0);
/** * Constructs a new box shape which is identified by its south-west and north-east corner points * @param southWestLatitude * @param southWestLongitude * @param northEastLatitude * @param northEastLongitude * @return */ public static final Geoshape box(final double southWestLatitude, final double southWestLongitude, final double northEastLatitude, final double northEastLongitude) { return box((float)southWestLatitude,(float)southWestLongitude,(float)northEastLatitude,(float)northEastLongitude); }
/** * Constructs a new box shape which is identified by its south-west and north-east corner points * @param southWestLatitude * @param southWestLongitude * @param northEastLatitude * @param northEastLongitude * @return */ public static final Geoshape box(final double southWestLatitude, final double southWestLongitude, final double northEastLatitude, final double northEastLongitude) { return box((float)southWestLatitude,(float)southWestLongitude,(float)northEastLatitude,(float)northEastLongitude); }
if (len==2) shape= point(arr[0],arr[1]); else if (len==3) shape= circle(arr[0],arr[1],arr[2]); else if (len==4) shape= box(arr[0],arr[1],arr[2],arr[3]); else throw new IllegalArgumentException("Expected 2-4 coordinates to create Geoshape, but given: " + value); return shape;
if (len==2) shape= point(arr[0],arr[1]); else if (len==3) shape= circle(arr[0],arr[1],arr[2]); else if (len==4) shape= box(arr[0],arr[1],arr[2],arr[3]); else throw new IllegalArgumentException("Expected 2-4 coordinates to create Geoshape, but given: " + value); return shape;
return box(min(p0[1], p1[1], p2[1], p3[1]), min(p0[0], p1[0], p2[0], p3[0]), max(p0[1], p1[1], p2[1], p3[1]), max(p0[0], p1[0], p2[0], p3[0]));
assertEquals(ImmutableSet.of("doc2"), ImmutableSet.copyOf(result)); result = tx.query(new IndexQuery(store, PredicateCondition.of("location", Geo.WITHIN, Geoshape.box(46.5, -0.5, 50.5, 10.5)))); assertEquals(3,result.size()); assertEquals(ImmutableSet.of("doc1", "doc2", "doc3"), ImmutableSet.copyOf(result));
final Geoshape shape = Geoshape.box(10.0,10.0,20.0,20.0);