Changeset 1116:db18575a8e6f
 Timestamp:
 04/27/13 14:36:45 (6 years ago)
 Branch:
 default
 Files:

 2 added
 9 edited
Legend:
 Unmodified
 Added
 Removed

evaluation/src/main/resources/METAINF/services/org.openrdf.query.algebra.evaluation.function.Function
r1112 r1116 84 84 85 85 org.openrdf.query.algebra.evaluation.function.spatial.postgis.construct.MakeLine 86 org.openrdf.query.algebra.evaluation.function.spatial.postgis.construct.Centroid 
generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlAbove.java
r577 r1116 1 /* 2 * Copyright Aduna (http://www.adunasoftware.com/) (c) 2008. 3 * 4 * Licensed under the Aduna BSDstyle license. 1 /** 2 * This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 * 6 * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team 7 * 8 * http://www.strabon.di.uoa.gr/ 5 9 */ 6 10 package org.openrdf.sail.generaldb.algebra; 7 11 8 12 9 import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator;10 import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase;11 13 import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr; 12 14 13 public class GeneralDBSqlAbove extends GeneralDBSqlGeoSpatial {15 public class GeneralDBSqlAbove extends GeneralDBSqlGeoSpatial { 14 16 15 17 public GeneralDBSqlAbove(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 
generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java
r1114 r1116 64 64 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRelate; 65 65 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRight; 66 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_Centroid; 66 67 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_MakeLine; 67 68 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlTouches; … … 392 393 393 394 /** PostGIS Construct functions **/ 395 // Binary 394 396 public static GeneralDBSqlExpr st_MakeLine(GeneralDBSqlExpr left, GeneralDBSqlExpr right) { 395 397 396 398 return new GeneralDBSqlST_MakeLine(left, right); 399 } 400 // Unary 401 public static GeneralDBSqlExpr st_Centroid(GeneralDBSqlExpr expr) { 402 403 return new GeneralDBSqlST_Centroid(expr); 397 404 } 398 405 /** PostGIS Construct functions **/ 
generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java
r1112 r1116 36 36 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoConvexHull; 37 37 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoDifference; 38 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.st_MakeLine;39 38 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoDistance; 40 39 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.geoEnvelope; … … 84 83 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sqlNull; 85 84 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.srid; 85 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.st_Centroid; 86 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.st_MakeLine; 86 87 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.str; 87 88 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sub; … … 124 125 import org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlConvexHullFunc; 125 126 import org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlEnvelopeFunc; 127 import org.openrdf.query.algebra.evaluation.function.spatial.postgis.construct.Centroid; 126 128 import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.BoundaryFunc; 127 129 import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.BufferFunc; … … 872 874 && !(function instanceof GeoSparqlConvexHullFunc) 873 875 && !(function instanceof GeoSparqlEnvelopeFunc) 876 && !(function instanceof Centroid) 874 877 && !(function instanceof UnionFunc && functionCall.getArgs().size()==1)) 875 878 { … … 1254 1257 return geoBuffer(leftArg, rightArg, thirdArg); 1255 1258 } 1259 /* PostGIS Construct functions */ 1256 1260 else if (function.getURI().equals(PostGIS.ST_MAKELINE)) 1257 1261 { 1258 1262 return st_MakeLine(leftArg, rightArg); 1259 1263 } 1264 else if (function.getURI().equals(PostGIS.ST_CENTROID)) 1265 { 1266 return st_Centroid(leftArg); 1267 } 1268 /* PostGIS Construct functions */ 1260 1269 1261 1270 logger.error("[Strabon.spatialConstructPicker] No appropriate SQL expression was generated for extension function {}. This is probably a bug.", function.getURI()); 
generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java
r1114 r1116 25 25 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.sqlNull; 26 26 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.srid; 27 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.st_Centroid; 28 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.st_MakeLine; 27 29 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.unsupported; 28 29 import static org.openrdf.sail.generaldb.algebra.base.GeneralDBExprSupport.st_MakeLine;30 30 31 31 import org.openrdf.model.Literal; … … 504 504 return st_MakeLine(leftArg, rightArg); 505 505 } 506 else if(function.getURI().equals(PostGIS.ST_CENTROID)) 507 { 508 return st_Centroid(leftArg); 509 } 506 510 /** PostGIS construct functions */ 507 511 //Should never reach this place 
generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBQueryBuilder.java
r1112 r1116 76 76 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRelate; 77 77 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRight; 78 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_Centroid; 78 79 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_MakeLine; 79 80 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlShift; … … 1103 1104 protected abstract void append(GeneralDBSqlST_MakeLine expr, GeneralDBSqlExprBuilder filter) 1104 1105 throws UnsupportedRdbmsOperatorException; 1106 protected abstract void append(GeneralDBSqlST_Centroid expr, GeneralDBSqlExprBuilder filter) 1107 throws UnsupportedRdbmsOperatorException; 1105 1108 /* PostGIS Construct Functions */ 1106 1109 … … 1213 1216 append((GeneralDBSqlST_MakeLine)constr, filter); 1214 1217 } 1218 else if(constr instanceof GeneralDBSqlST_Centroid) 1219 { 1220 append((GeneralDBSqlST_Centroid)constr, filter); 1221 } 1215 1222 /* PostGIS functions */ 1216 1223 } 
monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.java
r1112 r1116 20 20 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCase; 21 21 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContains; 22 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbContains;23 22 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCrosses; 24 23 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDiffDateTime; … … 47 46 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlLeft; 48 47 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMathExpr; 48 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbContains; 49 49 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbEquals; 50 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbIntersects; 50 51 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbWithin; 51 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbIntersects;52 52 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNot; 53 53 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull; … … 56 56 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRelate; 57 57 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRight; 58 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_Centroid; 58 59 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_MakeLine; 59 60 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlSpatialConstructBinary; … … 2598 2599 } 2599 2600 2601 @Override 2602 protected void append(GeneralDBSqlST_Centroid expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException { 2603 throw new UnsupportedRdbmsOperatorException("ST_Centroid is not available in MonetDB."); 2604 } 2605 2600 2606 } 
postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java
r1114 r1116 61 61 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRelate; 62 62 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlRight; 63 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_Centroid; 63 64 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlST_MakeLine; 64 65 import org.openrdf.sail.generaldb.algebra.GeneralDBSqlSpatialConstructBinary; … … 164 165 ST_Boundary, 165 166 167 // Spatial Constructs  Unary (PostGIS namespace) 168 ST_Centroid, 169 166 170 //Spatial Metrics  Binary 167 171 ST_Distance, … … 474 478 475 479 @Override 476 protected void append(GeneralDBSqlRight expr, GeneralDBSqlExprBuilder filter) 477 throws UnsupportedRdbmsOperatorException 478 { 480 protected void append(GeneralDBSqlRight expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException 481 { 479 482 appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.right); 480 } 481 482 @Override 483 protected void append(GeneralDBSqlAbove expr, GeneralDBSqlExprBuilder filter) 484 throws UnsupportedRdbmsOperatorException 485 { 483 } 484 485 @Override 486 protected void append(GeneralDBSqlAbove expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException 487 { 486 488 appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.above); 487 } 488 489 @Override 490 protected void append(GeneralDBSqlBelow expr, GeneralDBSqlExprBuilder filter) 491 throws UnsupportedRdbmsOperatorException 492 { 489 } 490 491 @Override 492 protected void append(GeneralDBSqlBelow expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException 493 { 493 494 appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.below); 494 495 } 495 496 496 497 @Override … … 508 509 509 510 @Override 510 protected void append(GeneralDBSqlMbbContains expr, GeneralDBSqlExprBuilder filter) 511 throws UnsupportedRdbmsOperatorException { 511 protected void append(GeneralDBSqlMbbContains expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException { 512 512 appendStSPARQLSpatialOperand(expr, filter, SpatialOperandsPostGIS.contains); 513 513 } … … 762 762 protected void append(GeneralDBSqlST_MakeLine expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException { 763 763 appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS.ST_MakeLine); 764 } 765 766 @Override 767 protected void append(GeneralDBSqlST_Centroid expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException { 768 appendGeneralDBSpatialFunctionUnary(expr, filter, SpatialFunctionsPostGIS.ST_Centroid); 764 769 } 765 770 … … 2163 2168 case ST_IsEmpty: filter.appendFunction("ST_IsEmpty"); break; 2164 2169 case ST_IsSimple: filter.appendFunction("ST_IsSimple"); break; 2165 } 2170 case ST_Centroid: filter.appendFunction("ST_Centroid"); break; 2171 } 2172 2166 2173 filter.openBracket(); 2167 2174 if(expr.getArg() instanceof GeneralDBStringValue) 
vocab/src/main/java/eu/earthobservatory/vocabulary/PostGIS.java
r1112 r1116 17 17 public static final String NAMESPACE = "http://postgis.net/"; 18 18 19 /** Construct functions **/19 /** Construct functions (binary) **/ 20 20 public static final String ST_MAKELINE = NAMESPACE + "ST_MakeLine"; 21 22 /** Construct functions (unary) **/ 23 public static final String ST_CENTROID = NAMESPACE + "ST_Centroid"; 21 24 }
Note: See TracChangeset
for help on using the changeset viewer.