|
@@ -31,19 +31,38 @@ public class TileServiceImpl implements ITileService {
|
|
|
|
|
|
//2根据cql规则获取图层对应的空间地理数据
|
|
|
|
|
|
+ StringBuffer filterCqlStr = new StringBuffer();
|
|
|
|
|
|
- StringBuffer sbBbox = new StringBuffer();
|
|
|
- sbBbox.append("(bbox (");
|
|
|
- sbBbox.append(geoDs.getBboxColumn()+",");
|
|
|
- sbBbox.append(requestParam.getBbox()+"))");
|
|
|
+ String filterCql = requestParam.getCqlFilter();
|
|
|
+
|
|
|
+ if(filterCql !=null && !"".equals(filterCql)){
|
|
|
|
|
|
+ filterCqlStr.append(filterCql);
|
|
|
+ }
|
|
|
+
|
|
|
+ String bbox = requestParam.getBbox();
|
|
|
+
|
|
|
+ if(bbox !=null && !"".equals(bbox)){
|
|
|
+
|
|
|
+ StringBuffer sbBbox = new StringBuffer();
|
|
|
+ sbBbox.append("(bbox (");
|
|
|
+ sbBbox.append(geoDs.getBboxColumn()+",");
|
|
|
+ sbBbox.append(requestParam.getBbox()+"))");
|
|
|
+
|
|
|
+ if(filterCqlStr.length() >0){
|
|
|
+
|
|
|
+ filterCqlStr.append(" and "+sbBbox.toString());
|
|
|
+ }else{
|
|
|
+
|
|
|
+ filterCqlStr.append(sbBbox.toString());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
-// String filterCql = requestParam.getCqlFilter()+" and "+sbBbox.toString();
|
|
|
-// String filterCql = sbBbox.toString();
|
|
|
|
|
|
- String filterCql = requestParam.getCqlFilter();
|
|
|
|
|
|
- System.out.println("查询条件:"+filterCql);
|
|
|
+ System.out.println("查询条件:"+filterCqlStr.toString());
|
|
|
|
|
|
Map<String, Object> cqlDsParams = new HashMap<String, Object>();
|
|
|
cqlDsParams.put(JDBCDataStoreFactory.DATABASE.key, geoDs.getDataBase());
|
|
@@ -59,7 +78,7 @@ public class TileServiceImpl implements ITileService {
|
|
|
Map<String, Object> sortParams = new HashMap<String, Object>();
|
|
|
sortParams.put("sort","asc");
|
|
|
|
|
|
- PageResult pageResult = ecqlService.cqlQuery4Mysql(cqlDsParams,filterCql,sortParams,null);
|
|
|
+ PageResult pageResult = ecqlService.cqlQuery4Mysql(cqlDsParams,filterCqlStr.toString(),sortParams,null);
|
|
|
|
|
|
if(pageResult.getRecordCount() >0){
|
|
|
|
|
@@ -72,7 +91,7 @@ public class TileServiceImpl implements ITileService {
|
|
|
|
|
|
}else{
|
|
|
|
|
|
- log.info("根据cql规则:"+sbBbox.toString()+"和图层代码:" + requestParam.getLayers() + " 没有找到图层对应的数据源的空间地理数据");
|
|
|
+ log.info("根据cql规则:"+filterCqlStr.toString()+"和图层代码:" + requestParam.getLayers() + " 没有找到图层对应的数据源的空间地理数据");
|
|
|
}
|
|
|
|
|
|
return new byte[0];
|