liwh 1 год назад
Родитель
Сommit
9a6a73ec35

+ 6 - 3
cql-service/src/main/java/cn/com/taiji/cql/service/impl/ECqlServiceImpl.java

@@ -6,10 +6,8 @@ import org.geotools.api.data.DataStoreFinder;
 import org.geotools.api.data.Query;
 import org.geotools.api.data.SimpleFeatureSource;
 import org.geotools.api.feature.simple.SimpleFeature;
-import org.geotools.api.feature.simple.SimpleFeatureType;
 import org.geotools.api.feature.type.AttributeDescriptor;
 import org.geotools.api.filter.Filter;
-import org.geotools.api.filter.FilterFactory;
 import org.geotools.api.filter.sort.SortBy;
 import org.geotools.api.filter.sort.SortOrder;
 import org.geotools.data.simple.SimpleFeatureCollection;
@@ -114,9 +112,14 @@ public class ECqlServiceImpl implements IECqlService{
 
                         Map<String, Object> dataMap = new HashMap<String, Object>();
 
+                        String id = simpleFeature.getID();
+                        id = id.substring(id.lastIndexOf(".")+1);
+
+                        dataMap.put("id",id);
+
                         for(AttributeDescriptor attribute:attributeList){
 
-                            System.out.println(attribute.getLocalName() + ":" + simpleFeature.getAttribute(attribute.getLocalName()));
+//                            System.out.println(attribute.getLocalName() + ":" + simpleFeature.getAttribute(attribute.getLocalName()));
 
                             dataMap.put(attribute.getLocalName(),simpleFeature.getAttribute(attribute.getLocalName()));
 

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

@@ -4,7 +4,6 @@ import cn.com.taiji.cql.model.GeoRequestParam;
 import cn.com.taiji.cql.service.IECqlService;
 import cn.com.taiji.tile.service.ITileService;
 import cn.com.taiji.tile.util.TileUtils;
-import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.geotools.jdbc.JDBCDataStoreFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,8 +33,8 @@ 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 = requestParam.getCqlFilter();
 
         Map<String, Object> cqlDsParams = new HashMap<String, Object>();
         cqlDsParams.put(JDBCDataStoreFactory.DATABASE.key, geoDs.getDataBase());
@@ -55,7 +54,7 @@ public class TileServiceImpl implements ITileService {
         if(cqlDataList.size() >0){
             //3根据空间地理数据生成图层二进制数据
             System.out.println("返回的数据:"+cqlDataList.toString());
-            return TileUtils.getTile2lwh(cqlDataList, requestParam.getBbox(),geoDs);
+            return TileUtils.getTile(cqlDataList, requestParam.getBbox());
 
         }else{
 

Разница между файлами не показана из-за своего большого размера
+ 6 - 68
tile-service/src/main/java/cn/com/taiji/tile/util/TileUtils.java


+ 1 - 1
tile-web/src/main/java/cn/com/taiji/web/service/impl/GeoDataSourceServiceImpl.java

@@ -40,7 +40,7 @@ public class GeoDataSourceServiceImpl implements IGeoDataSourceService {
         mapParams.put(JDBCDataStoreFactory.PORT.key, geoConfig.getDsPort());
         mapParams.put(JDBCDataStoreFactory.USER.key, geoConfig.getDsUsername());
         mapParams.put(JDBCDataStoreFactory.PASSWD.key, geoConfig.getDsPassword());
-        mapParams.put("tableName", "geo_data_source");
+        mapParams.put("tableName", "cql_data_source");
 
         String layerCodeCql = "layer_code='"+layerCode+"'";