Issue #2997 Fix NullPointerException when env is null
Change-Id: Iec29c2c99f43239e95de6b01cb3e91d67211a1fe Former-commit-id:ae9e2357dc
[formerly35c090952c
] [formerlyae9e2357dc
[formerly35c090952c
] [formerly6cfdda0e7b
[formerly 31668fe53d6b138106412516a657107f521423c5]]] Former-commit-id:6cfdda0e7b
Former-commit-id:c690ae4fcc
[formerlyf84f58caeb
] Former-commit-id:0f44da4320
This commit is contained in:
parent
abfc0c3ba3
commit
2c1fbba1b3
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