Permalink
Browse files

Merge pull request #42 from mpazos/GEOT-4297

this is a parch for GEOT-4297, it fix the bug in the geoperations names ...
  • Loading branch information...
2 parents e36afe2 + 0e04633 commit 2261457bdb9226d63836e2ef7c86188b50e41e4d @mpazos mpazos committed Oct 30, 2012
@@ -237,11 +237,11 @@ public Object visit(Intersects filter, Object extraData) {
}
public Object visit(Overlaps filter, Object extraData) {
checkLeftExpressionIsProperty(filter.getExpression1());
- return FilterToTextUtil.buildBinarySpatialOperator("OVERLAP", filter, extraData);
+ return FilterToTextUtil.buildBinarySpatialOperator("OVERLAPS", filter, extraData);
}
public Object visit(Touches filter, Object extraData) {
checkLeftExpressionIsProperty(filter.getExpression1());
- return FilterToTextUtil.buildBinarySpatialOperator("TOUCH", filter, extraData);
+ return FilterToTextUtil.buildBinarySpatialOperator("TOUCHES", filter, extraData);
}
public Object visit(Within filter, Object extraData) {
@@ -228,12 +228,12 @@ public Object visit(Intersects filter, Object extraData) {
@Override
public Object visit(Overlaps filter, Object extraData) {
- return FilterToTextUtil.buildBinarySpatialOperator("OVERLAP", filter, extraData);
+ return FilterToTextUtil.buildBinarySpatialOperator("OVERLAPS", filter, extraData);
}
@Override
public Object visit(Touches filter, Object extraData) {
- return FilterToTextUtil.buildBinarySpatialOperator("TOUCH", filter, extraData);
+ return FilterToTextUtil.buildBinarySpatialOperator("TOUCHES", filter, extraData);
}
@Override
@@ -234,10 +234,35 @@ public void testAnyInteractsUnsuported() throws Exception{
}
@Test
- public void testIntersects() throws Exception{
+ public void testIntersectsPoint() throws Exception{
cqlTest("INTERSECTS(the_geom, POINT (1 2))");
}
+
+ @Test
+ public void testIntersects() throws Exception {
+ cqlTest("INTERSECTS(theGeom, POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0)))");
+ }
+
+ @Test
+ public void testOverlaps() throws Exception {
+ cqlTest("OVERLAPS(theGeom, POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0)))");
+ }
+
+ @Test
+ public void testCrosses() throws Exception {
+ cqlTest("CROSSES(theGeom, POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0)))");
+ }
+
+ @Test
+ public void testContains() throws Exception {
+ cqlTest("CONTAINS(theGeom, POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0)))");
+ }
+
+ @Test
+ public void testTouches() throws Exception {
+ cqlTest("TOUCHES(theGeom, POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0)))");
+ }
protected void cqlTest( String cql ) throws Exception {
Filter filter = CQL.toFilter(cql);

0 comments on commit 2261457

Please sign in to comment.