Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 2261457bdb9226d63836e2ef7c86188b50e41e4d 2 parents e36afe2 + 0e04633
@mpazos mpazos authored
View
4 modules/library/cql/src/main/java/org/geotools/filter/text/cql2/FilterToCQL.java
@@ -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) {
View
4 modules/library/cql/src/main/java/org/geotools/filter/text/ecql/FilterToECQL.java
@@ -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
View
27 modules/library/cql/src/test/java/org/geotools/filter/text/cql2/FilterToCQLTest.java
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.