Merge "Issue #2997 Fix NullPointerException when env is null" into development
Former-commit-id:1dde3ff1a1
[formerly272b682c15
[formerlya4355f7a27
] [formerly1dde3ff1a1
[formerly 0b22cd421059e7dbd51436f38c9d19810cbc2305]]] Former-commit-id:272b682c15
[formerlya4355f7a27
] Former-commit-id:272b682c15
Former-commit-id:fa4d2090f4
This commit is contained in:
commit
c4e4b3ade3
1 changed files with 12 additions and 6 deletions
|
@ -80,8 +80,11 @@ public class MapsQueryUtil {
|
|||
List<String> columns, List<String> additionalConstraints,
|
||||
String table, String geomField) {
|
||||
|
||||
String geospatialConstraint = "ST_Intersects(the_geom, ST_GeometryFromText('"
|
||||
+ boundingGeom.toText() + "', " + WGS84_SRID + "))";
|
||||
String geospatialConstraint = null;
|
||||
if (boundingGeom != null) {
|
||||
geospatialConstraint = "ST_Intersects(the_geom, ST_GeometryFromText('"
|
||||
+ boundingGeom.toText() + "', " + WGS84_SRID + "))";
|
||||
}
|
||||
|
||||
return assembleMapsTableQuery(geospatialConstraint, columns,
|
||||
additionalConstraints, table, geomField);
|
||||
|
@ -110,10 +113,13 @@ public class MapsQueryUtil {
|
|||
List<String> columns, List<String> additionalConstraints,
|
||||
String table, String geomField) {
|
||||
|
||||
String geospatialConstraint = String.format(
|
||||
"%s && ST_SetSrid('BOX3D(%f %f, %f %f)'::box3d," + WGS84_SRID
|
||||
+ ")", geomField, env.getMinX(), env.getMinY(),
|
||||
env.getMaxX(), env.getMaxY());
|
||||
String geospatialConstraint = null;
|
||||
if (env != null) {
|
||||
geospatialConstraint = String.format(
|
||||
"%s && ST_SetSrid('BOX3D(%f %f, %f %f)'::box3d,"
|
||||
+ WGS84_SRID + ")", geomField, env.getMinX(),
|
||||
env.getMinY(), env.getMaxX(), env.getMaxY());
|
||||
}
|
||||
return assembleMapsTableQuery(geospatialConstraint, columns,
|
||||
additionalConstraints, table, geomField);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue