use of com.google.apphosting.datastore.DatastoreV3Pb.RectangleRegion in project appengine-java-standard by GoogleCloudPlatform.
the class FilterMatcherTest method testGeo_MultiPreintersection.
@Test
public void testGeo_MultiPreintersection() {
RegionPoint sw = new RegionPoint().setLatitude(0).setLongitude(-180);
RegionPoint ne = new RegionPoint().setLatitude(90).setLongitude(0);
RectangleRegion rect = new RectangleRegion().setSouthwest(sw).setNortheast(ne);
filterMatcher.addFilter(geoFilter(new GeoRegion().setRectangle(rect)));
filterMatcher.addFilter(filter(Operator.EQUAL, 1732));
filterMatcher.addFilter(filter(Operator.EQUAL, 87));
assertMatch("bob", new GeoPt(12, -100), 87, 1732, 99);
assertNoMatch(new GeoPt(12, 24), 1732);
assertNoMatch(1732, 87);
}
use of com.google.apphosting.datastore.DatastoreV3Pb.RectangleRegion in project appengine-java-standard by GoogleCloudPlatform.
the class FilterMatcherTest method testGeo_Rectangle.
@Test
public void testGeo_Rectangle() {
RegionPoint sw = new RegionPoint().setLatitude(0).setLongitude(-180);
RegionPoint ne = new RegionPoint().setLatitude(90).setLongitude(0);
RectangleRegion rect = new RectangleRegion().setSouthwest(sw).setNortheast(ne);
filterMatcher.addFilter(geoFilter(new GeoRegion().setRectangle(rect)));
assertNoMatch("bob");
assertMatch("bob", new GeoPt(12, -100));
assertNoMatch(new GeoPt(12, 24));
assertNoMatch(new GeoPt(-12, -24));
}
Aggregations