Strabon
changeset 607:26af8ebdc892
strdf:inside now is a binary spatial function, instead of an operator
author | Konstantina Bereta <Konstantina.Bereta@di.uoa.gr> |
---|---|
date | Wed Oct 03 13:42:35 2012 +0300 (2012-10-03) |
parents | b060242046c2 |
children | 66736f11dee8 |
files | postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java |
line diff
1.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java Wed Oct 03 12:34:02 2012 +0300 1.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java Wed Oct 03 13:42:35 2012 +0300 1.3 @@ -117,7 +117,7 @@ 1.4 */ 1.5 boolean nullLabel = false; 1.6 1.7 - public enum SpatialOperandsPostGIS { anyInteract, equals, contains, inside, left, right, above, below; } 1.8 + public enum SpatialOperandsPostGIS { anyInteract, equals, contains, left, right, above, below; } 1.9 public enum SpatialFunctionsPostGIS 1.10 { //stSPARQL++ 1.11 //Spatial Relationships 1.12 @@ -129,6 +129,22 @@ 1.13 ST_Intersects, 1.14 ST_Equals, 1.15 ST_Relate, 1.16 + ST_Within, 1.17 + ST_Contains, 1.18 + 1.19 + 1.20 + //without MBB 1.21 + _ST_Disjoint, 1.22 + _ST_Touches, 1.23 + _ST_Covers, 1.24 + _ST_CoveredBy, 1.25 + _ST_Overlaps, 1.26 + _ST_Intersects, 1.27 + _ST_Equals, 1.28 + _ST_Relate, 1.29 + _ST_Within, 1.30 + _ST_Contains, 1.31 + __ST_Covers, 1.32 1.33 //Spatial Constructs - Binary 1.34 ST_Union, 1.35 @@ -138,6 +154,7 @@ 1.36 ST_Transform, 1.37 ST_SymDifference, 1.38 1.39 + 1.40 //Spatial Constructs - Unary 1.41 ST_Envelope, 1.42 ST_ConvexHull, 1.43 @@ -187,7 +204,7 @@ 1.44 EH_Covers, 1.45 EH_CoveredBy, 1.46 EH_Inside, 1.47 - EH_Contains 1.48 + EH_Contains, 1.49 ; 1.50 } 1.51 1.52 @@ -376,7 +393,9 @@ 1.53 protected void append(GeneralDBSqlInside expr, GeneralDBSqlExprBuilder filter) 1.54 throws UnsupportedRdbmsOperatorException { 1.55 1.56 - appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.inside); 1.57 + //appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.inside); 1.58 + appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS._ST_Within); 1.59 + 1.60 } 1.61 1.62 @Override 1.63 @@ -1042,7 +1061,7 @@ 1.64 case anyInteract: filter.intersectsMBB(); break; 1.65 case equals: filter.equalsMBB(); break; 1.66 case contains: filter.containsMBB(); break; 1.67 - case inside: filter.insideMBB(); break; 1.68 + //case inside: filter.insideMBB(); break; 1.69 case left: filter.leftMBB(); break; 1.70 case right: filter.rightMBB(); break; 1.71 case above: filter.aboveMBB(); break; 1.72 @@ -1322,7 +1341,19 @@ 1.73 case ST_Overlaps: filter.appendFunction("ST_Overlaps"); break; 1.74 case ST_Intersects: filter.appendFunction("ST_Intersects"); break; 1.75 case ST_Equals: filter.appendFunction("ST_Equals"); break; 1.76 + case ST_Within: filter.appendFunction("ST_Within"); break; 1.77 + //and now the alternative funcs of the above without the mbb" 1.78 + case _ST_Touches: filter.appendFunction("_ST_Touches"); break; 1.79 + case _ST_Disjoint: filter.appendFunction("_ST_Disjoint"); break; 1.80 + case _ST_Covers: filter.appendFunction("_ST_Covers"); break; 1.81 + case _ST_CoveredBy: filter.appendFunction("_ST_CoveredBy"); break; 1.82 + case _ST_Overlaps: filter.appendFunction("_ST_Overlaps"); break; 1.83 + case _ST_Intersects: filter.appendFunction("_ST_Intersects"); break; 1.84 + case _ST_Equals: filter.appendFunction("_ST_Equals"); break; 1.85 + case _ST_Within: filter.appendFunction("_ST_Within"); break; 1.86 + 1.87 } 1.88 + 1.89 filter.openBracket(); 1.90 if(expr.getLeftArg() instanceof GeneralDBStringValue) 1.91 {