Переглянути джерело

增加主键id处理逻辑

liwh 1 рік тому
батько
коміт
544a972b79

+ 10 - 2
cql-service/src/main/java/cn/com/taiji/cql/service/impl/ECqlServiceImpl.java

@@ -59,10 +59,18 @@ public class ECqlServiceImpl implements IECqlService{
 
                 FilterFactoryImpl filterFactory = new FilterFactoryImpl();
 
-                Filter filter = ECQL.toFilter(cql);
+
 
                 Query query = new Query();
-                query.setFilter(filter);
+
+                if(cql !=null && !"".equals(cql)){
+
+                    Filter filter = ECQL.toFilter(cql);
+
+                    query.setFilter(filter);
+
+                }
+
 
 
 

+ 9 - 3
tile-service/src/main/java/cn/com/taiji/tile/service/impl/TileServiceImpl.java

@@ -33,8 +33,12 @@ public class TileServiceImpl implements ITileService {
         sbBbox.append(requestParam.getBbox()+"))");
 
 
-        String filterCql = requestParam.getCqlFilter()+" and "+sbBbox.toString();
-//        String filterCql = requestParam.getCqlFilter();
+//        String filterCql = requestParam.getCqlFilter()+" and "+sbBbox.toString();
+//        String filterCql = sbBbox.toString();
+
+        String filterCql = requestParam.getCqlFilter();
+
+        System.out.println("查询条件:"+filterCql);
 
         Map<String, Object> cqlDsParams = new HashMap<String, Object>();
         cqlDsParams.put(JDBCDataStoreFactory.DATABASE.key, geoDs.getDataBase());
@@ -52,8 +56,10 @@ public class TileServiceImpl implements ITileService {
         List<Map<String, Object>> cqlDataList = ecqlService.cqlQuery(cqlDsParams,filterCql,sortParams);
 
         if(cqlDataList.size() >0){
+
             //3根据空间地理数据生成图层二进制数据
-            System.out.println("返回的数据:"+cqlDataList.toString());
+            System.out.println("查询条件:"+filterCql+"记录数:"+cqlDataList.size()+"===================返回的数据:"+cqlDataList.toString());
+
             return TileUtils.getTile(cqlDataList, requestParam.getBbox());
 
         }else{

+ 5 - 1
tile-service/src/main/java/cn/com/taiji/tile/util/TileUtils.java

@@ -65,7 +65,7 @@ public class TileUtils {
         Graphics2D g = (Graphics2D) image.getGraphics();
         g.setColor(Color.GREEN);
         for (POI poi : poiList) {
-            TileUtils.drawShapeToTile(poi, g, bbox, 1);
+            TileUtils.drawShapeToTile(poi, g, bbox, 11);
         }
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         try {
@@ -132,4 +132,8 @@ public class TileUtils {
     }
 
 
+//    public static void main(String[] args) {
+//        TileUtils.setColorTile();
+//    }
+
 }