DESKTOP-6LTVLN7\Liumouren 3 ヶ月 前
コミット
4b9d3fbfec
31 ファイル変更30 行追加4251 行削除
  1. 0 44
      pom.xml
  2. 0 26
      src/main/java/com/skyversation/poiaddr/addquery/AddressQueryEngine.java
  3. 0 76
      src/main/java/com/skyversation/poiaddr/addquery/SearchHttpAK.java
  4. 0 54
      src/main/java/com/skyversation/poiaddr/bean/Village.java
  5. 0 330
      src/main/java/com/skyversation/poiaddr/bean/Zerenwangluo.java
  6. 0 356
      src/main/java/com/skyversation/poiaddr/controller/PoiAddressController.java
  7. 0 21
      src/main/java/com/skyversation/poiaddr/entity/FeatureDiy.java
  8. 0 42
      src/main/java/com/skyversation/poiaddr/entity/FileDataDto.java
  9. 0 19
      src/main/java/com/skyversation/poiaddr/entity/GeometryDiy.java
  10. 12 339
      src/main/java/com/skyversation/poiaddr/service/AreaService.java
  11. 18 6
      src/main/java/com/skyversation/poiaddr/service/impl/TestDataServiceImpl.java
  12. 0 742
      src/main/java/com/skyversation/poiaddr/util/CoordTransform.java
  13. 0 93
      src/main/java/com/skyversation/poiaddr/util/CsvWriter.java
  14. 0 347
      src/main/java/com/skyversation/poiaddr/util/ExcelReaderUtils.java
  15. 0 45
      src/main/java/com/skyversation/poiaddr/util/SerializationUtils.java
  16. 0 62
      src/main/java/com/skyversation/poiaddr/util/dms/DmsTools.java
  17. 0 200
      src/main/java/com/skyversation/poiaddr/util/fileTools/ReadFileData.java
  18. 0 388
      src/main/java/com/skyversation/poiaddr/util/geotools/GeoHelpScript.java
  19. 0 75
      src/main/java/com/skyversation/poiaddr/util/geotools/GeoJsonIntersector.java
  20. 0 42
      src/main/java/com/skyversation/poiaddr/util/geotools/GeoJsonPointInRegion.java
  21. 0 56
      src/main/java/com/skyversation/poiaddr/util/geotools/GeometryIntersectionAndDisjoint.java
  22. 0 155
      src/main/java/com/skyversation/poiaddr/util/net/MultiThreadedAsyncHttpClient.java
  23. 0 58
      src/main/java/com/skyversation/poiaddr/util/test/NetworkRequestTest.java
  24. 0 294
      src/main/java/com/skyversation/poiaddr/util/zipunit/CompressUtil.java
  25. 0 188
      src/main/java/com/skyversation/poiaddr/util/zipunit/DataExportUtil.java
  26. 0 21
      src/main/java/com/skyversation/poiaddr/util/zipunit/FileInfo.java
  27. 0 172
      src/main/java/com/skyversation/poiaddr/util/根据jsonarray查询地址_四中心搜索_V4.java
  28. 0 0
      src/main/resources/geojson/qp_cunju.geojson
  29. 0 0
      src/main/resources/geojson/zerenwangluo.json
  30. 0 0
      src/main/resources/geojson/责任网格-wgs84.geojson
  31. 0 0
      src/main/resources/geojson/青浦区微网格-wgs84.geojson

+ 0 - 44
pom.xml

@@ -47,12 +47,6 @@
             <artifactId>mysql-connector-java</artifactId>
             <version>8.0.33</version> <!-- 可根据需要选择合适的 MySQL 8 版本 -->
         </dependency>
-        <!-- 星环数据库 JDBC 驱动 -->
-<!--        <dependency>-->
-<!--            <groupId>com.argoDb</groupId>-->
-<!--            <artifactId>argoDb-jdbc-driver</artifactId>-->
-<!--            <version>8.37.3</version>-->
-<!--        </dependency>-->
         <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>
@@ -83,27 +77,6 @@
             <artifactId>json-simple</artifactId>
             <version>1.1.1</version>
         </dependency>
-        <!--        xlsx读取-->
-        <dependency>
-            <groupId>org.apache.xmlbeans</groupId>
-            <artifactId>xmlbeans</artifactId>
-            <version>5.2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>com.opencsv</groupId>
-            <artifactId>opencsv</artifactId>
-            <version>5.7.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi</artifactId>
-            <version>5.2.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml</artifactId>
-            <version>5.2.3</version>
-        </dependency>
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpclient</artifactId>
@@ -157,18 +130,6 @@
             <artifactId>gt-referencing</artifactId>
             <version>${geotools.version}</version>
         </dependency>
-        <!-- PostgreSQL -->
-        <dependency>
-            <groupId>org.postgresql</groupId>
-            <artifactId>postgresql</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-            <version>1.18.20</version>
-            <scope>compile</scope>
-        </dependency>
 
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -176,11 +137,6 @@
             <scope>runtime</scope>
             <optional>true</optional>
         </dependency>
-        <dependency>
-            <groupId>org.postgresql</groupId>
-            <artifactId>postgresql</artifactId>
-            <scope>runtime</scope>
-        </dependency>
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>

+ 0 - 26
src/main/java/com/skyversation/poiaddr/addquery/AddressQueryEngine.java

@@ -166,25 +166,6 @@ public class AddressQueryEngine {
         }
     }
 
-    /*public AddressResult v4SearchByName(String address) {
-        ResponseEntity response = AddressNetTools.getInstance().requestGet(Constant.V4_URL + address, null, null);
-        if (response != null) {
-            String body = response.getBody() + "";
-            if (!StringUtils.hasText(body))
-                return AddressTools.getInstance().faildQuery(AddressResultEnum.RESULT_NULL, "搜索无结果");
-            try {
-                JSONObject json = JSONObject.parseObject(body);
-                return TransfromDataTool.szxResultToResult(json);
-            } catch (Exception e) {
-                System.err.println(e);
-                return AddressTools.getInstance().faildQuery(AddressResultEnum.DATA_FROMAT_FAILD, "格式化失败");
-            }
-        } else {
-            System.out.println("地址" + address + "未查询到数据!");
-            return null;
-        }
-    }*/
-
     /***
      * 高德普通地名搜索
      * @param address
@@ -274,13 +255,6 @@ public class AddressQueryEngine {
             AreaService areaService = AreaService.getInstance();
             for (AddressResult.ContentBean content : result.getData()) {
                 if (content.getLat() != null && content.getLon() != null) {
-                    // TODO 松江的话只跑行政区划和街镇
-                    /*GeoJsonBean cjBean = areaService.isInCJPolygon(content.getLon(), content.getLat());
-                    content.setCjJson(cjBean == null ? new JSONObject() : cjBean.getProperties());
-                    GeoJsonBean gridBean = areaService.isInGridPolygon(content.getLon(), content.getLat());
-                    content.setWgwJson(gridBean == null ? new JSONObject() : gridBean.getProperties());
-                    GeoJsonBean wgridBean = areaService.isInWGridPolygon(content.getLon(), content.getLat());
-                    content.setWgwJson(wgridBean == null ? new JSONObject() : wgridBean.getProperties());*/
                     GeoJsonBean adBean = areaService.isInadPolygon(content.getLon(), content.getLat());
                     content.setAdJson(adBean == null ? new JSONObject() : adBean.getProperties());
                     GeoJsonBean townBean = areaService.isInTownPolygon(content.getLon(), content.getLat());

+ 0 - 76
src/main/java/com/skyversation/poiaddr/addquery/SearchHttpAK.java

@@ -1,76 +0,0 @@
-package com.skyversation.poiaddr.addquery;
-
-import org.springframework.web.util.UriUtils;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * 百度地图 地理编码 (限额:300万次/天)
- * https://lbsyun.baidu.com/faq/api?title=webapi/guide/webservice-geocoding
- */
-public class SearchHttpAK {
-
-    public static String URL = "https://api.map.baidu.com/geocoding/v3?";
-
-    public static String AK = "7x5HhZqeAaz1vKHnFqo8PjpQ1b9zGI2G";
-
-    public static void main(String[] args) throws Exception {
-
-        SearchHttpAK snCal = new SearchHttpAK();
-
-        Map params = new LinkedHashMap<String, String>();
-        params.put("address", "上海市青浦区前云路10弄南宅小区进大门2号");
-        params.put("output", "json");
-        params.put("ak", AK);
-        snCal.requestGetAK(URL, params);
-    }
-
-    /**
-     * 默认ak
-     * 选择了ak,使用IP白名单校验:
-     * 根据您选择的AK已为您生成调用代码
-     * 检测到您当前的ak设置了IP白名单校验
-     * 您的IP白名单中的IP非公网IP,请设置为公网IP,否则将请求失败
-     * 请在IP地址为xxxxxxx的计算发起请求,否则将请求失败
-     */
-    public void requestGetAK(String strUrl, Map<String, String> param) throws Exception {
-        if (strUrl == null || strUrl.length() <= 0 || param == null || param.size() <= 0) {
-            return;
-        }
-
-        StringBuffer queryString = new StringBuffer();
-        queryString.append(strUrl);
-        for (Map.Entry<?, ?> pair : param.entrySet()) {
-            queryString.append(pair.getKey() + "=");
-            //    第一种方式使用的 jdk 自带的转码方式  第二种方式使用的 spring 的转码方法 两种均可
-            //    queryString.append(URLEncoder.encode((String) pair.getValue(), "UTF-8").replace("+", "%20") + "&");
-            queryString.append(UriUtils.encode((String) pair.getValue(), "UTF-8") + "&");
-        }
-
-        if (queryString.length() > 0) {
-            queryString.deleteCharAt(queryString.length() - 1);
-        }
-
-        java.net.URL url = new URL(queryString.toString());
-        System.out.println(queryString.toString());
-        URLConnection httpConnection = (HttpURLConnection) url.openConnection();
-        httpConnection.connect();
-
-        InputStreamReader isr = new InputStreamReader(httpConnection.getInputStream());
-        BufferedReader reader = new BufferedReader(isr);
-        StringBuffer buffer = new StringBuffer();
-        String line;
-        while ((line = reader.readLine()) != null) {
-            buffer.append(line);
-        }
-        reader.close();
-        isr.close();
-        System.out.println("AK: " + buffer.toString());
-    }
-}

+ 0 - 54
src/main/java/com/skyversation/poiaddr/bean/Village.java

@@ -1,54 +0,0 @@
-package com.skyversation.poiaddr.bean;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@NoArgsConstructor
-@Data
-public class Village implements Serializable {
-
-//        "cartodb_id": 1,
-//        "_": 1101,
-//        "__1": "5.3平方公里",
-//        "shape__length": 17928.4459939482,
-//        "cjname": "爱国村",
-//        "__3": "",
-//        "__4": "青浦区",
-//        "__5": "180529",
-//        "jz": "金泽镇",
-//        "__7": "18032",
-//        "x": "-44771.99662937",
-//        "y": "-21501.9184600481",
-//        "shape__area": 5359669.72730272,
-//        "__8": "东至新港村交界,南至练塘镇交界,西至钱盛村交界,北至莲湖村交界",
-//        "__9": "1805",
-//        "__10": "第二责任网格",
-//        "objectid": 1,
-//        "__11": 5359669.74085635,
-//        "__12": null,
-//        "__13": null,
-//        "__14": null
-
-    private int cartodb_id;
-    private int __;
-    private String __1;
-    private double shape__length;
-    private String cjname;
-    private String __5;
-    private String __4;
-    private String __3;
-    private String jz;
-    private String __7;
-    private String y;
-    private String x;
-    private double shape__area;
-    private String __10;
-    private String __9;
-    private String __8;
-    private int objectid;
-    private Object __12;
-    private double __11;
-    private Object __14;
-    private Object __13;
-}

+ 0 - 330
src/main/java/com/skyversation/poiaddr/bean/Zerenwangluo.java

@@ -1,330 +0,0 @@
-package com.skyversation.poiaddr.bean;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.List;
-
-@NoArgsConstructor
-@Data
-public class Zerenwangluo {
-
-
-    @JsonProperty("objectIdFieldName")
-    private String objectIdFieldName;
-    @JsonProperty("displayField")
-    private String displayField;
-    @JsonProperty("globalIdFieldName")
-    private String globalIdFieldName;
-    @JsonProperty("geometryType")
-    private String geometryType;
-    @JsonProperty("geometry")
-    private String geometry;
-    @JsonProperty("spatialReference")
-    private SpatialReferenceDTO spatialReference;
-    @JsonProperty("fields")
-    private List<FieldsDTO> fields;
-    @JsonProperty("features")
-    private List<FeaturesDTO> features;
-    @JsonProperty("baseLayerInfo")
-    private BaseLayerInfoDTO baseLayerInfo;
-    @JsonProperty("geosceneVersion")
-    private String geosceneVersion;
-
-    @NoArgsConstructor
-    @Data
-    public static class SpatialReferenceDTO {
-        @JsonProperty("wkid")
-        private Integer wkid;
-        @JsonProperty("latestWkid")
-        private Integer latestWkid;
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class BaseLayerInfoDTO {
-        @JsonProperty("id")
-        private Integer id;
-        @JsonProperty("name")
-        private String name;
-        @JsonProperty("currentVersion")
-        private String currentVersion;
-        @JsonProperty("cimVersion")
-        private String cimVersion;
-        @JsonProperty("type")
-        private String type;
-        @JsonProperty("parentLayer")
-        private ParentLayerDTO parentLayer;
-        @JsonProperty("defaultVisibility")
-        private Boolean defaultVisibility;
-        @JsonProperty("minScale")
-        private Integer minScale;
-        @JsonProperty("maxScale")
-        private Integer maxScale;
-        @JsonProperty("canScaleSymbols")
-        private Boolean canScaleSymbols;
-        @JsonProperty("geometryType")
-        private String geometryType;
-        @JsonProperty("description")
-        private String description;
-        @JsonProperty("copyrightText")
-        private String copyrightText;
-        @JsonProperty("relationships")
-        private List<?> relationships;
-        @JsonProperty("dataVersioned")
-        private Boolean dataVersioned;
-        @JsonProperty("isDataArchived")
-        private Boolean isDataArchived;
-        @JsonProperty("archivingInfo")
-        private ArchivingInfoDTO archivingInfo;
-        @JsonProperty("supportsStatistics")
-        private Boolean supportsStatistics;
-        @JsonProperty("supportsAdvancedQueries")
-        private Boolean supportsAdvancedQueries;
-        @JsonProperty("supportsCoordinatesQuantization")
-        private Boolean supportsCoordinatesQuantization;
-        @JsonProperty("supportsDatumTransformation")
-        private Boolean supportsDatumTransformation;
-        @JsonProperty("hasMetadata")
-        private Boolean hasMetadata;
-        @JsonProperty("extent")
-        private ExtentDTO extent;
-        @JsonProperty("sourceSpatialReference")
-        private SourceSpatialReferenceDTO sourceSpatialReference;
-        @JsonProperty("drawingInfo")
-        private DrawingInfoDTO drawingInfo;
-        @JsonProperty("hasAttachments")
-        private Boolean hasAttachments;
-        @JsonProperty("htmlPopupType")
-        private String htmlPopupType;
-        @JsonProperty("displayField")
-        private String displayField;
-        @JsonProperty("typeIdField")
-        private String typeIdField;
-        @JsonProperty("subtypeField")
-        private String subtypeField;
-        @JsonProperty("maxRecordCount")
-        private Integer maxRecordCount;
-        @JsonProperty("supportedQueryFormats")
-        private String supportedQueryFormats;
-        @JsonProperty("capabilities")
-        private String capabilities;
-        @JsonProperty("useStandardizedQueries")
-        private Boolean useStandardizedQueries;
-        @JsonProperty("geosceneVersion")
-        private String geosceneVersion;
-        @JsonProperty("objectIdField")
-        private String objectIdField;
-        @JsonProperty("geometryField")
-        private GeometryFieldDTO geometryField;
-        @JsonProperty("fields")
-        private List<FieldsDTO> fields;
-
-        @NoArgsConstructor
-        @Data
-        public static class ParentLayerDTO {
-            @JsonProperty("id")
-            private Integer id;
-            @JsonProperty("name")
-            private String name;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class ArchivingInfoDTO {
-            @JsonProperty("supportsQueryWithHistoricMoment")
-            private Boolean supportsQueryWithHistoricMoment;
-            @JsonProperty("startArchivingMoment")
-            private Integer startArchivingMoment;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class ExtentDTO {
-            @JsonProperty("spatialReference")
-            private SpatialReferenceDTO spatialReference;
-            @JsonProperty("xmin")
-            private Double xmin;
-            @JsonProperty("ymin")
-            private Double ymin;
-            @JsonProperty("xmax")
-            private Double xmax;
-            @JsonProperty("ymax")
-            private Double ymax;
-
-            @NoArgsConstructor
-            @Data
-            public static class SpatialReferenceDTO {
-                @JsonProperty("wkid")
-                private Integer wkid;
-                @JsonProperty("latestWkid")
-                private Integer latestWkid;
-            }
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class SourceSpatialReferenceDTO {
-            @JsonProperty("wkid")
-            private Integer wkid;
-            @JsonProperty("latestWkid")
-            private Integer latestWkid;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class DrawingInfoDTO {
-            @JsonProperty("renderer")
-            private RendererDTO renderer;
-            @JsonProperty("scaleSymbols")
-            private Boolean scaleSymbols;
-            @JsonProperty("transparency")
-            private Integer transparency;
-            @JsonProperty("labelingInfo")
-            private List<LabelingInfoDTO> labelingInfo;
-
-            @NoArgsConstructor
-            @Data
-            public static class RendererDTO {
-                @JsonProperty("type")
-                private String type;
-                @JsonProperty("symbol")
-                private SymbolDTO symbol;
-
-                @NoArgsConstructor
-                @Data
-                public static class SymbolDTO {
-                    @JsonProperty("type")
-                    private String type;
-                    @JsonProperty("style")
-                    private String style;
-                    @JsonProperty("color")
-                    private List<Integer> color;
-                    @JsonProperty("outline")
-                    private OutlineDTO outline;
-
-                    @NoArgsConstructor
-                    @Data
-                    public static class OutlineDTO {
-                        @JsonProperty("type")
-                        private String type;
-                        @JsonProperty("style")
-                        private String style;
-                        @JsonProperty("color")
-                        private List<Integer> color;
-                        @JsonProperty("width")
-                        private Double width;
-                    }
-                }
-            }
-
-            @NoArgsConstructor
-            @Data
-            public static class LabelingInfoDTO {
-                @JsonProperty("expression")
-                private String expression;
-            }
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class GeometryFieldDTO {
-            @JsonProperty("domain")
-            private Object domain;
-            @JsonProperty("length")
-            private Integer length;
-            @JsonProperty("name")
-            private String name;
-            @JsonProperty("alias")
-            private Object alias;
-            @JsonProperty("type")
-            private String type;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class FieldsDTO {
-            @JsonProperty("domain")
-            private Object domain;
-            @JsonProperty("length")
-            private Integer length;
-            @JsonProperty("name")
-            private String name;
-            @JsonProperty("alias")
-            private Object alias;
-            @JsonProperty("type")
-            private String type;
-        }
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class FieldsDTO {
-        @JsonProperty("length")
-        private Integer length;
-        @JsonProperty("name")
-        private String name;
-        @JsonProperty("alias")
-        private Object alias;
-        @JsonProperty("type")
-        private String type;
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class FeaturesDTO {
-        @JsonProperty("attributes")
-        private AttributesDTO attributes;
-        @JsonProperty("geometry")
-        private GeometryDTO geometry;
-
-        @NoArgsConstructor
-        @Data
-        public static class AttributesDTO {
-            @JsonProperty("工作站联系人")
-            private String 工作站联系人;
-            @JsonProperty("网格编码")
-            private String 网格编码;
-            @JsonProperty("特注")
-            private Object 特注;
-            @JsonProperty("Shape__Length")
-            private Double shapeLength;
-//            @JsonProperty("备注")
-//            private String 备注;
-//            @JsonProperty("所属区县")
-//            private String 所属区县;
-//            @JsonProperty("所属街道")
-//            private String 所属街道;
-            @JsonProperty("所属大居")
-            private Object 所属大居;
-//            @JsonProperty("坐标x")
-//            private String 坐标x;
-//            @JsonProperty("坐标y")
-//            private String 坐标y;
-            @JsonProperty("联系电话")
-            private String 联系电话;
-            @JsonProperty("Shape__Area")
-            private Double shapeArea;
-            @JsonProperty("地址")
-            private String 地址;
-            @JsonProperty("四至范围")
-            private String 四至范围;
-            @JsonProperty("街道代码")
-            private String 街道代码;
-//            @JsonProperty("objectid")
-//            private Integer objectid;
-            @JsonProperty("面积")
-            private Double 面积;
-            @JsonProperty("网格名称")
-            private String 网格名称;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class GeometryDTO {
-            @JsonProperty("rings")
-            private List<List<List<Double>>> rings;
-        }
-    }
-}

+ 0 - 356
src/main/java/com/skyversation/poiaddr/controller/PoiAddressController.java

@@ -1,33 +1,13 @@
 package com.skyversation.poiaddr.controller;
 
-import com.skyversation.poiaddr.addquery.AddressQueryEngine;
-import com.skyversation.poiaddr.bean.AddressResult;
-import com.skyversation.poiaddr.entity.FileDataDto;
 import com.skyversation.poiaddr.service.impl.TestDataServiceImpl;
-import com.skyversation.poiaddr.util.ExcelReaderUtils;
 import com.skyversation.poiaddr.util.RequestUtils;
-import com.skyversation.poiaddr.util.SerializationUtils;
-import com.skyversation.poiaddr.util.dms.DmsTools;
-import com.skyversation.poiaddr.util.fileTools.ReadFileData;
-import com.skyversation.poiaddr.util.geotools.GeoJsonIntersector;
-import com.skyversation.poiaddr.util.geotools.GeoJsonPointInRegion;
-import com.skyversation.poiaddr.util.status.AddressLevel;
-import com.skyversation.poiaddr.util.zipunit.DataExportUtil;
 import lombok.extern.slf4j.Slf4j;
-import org.json.simple.JSONObject;
 import org.springframework.http.MediaType;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.util.*;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
 
 @Slf4j
 @Validated
@@ -45,15 +25,6 @@ public class PoiAddressController {
     }
 
 
-    //  根据街镇名称和村居名称返回符合条件的geojson集合文件
-    @PostMapping(value = "/selectGeojsonByNames", produces = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public Object selectGeojsonByNames(HttpServletResponse response, @RequestParam("jdNameStr") String jdNameStr, @RequestParam(name = "czNameStr", required = false) String czNameStr) throws Exception {
-        String fileName = UUID.randomUUID().toString();
-        GeoJsonIntersector.run(jdNameStr, czNameStr, fileName);
-        ReadFileData.outputFile("output/result_" + fileName + ".geojson", response);
-        return "成功";
-    }
-
     /**
      * (开发中)
      * 定时器:每天都全量更新法人库的地名地址数据
@@ -77,331 +48,4 @@ public class PoiAddressController {
         return "处理完成!用时" + (endTime - startTime) / 1000 + "秒!";
     }
 
-    /**
-     * (测试中)
-     * 地名查询任务接口
-     * * 参数:
-     * ** 必填:
-     * *** file: xlsx、csv、geojson、shape
-     * *** addrColNames: 地名地址字段名称数组,依次查询
-     * ** 非必填:
-     * *** inCoordinate: 输入坐标系(默认为wgs84)
-     * *** latLonColName: 经纬度字段名称,如果长度为一,经纬度字段分隔符为必填
-     * *** latLonSplitStr: 经纬度字段分隔符
-     * *** matchingDistance: 匹配距离,如果不为空,经纬度字段名称不能为空
-     * *** outCoordinate: 输出坐标系(默认为wgs84)
-     * *** matchingLevel: 匹配等级,详情见xmind文件【1、2、3、4、5】
-     * *** regionalJudgment: 区域判断,geojson、shape文件[前端可以内置一些常用的区域文件,通过下拉框的方式进行选择]
-     * <p>
-     * JDK版本要规定为11(已完成)回退为8(已完成)
-     * 需要使用request获取参数,参数校验不能太严格。(通过拦截器的方式也实现了参数乱斗并对必传参数的非空判断以及错误提示)
-     * 接口调用要使用oauth认证,添加拦截器验证headers里面的token。(已完成,暂时使用的是121的Oauth系统,用户名:sj_test)
-     * 任务开始和结束要操作DMS(开始时间-创建时间,结束时间-修改时间,文件名,任务状态,备注)。根据token调用接口就可以(待测试)
-     *
-     * @return Object
-     */
-    @RequestMapping(value = "/nameQueryTaskInterface", produces = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public Object GeoCoordinate(HttpServletResponse response, @RequestHeader(value = "token") String token, @RequestParam(name = "file") MultipartFile file,
-                                @RequestParam(name = "addrColNames") String addrColNames,
-                                @RequestParam(name = "inCoordinate", required = false) String inCoordinate,
-                                @RequestParam(name = "latLonColName", required = false) String latLonColName,
-                                @RequestParam(name = "latLonSplitStr", required = false) String latLonSplitStr,
-                                @RequestParam(name = "matchingDistance", required = false) Long matchingDistance,
-                                @RequestParam(name = "outCoordinate", required = false) String outCoordinate,
-                                @RequestParam(name = "matchingLevel", required = false) Integer matchingLevel,
-                                @RequestParam(name = "regionalJudgment", required = false) MultipartFile regionalJudgment,
-                                @RequestParam(name = "outputFileName", required = false) String outputFileName) {
-//      参数合法性判断
-        if ((file != null && !file.isEmpty()) && (addrColNames != null && !addrColNames.isEmpty())) {
-//          先更新一下token
-            DmsTools.DmsToken = token;
-            if (outputFileName == null) {
-                outputFileName = "";
-            }
-            outputFileName += UUID.randomUUID();
-            org.json.JSONObject params = new org.json.JSONObject();
-            params.put("columnId", "1542");
-            params.put("modelId", "1445");
-            org.json.JSONObject paramsContent = new org.json.JSONObject();
-            paramsContent.put("title", outputFileName);
-            paramsContent.put("content", new Date().toString());
-            paramsContent.put("c_content", "任务初始化");
-//          0:任务初始化;1:开始处理;2:异常中断;3:任务完成
-            paramsContent.put("c_task_status", 0);
-            params.put("content", paramsContent);
-            JSONObject initDmsData = DmsTools.addContent(params);
-            if (initDmsData.get("message") == null || !"200".equals(initDmsData.get("code").toString())) {
-                return "任务初始化失败!DMS数据插入异常,请联系管理员!";
-            }
-            paramsContent.put("id", initDmsData.get("content"));
-            System.out.println("任务初始化:" + initDmsData.get("message"));
-            try {
-//              搜索地址key
-                String addr1Key = "";
-                String addr2Key = "";
-//              参考经纬度key
-                String latKey = "";
-                String lonKey = "";
-                String latLonKey = "";
-                String SplitStr = "";
-                paramsContent.put("c_task_status", 1);
-                paramsContent.put("c_content", "开始处理");
-                params.put("content", paramsContent);
-                DmsTools.updateContent(params);
-//              多地址的形式
-                if (addrColNames.contains(",")) {
-                    String[] addrs = addrColNames.split(",");
-                    if (addrs.length > 2) {
-                        return "最多支持两个地址列查询,请检查addrColNames参数!";
-                    }
-                    addr1Key = addrs[0];
-                    addr2Key = addrs[1];
-                } else {
-                    addr1Key = addrColNames;
-                }
-
-                if (matchingLevel == null) {
-                    matchingLevel = 1;
-                }
-//              匹配距离参数合法性判断
-                if (matchingDistance != null) {
-                    if (latLonColName == null || latLonColName.isEmpty()) {
-                        return "当匹配距离参数不为空时,必须传入经纬度参数!";
-                    }
-                }
-//              经纬度合法性判断
-                if (latLonColName != null) {
-//                  两个key
-                    if (latLonColName.contains(",")) {
-                        String[] latLons = latLonColName.split(",");
-                        latKey = latLons[0];
-                        lonKey = latLons[1];
-                    } else if (latLonSplitStr != null && !latLonSplitStr.isEmpty()) {
-//                      单个key分割,必须要分割符参数
-                        latLonKey = latLonColName;
-                        SplitStr = latLonSplitStr;
-                    } else {
-                        return "经纬度列名解析失败,请传入经度和纬度的列名以逗号分割或传入经纬度列名和分隔符参数!";
-                    }
-                }
-//              封装解析文件的参数
-//              TODO 文件数据解析
-                List<FileDataDto> fileDataDtoList = ReadFileData.ReadMultipartFile(file);
-                List<FileDataDto> regionalDataList = new ArrayList<>();
-                if (regionalJudgment != null && !regionalJudgment.isEmpty()) {
-//                  解析geojson文件得到区域
-                    regionalDataList = ReadFileData.ReadMultipartFile(regionalJudgment);
-                }
-//              TODO 补充FileDataDto中的搜索条件参数
-                for (FileDataDto fileDataDto : fileDataDtoList) {
-//                  搜索等级
-                    fileDataDto.setMatchingLevel(matchingLevel);
-//                  TODO 数据过滤
-//                  set地名地址搜索字段
-                    Map<String, Object> properties = fileDataDto.getProperties();
-                    try {
-                        if (properties != null && addr1Key != null && properties.get(addr1Key) != null && properties.get(addr1Key).toString().length() > 2 && ExcelReaderUtils.isOtherDistrictThanQingpu(properties.get(addr1Key).toString())) {
-                            String address = "上海市青浦区" + AddressQueryEngine.addressReplaceAll(properties.getOrDefault(addr1Key, "").toString());
-                            fileDataDto.setAddr1(address);
-                        }
-                        if (properties != null && addr2Key != null && properties.get(addr2Key) != null && properties.get(addr2Key).toString().length() > 2 && ExcelReaderUtils.isOtherDistrictThanQingpu(properties.get(addr2Key).toString())) {
-                            String address = "上海市青浦区" + AddressQueryEngine.addressReplaceAll(properties.getOrDefault(addr2Key, "").toString());
-                            fileDataDto.setAddr2(address);
-                        }
-                    } catch (Exception e) {
-                        System.err.println(e);
-                    }
-//                  判断是否有参考经纬度字段
-                    if (properties != null && latKey != null && !latKey.isEmpty() && lonKey != null && !lonKey.isEmpty() && properties.get(latKey) != null && properties.get(lonKey) != null) {
-                        String latStr = properties.get(latKey).toString();
-                        String lonStr = properties.get(lonKey).toString();
-                        fileDataDto.setLat(Double.valueOf(latStr));
-                        fileDataDto.setLon(Double.valueOf(lonStr));
-                    } else if (!latLonKey.isEmpty()) {
-                        String[] latLonKeys = latLonKey.split(SplitStr);
-                        if (properties != null && properties.get(latLonKeys[0]) != null && properties.get(latLonKeys[1]) != null) {
-                            String latStr = properties.get(latLonKeys[0]).toString();
-                            String lonStr = properties.get(latLonKeys[1]).toString();
-                            fileDataDto.setLat(Double.valueOf(latStr));
-                            fileDataDto.setLon(Double.valueOf(lonStr));
-                        }
-                    }
-                }
-//              TODO 地名查询
-                // 创建线程池
-                int threadCount = Runtime.getRuntime().availableProcessors();
-                ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
-                List<Future<?>> futures = new ArrayList<>();
-                // 为每个元素提交任务
-                for (FileDataDto fileDataDto : fileDataDtoList) {
-                    futures.add(executorService.submit(() -> {
-                        List<String> addrList = new ArrayList<>();
-                        if (fileDataDto.getAddr1() != null) {
-                            addrList.add(fileDataDto.getAddr1());
-                        }
-                        if (fileDataDto.getAddr2() != null) {
-                            addrList.add(fileDataDto.getAddr2());
-                        }
-                        if (addrList.size() > 0) {
-                            AddressResult addressResult = AddressQueryEngine.getInstance().commonSearchByName(addrList, AddressLevel.values()[fileDataDto.getMatchingLevel() - 1]);
-                            if (addressResult != null) {
-                                if (addressResult.getData() == null || addressResult.getData().size() < 1) {
-                                    fileDataDto.getProperties().put("所属街道", null);
-                                    fileDataDto.getProperties().put("所属居委", null);
-                                    fileDataDto.getProperties().put("纬度", null);
-                                    fileDataDto.getProperties().put("经度", null);
-                                    fileDataDto.getProperties().put("搜索结果地址", null);
-                                } else {
-                                    try {
-                                        for (AddressResult.ContentBean contentBean : addressResult.getData()) {
-                                            String resultAddrKey = contentBean.getAddress();
-                                            if (resultAddrKey != null && contentBean.getLon() != null && contentBean.getLat() != null && contentBean.getCjJson() != null) {
-                                                String lng = contentBean.getLat() + "";
-                                                String lat = contentBean.getLon() + "";
-                                                fileDataDto.getProperties().put("所属街道", contentBean.getCjJson().getString("所属街道"));
-                                                fileDataDto.getProperties().put("所属居委", contentBean.getCjJson().getString("所属居委"));
-                                                fileDataDto.getProperties().put("纬度", lng);
-                                                fileDataDto.getProperties().put("经度", lat);
-                                                fileDataDto.getProperties().put("搜索结果地址", resultAddrKey);
-                                                System.out.println("成功:" + lat + "," + lng);
-                                                break;
-                                            } else if (resultAddrKey != null && contentBean.getLon() != null && contentBean.getLat() != null) {
-                                                fileDataDto.getProperties().put("所属街道", null);
-                                                fileDataDto.getProperties().put("所属居委", null);
-                                                fileDataDto.getProperties().put("纬度", null);
-                                                fileDataDto.getProperties().put("经度", null);
-                                                fileDataDto.getProperties().put("搜索结果地址", null);
-                                            }
-                                        }
-                                    } catch (Exception e) {
-                                        fileDataDto.getProperties().put("所属街道", null);
-                                        fileDataDto.getProperties().put("所属居委", null);
-                                        fileDataDto.getProperties().put("纬度", null);
-                                        fileDataDto.getProperties().put("经度", null);
-                                        fileDataDto.getProperties().put("搜索结果地址", null);
-                                        System.err.println(e);
-                                    }
-                                }
-                            }
-                        } else {
-                            fileDataDto.getProperties().put("所属街道", null);
-                            fileDataDto.getProperties().put("所属居委", null);
-                            fileDataDto.getProperties().put("纬度", null);
-                            fileDataDto.getProperties().put("经度", null);
-                            fileDataDto.getProperties().put("搜索结果地址", null);
-                        }
-                    }));
-                }
-                // 等待所有任务完成
-                for (Future<?> future : futures) {
-                    try {
-                        future.get();
-                    } catch (InterruptedException | ExecutionException e) {
-                        e.printStackTrace();
-                    }
-                }
-                // 关闭线程池
-                executorService.shutdown();
-//              TODO 转换坐标(根据输入坐标系将参考坐标统一转换成wgs84)
-                ArrayList<String> selectOptions = new ArrayList<>();
-//              {"WGS84(国际通用)", "GCJ02(高德、QQ地图)", "BD09(百度地图)", "上海2000坐标系"}
-                selectOptions.add("WGS84");
-                selectOptions.add("GCJ02");
-                selectOptions.add("BD09");
-                selectOptions.add("SH2000");
-                if (inCoordinate != null && !inCoordinate.isEmpty()) {
-                    if (!selectOptions.contains(inCoordinate)) {
-                        return "请传入正确的坐标系名称!可选坐标系名称:WGS84,GCJ02,BD09,SH2000";
-                    }
-                } else {
-                    inCoordinate = "WGS84";
-                }
-                List<Map<String, Object>> dataList = new ArrayList<>();
-//              TODO 距离计算和区域判断和转换坐标
-                for (FileDataDto fileDataDto : fileDataDtoList) {
-                    if (fileDataDto.getLat() != null && fileDataDto.getLon() != null) {
-                        double[] lonLat = com.skyversation.poiaddr.util.Coordinate.transformationCoordinateByCoordinate(fileDataDto.getLat(), fileDataDto.getLon(), inCoordinate, outCoordinate);
-                        fileDataDto.setLat(lonLat[1]);
-                        fileDataDto.setLon(lonLat[0]);
-                    }
-//                  TODO 距离计算
-                    if (matchingDistance != null) {
-                        if (fileDataDto.getResultLat() != null && fileDataDto.getResultLon() != null && fileDataDto.getLat() != null && fileDataDto.getLon() != null) {
-                            double distance = com.skyversation.poiaddr.util.Coordinate.calculateDistance(fileDataDto.getResultLat(), fileDataDto.getResultLon(), fileDataDto.getLat(), fileDataDto.getLon());
-                            fileDataDto.setMatchingDistance(distance);
-                            double matchingDistanceDb = Double.parseDouble(matchingDistance.toString());
-                            if (distance < matchingDistanceDb) {
-                                fileDataDto.setLtMatchingDistance("是");
-                            } else {
-                                fileDataDto.setLtMatchingDistance("否");
-                            }
-                        }
-                    }
-//                  TODO 区域判断(得到经纬度后,要判断得到的点是否在传入的geojson面内)
-                    if (regionalDataList != null && regionalDataList.size() > 0) {
-//                  解析geojson文件得到区域
-                        boolean isArea = false;
-                        for (FileDataDto regionlItem : regionalDataList) {
-                            if (GeoJsonPointInRegion.isPointInGeoJsonRegion(regionlItem.getGeometry().toString(), fileDataDto.getLat(), fileDataDto.getLon())) {
-                                isArea = true;
-                                break;
-                            }
-                        }
-                        fileDataDto.getProperties().put("是否在区域内", isArea ? "是" : "否");
-                    }
-                    dataList.add(fileDataDto.getProperties());
-                }
-//              TODO 结果输出 result[_匹配等级][_匹配距离][_区域名称][_坐标系].[文件类型]
-//              保存实体类到序列化文件
-                SerializationUtils.serialize(fileDataDtoList, "output/output" + outputFileName + ".ser");
-                System.out.println("处理完成!");
-                paramsContent.put("c_task_status", 3);
-                paramsContent.put("c_content", "处理完成!");
-                paramsContent.put("c_file_name", "output/output" + outputFileName + ".ser");
-                params.put("content", paramsContent);
-                DmsTools.updateContent(params);
-                return "文件解析完成,共" + fileDataDtoList.size() + "条数据!";
-            } catch (Exception e) {
-                paramsContent.put("c_task_status", 2);
-                paramsContent.put("c_content", "异常中断:" + e);
-                params.put("content", paramsContent);
-                DmsTools.updateContent(params);
-                return "异常中断:" + e;
-            }
-        } else {
-            return "file或addrColName不能为空!";
-        }
-    }
-
-    /**
-     * (开发中)
-     * 根据文件名和文件类型,下载对应文件类型的数据文件
-     *
-     * @param response
-     * @param outFileType: 输出文件类型【xlsx、csv、geojson(暂不支持)、shape(暂不支持)】
-     * @param fileName
-     * @throws IOException
-     */
-    @RequestMapping(value = "/getFileByParams", produces = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public void getFileByParams(HttpServletResponse response, @RequestParam(name = "outFileType", required = false) String outFileType, @RequestParam(name = "fileName", required = false) String fileName) throws IOException {
-        // 从文件中反序列化读取数据
-        List<FileDataDto> deserializedList = SerializationUtils.deserialize(fileName);
-        List<Map<String, Object>> dataList = new ArrayList<>();
-        if (deserializedList != null) {
-            for (FileDataDto person : deserializedList) {
-                dataList.add(person.getProperties());
-            }
-        }
-        if (outFileType != null) {
-            if (outFileType.contains("csv")) {
-                outFileType = "csv";
-            }
-            if (outFileType.contains("xlsx")) {
-                outFileType = "xlsx";
-            }
-        } else {
-            outFileType = "csv";
-        }
-        DataExportUtil.exportDataToZip(dataList, fileName.replace(".ser", ""), response, outFileType);
-    }
 }

+ 0 - 21
src/main/java/com/skyversation/poiaddr/entity/FeatureDiy.java

@@ -1,21 +0,0 @@
-package com.skyversation.poiaddr.entity;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.util.Map;
-
-// 代表 GeoJSON 的 Feature
-@AllArgsConstructor
-@NoArgsConstructor
-@Data
-public class FeatureDiy implements Serializable {
-    @JsonProperty("type")
-    private String type;
-    @JsonProperty("geometry")
-    private GeometryDiy geometry;
-    @JsonProperty("properties")
-    private Map<String,Object> properties;
-}

+ 0 - 42
src/main/java/com/skyversation/poiaddr/entity/FileDataDto.java

@@ -1,42 +0,0 @@
-package com.skyversation.poiaddr.entity;
-
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import java.io.Serializable;
-import java.util.Map;
-
-@AllArgsConstructor
-@NoArgsConstructor
-@Data
-/**
- * 地名地址查询返回实体类
- * 文件名编码格式result[_匹配等级][_匹配距离][_区域名称][_坐标系].[文件类型]
- */
-public class FileDataDto implements Serializable {
-//  查询地址1
-    private String addr1;
-//  查询地址2
-    private String addr2;
-//  查询结果经度(默认返回的都是wgs84)
-    private Double resultLat;
-//  查询结果纬度(默认返回的都是wgs84)
-    private Double resultLon;
-//  参考经度(可能为空)
-    private Double lat;
-//  参考纬度(可能为空)
-    private Double lon;
-//  匹配等级
-    private Integer matchingLevel;
-//  匹配距离(可能为空)
-    private double matchingDistance;
-//  是否小于匹配距离(可能为空)
-    private String ltMatchingDistance;
-//  是否在区域内(可能为空)
-    private String inTheArea;
-//  geojson geometry
-    private GeometryDiy geometry;
-//  所有属性
-    private Map<String,Object> properties;
-}

+ 0 - 19
src/main/java/com/skyversation/poiaddr/entity/GeometryDiy.java

@@ -1,19 +0,0 @@
-package com.skyversation.poiaddr.entity;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.util.List;
-
-@AllArgsConstructor
-@NoArgsConstructor
-@Data
-public class GeometryDiy implements Serializable {
-    @JsonProperty("type")
-    private String type;
-    @JsonProperty("coordinates")
-    private List<Object> coordinates;
-}

+ 12 - 339
src/main/java/com/skyversation/poiaddr/service/AreaService.java

@@ -1,15 +1,11 @@
 package com.skyversation.poiaddr.service;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.skyversation.poiaddr.addquery.AddressQueryEngine;
 import com.skyversation.poiaddr.addquery.Constant;
 import com.skyversation.poiaddr.bean.AddressResult;
 import com.skyversation.poiaddr.bean.GeoJsonBean;
-import com.skyversation.poiaddr.bean.Village;
-import com.skyversation.poiaddr.bean.Zerenwangluo;
-import com.skyversation.poiaddr.util.CoordTransform;
 import com.skyversation.poiaddr.util.status.AddressLevel;
 import org.geotools.geojson.geom.GeometryJSON;
 import org.geotools.geometry.jts.JTSFactoryFinder;
@@ -45,17 +41,6 @@ public class AreaService {
     private String town;
 
     WKTReader reader = new WKTReader(JTSFactoryFinder.getGeometryFactory());
-    List<JSONObject> featureList = new ArrayList<>();
-    List<Village> propertiList = new ArrayList<>();
-    List<MultiPolygon> mulPolygonList = new ArrayList<>();
-    Zerenwangluo zrwl = null;
-    List<Zerenwangluo.FeaturesDTO> zrwlFeatures = null;
-    List<Zerenwangluo.FeaturesDTO.AttributesDTO> zrwlProperties = new ArrayList<>();
-    List<MultiPolygon> zrwlMulPolygonList = new ArrayList<>();
-
-    public List<GeoJsonBean> cjPolygonList = new ArrayList<>();
-    public List<GeoJsonBean> wGridPolygonList = new ArrayList<>();
-    public List<GeoJsonBean> gridPolygonList = new ArrayList<>();
     public List<GeoJsonBean> shAllAdministrativeDivisionPolygonList = new ArrayList<>();
     public List<GeoJsonBean> shAllToensPolygonList = new ArrayList<>();
 
@@ -63,23 +48,6 @@ public class AreaService {
     public void initGeoData() {
         System.out.println("<<<<<<<<------AreaService>initGeoData------>>>>>>>>>");
         instance = this;
-        if ("青浦".equals(area)) {
-            Thread thread1 = new Thread(this::runGeoData);
-            Thread thread2 = new Thread(this::runZEWLData);
-            thread1.start();
-            thread2.start();
-
-            try {
-                // 等待三个线程执行完毕
-                if ("青浦".equals(area)) {
-                    thread1.join();
-                    thread2.join();
-                }
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }
-
         Thread thread3 = new Thread(this::initPolygons);
         thread3.start();
 
@@ -88,8 +56,7 @@ public class AreaService {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
-//      TODO 初始化tableA、tableB
-        /*testTablesService.testData();*/
+//      TODO 初始化配置文件变量
         Constant.setTowns(town.split("、"));
         Constant.setArea(area);
         System.out.println("<<<<<<<<------根据配置文件为AREA赋值:" + Constant.getArea());
@@ -105,31 +72,13 @@ public class AreaService {
             System.err.println("<<<<<<<<------网络连通性测试结果:" + e);
         }
 
-//      TODO 数据库连接测试,可以查询表数据
-        /*try {
-            legalPersonServiceimpl.iterativeProcessing(1, 100, 1);
-        } catch (Exception e) {
-            System.err.println("<<<<<<<<------数据库连接测试异常:" + e);
-        }*/
     }
 
     public void initPolygons() {
         List<List<GeoJsonBean>> lis = new ArrayList<>();
-        if ("青浦".equals(area)) {
-            lis.add(cjPolygonList);
-            lis.add(wGridPolygonList);
-            lis.add(gridPolygonList);
-        }
         lis.add(shAllAdministrativeDivisionPolygonList);
         lis.add(shAllToensPolygonList);
-        String[] path;
-        if ("青浦".equals(area)) {
-            path = new String[]{"geojson/qp_cunju.geojson", "geojson/青浦区微网格-wgs84.geojson",
-                    "geojson/责任网格-wgs84.geojson", "geojson/sh_all_administrative_division.geojson", "geojson/sh_all_towns.geojson"};
-        } else {
-            path = new String[]{"geojson/sh_all_administrative_division.geojson", "geojson/sh_all_towns.geojson"};
-        }
-
+        String[] path = new String[]{"geojson/sh_all_administrative_division.geojson", "geojson/sh_all_towns.geojson"};
 
         for (int j = 0; j < path.length; j++) {
             BufferedReader reader = null;
@@ -154,40 +103,10 @@ public class AreaService {
                     geoJson.put("type", "MultiPolygon");
                     geoJson.put("coordinates",
                             featrues.getJSONObject(i).getJSONObject("geometry").getJSONArray("coordinates"));
-
                     GeometryJSON geometryJSON = new GeometryJSON();
                     MultiPolygon multiPolygon = geometryJSON.readMultiPolygon(geoJson.toJSONString());
                     GeoJsonBean geoJsonBean = new GeoJsonBean();
-                    if (path[j].contains("cunju")) {
-                        JSONObject resultProp = new JSONObject();
-                        resultProp.put("网格名称", properties.getString("__10"));
-                        resultProp.put("shape_leng", properties.getString("shape__length"));
-                        resultProp.put("范围信息", properties.getString("__8"));
-                        resultProp.put("村居代码", properties.getString("__5"));
-                        resultProp.put("街道代码", properties.getString("__9"));
-//                        resultProp.put("更新时间", properties.getString("__2"));
-                        resultProp.put("shape_area", properties.getString("shape__area"));
-                        resultProp.put("所属区县", properties.getString("__4"));
-                        resultProp.put("所属居委", properties.getString("cjname"));
-                        resultProp.put("所属街道", properties.getString("jz"));
-                        resultProp.put("面积", properties.getString("__1"));
-                        resultProp.put("objectid", properties.getString("objectid"));
-                        geoJsonBean.setProperties(resultProp);
-                    } else if (path[j].contains("微网格")) {
-                        JSONObject resultProp = new JSONObject();
-                        resultProp.put("objectid", properties.getString("OBJECTID"));
-                        resultProp.put("所属街道", properties.getString("æ\u0089\u0080å±\u009Eè¡\u0097"));
-                        resultProp.put("Shape_Leng", properties.getString("Shape_Leng"));
-                        resultProp.put("微格网代码", properties.getString("å¾®ç½\u0091æ ¼"));
-                        resultProp.put("所属区县", properties.getString("æ\u0089\u0080å±\u009Eå\u008Cº"));
-                        resultProp.put("Shape_Area", properties.getString("Shape_Area"));
-                        resultProp.put("微格网名称", properties.getString("å¾®ç½\u0091_1"));
-                        geoJsonBean.setProperties(resultProp);
-                    } else if (path[j].contains("责任网格")) {
-                        geoJsonBean.setProperties(properties);
-                    } else if (path[j].contains("sh_all")) {
-                        geoJsonBean.setProperties(properties);
-                    }
+                    geoJsonBean.setProperties(properties);
                     geoJsonBean.setMultiPolygon(multiPolygon);
                     lis.get(j).add(geoJsonBean);
                 }
@@ -200,278 +119,32 @@ public class AreaService {
         System.out.println("<<<<<<<<------run geo data complete------>>>>>>>>>");
     }
 
-
-    public GeoJsonBean isInGridPolygon(double lon, double lat) {
-        Geometry point = null;
+    public GeoJsonBean isInadPolygon(double lon, double lat) {
         try {
-            point = reader.read("POINT (" + lon + " " + lat + ")");
-        } catch (ParseException e) {
-            throw new RuntimeException(e);
-        }
-
-        for (GeoJsonBean bean : gridPolygonList) {
-            try {
+            Geometry point = reader.read("POINT (" + lon + " " + lat + ")");
+            for (GeoJsonBean bean : shAllAdministrativeDivisionPolygonList) {
                 if (bean.getMultiPolygon().contains(point)) {
                     return bean;
                 }
-            } catch (Exception e) {
-
-            }
-        }
-        return null;
-    }
-
-    public GeoJsonBean isInWGridPolygon(double lon, double lat) {
-        Geometry point = null;
-        try {
-            point = reader.read("POINT (" + lon + " " + lat + ")");
-        } catch (ParseException e) {
-            throw new RuntimeException(e);
-        }
-
-        for (GeoJsonBean bean : wGridPolygonList) {
-            if (bean.getMultiPolygon().contains(point)) {
-                return bean;
             }
-        }
-        return null;
-    }
-
-    public GeoJsonBean isInCJPolygon(double lon, double lat) {
-        Geometry point = null;
-        try {
-            point = reader.read("POINT (" + lon + " " + lat + ")");
-        } catch (ParseException e) {
-            throw new RuntimeException(e);
-        }
-
-        for (GeoJsonBean bean : cjPolygonList) {
-            if (bean.getMultiPolygon().contains(point)) {
-                return bean;
-            }
-        }
-        return null;
-    }
-
-    public GeoJsonBean isInadPolygon(double lon, double lat) {
-        Geometry point = null;
-        try {
-            point = reader.read("POINT (" + lon + " " + lat + ")");
+            return null;
         } catch (ParseException e) {
             throw new RuntimeException(e);
         }
-
-        for (GeoJsonBean bean : shAllAdministrativeDivisionPolygonList) {
-            if (bean.getMultiPolygon().contains(point)) {
-                return bean;
-            }
-        }
-        return null;
     }
 
     public GeoJsonBean isInTownPolygon(double lon, double lat) {
-        Geometry point = null;
-        try {
-            point = reader.read("POINT (" + lon + " " + lat + ")");
-        } catch (ParseException e) {
-            throw new RuntimeException(e);
-        }
-
-        for (GeoJsonBean bean : shAllToensPolygonList) {
-            if (bean.getMultiPolygon().contains(point)) {
-                return bean;
-            }
-        }
-        return null;
-    }
-
-
-    /**
-     * 初始化责任网络数据
-     **/
-    public void runZEWLData() {
-        try {
-            // 创建 ClassPathResource 对象,指定静态文件的路径
-            ClassPathResource resource = new ClassPathResource("geojson/zerenwangluo.json");
-            // 获取文件的输入流
-            BufferedReader reader = new BufferedReader(new InputStreamReader(resource.getInputStream()));
-            String line;
-            StringBuilder sb = new StringBuilder();
-            while ((line = reader.readLine()) != null) {
-                sb.append(line).append("\r\n");
-            }
-            reader.close();
-            zrwl = JSONObject.parseObject(sb.toString(), Zerenwangluo.class);
-            zrwlFeatures = zrwl.getFeatures();
-            for (int i = 0; i < zrwlFeatures.size(); i++) {
-
-                Zerenwangluo.FeaturesDTO.AttributesDTO attributes = zrwlFeatures.get(i).getAttributes();
-                zrwlProperties.add(attributes);
-                Zerenwangluo.FeaturesDTO.GeometryDTO geometry = zrwlFeatures.get(i).getGeometry();
-
-                JSONArray coordinates = new JSONArray();
-                JSONArray coordinates1 = new JSONArray();
-
-                for (List<List<Double>> rings : geometry.getRings()) {
-                    JSONArray coordinates2 = new JSONArray();
-                    for (List<Double> ring : rings) {
-                        JSONArray coordinates3 = new JSONArray();
-                        double x = ring.get(0);
-                        double y = ring.get(1);
-                        double[] dou = CoordTransform.getInstance().SH2000ToWGS84(x, y);
-                        coordinates3.add(dou[0]);
-                        coordinates3.add(dou[1]);
-                        coordinates2.add(coordinates3);
-                    }
-                    coordinates1.add(coordinates2);
-                }
-                coordinates.add(coordinates1);
-
-                JSONObject geoJson = new JSONObject();
-                geoJson.put("type", "MultiPolygon");
-                geoJson.put("coordinates", coordinates);
-
-                GeometryJSON geometryJSON = new GeometryJSON();
-                MultiPolygon multiPolygon = geometryJSON.readMultiPolygon(geoJson.toJSONString());
-
-                zrwlMulPolygonList.add(multiPolygon);
-
-            }
-
-        } catch (IOException e) {
-            e.printStackTrace();
-            System.out.println("<<<<<<<<------run geo data error------>>>>>>>>>");
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-        System.out.println("<<<<<<<<------run geo data complete------>>>>>>>>>");
-    }
-
-
-    public JSONObject getLiabilityGridByLatlon(double lat, double lon) {
-        Zerenwangluo.FeaturesDTO.AttributesDTO attribute = null;
         try {
             Geometry point = reader.read("POINT (" + lon + " " + lat + ")");
-            boolean done = false;
-            for (int i = 0; i < zrwlMulPolygonList.size(); i++) {
-                if (done) {
-                    break;
-                }
-                MultiPolygon multiPolygon = zrwlMulPolygonList.get(i);
-                String wktStr = multiPolygon.toString();
-                if (wktStr.contains("), (")) {// 如果是多面,则拆分成单面再重新比对
-                    String[] wktStrs = wktStr.split("\\), \\(");
-                    List<MultiPolygon> polygons = new ArrayList<>();
-                    for (int j = 0; j < wktStrs.length; j++) {
-                        if (j == 0) {
-                            MultiPolygon polygon1 = (MultiPolygon) reader.read(wktStrs[0] + ")))");
-                            polygons.add(polygon1);
-                        } else if (j == wktStrs.length - 1) {
-                            MultiPolygon polygon2 = (MultiPolygon) reader.read("MULTIPOLYGON (((" + wktStrs[j]);
-                            polygons.add(polygon2);
-                        } else {
-                            MultiPolygon polygon3 = (MultiPolygon) reader.read("MULTIPOLYGON (((" + wktStrs[j] + ")))");
-                            polygons.add(polygon3);
-                        }
-                    }
-                    for (MultiPolygon polygon : polygons) {
-                        if (polygon.contains(point)) {
-                            attribute = zrwlProperties.get(i);
-                            done = true;
-                            break;
-                        }
-                    }
-                } else {// 如果是单面,则直接比对
-                    if (multiPolygon.contains(point)) {
-                        attribute = zrwlProperties.get(i);
-                        break;
-                    }
-                }
-
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            return null;
-        }
-
-        return JSONObject.parseObject(JSON.toJSONString(attribute));
-    }
-
-    /**
-     * 初始化村居数据
-     **/
-    public void runGeoData() {
-        try {
-            // 创建 ClassPathResource 对象,指定静态文件的路径
-            ClassPathResource resource = new ClassPathResource("geojson/qp_cunju.geojson");
-            // 获取文件的输入流
-            BufferedReader reader = new BufferedReader(new InputStreamReader(resource.getInputStream()));
-            String line;
-            StringBuilder sb = new StringBuilder();
-            while ((line = reader.readLine()) != null) {
-                sb.append(line).append("\r\n");
-            }
-            reader.close();
-            JSONObject json = JSONObject.parseObject(sb.toString());
-            JSONArray features = json.getJSONArray("features");
-            for (int i = 0; i < features.size(); i++) {
-
-                JSONObject feature = features.getJSONObject(i);
-                JSONObject geometry = feature.getJSONObject("geometry");
-
-                GeometryJSON geometryJSON = new GeometryJSON();
-                MultiPolygon multiPolygon = geometryJSON.readMultiPolygon(geometry.toJSONString());
-
-                featureList.add(feature);
-                propertiList.add(JSONObject.parseObject(feature.getJSONObject("properties").toJSONString(), Village.class));
-                mulPolygonList.add(multiPolygon);
-            }
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-            System.out.println("<<<<<<<<------run geo data error------>>>>>>>>>");
-        } catch (IOException e) {
-            e.printStackTrace();
-            System.out.println("<<<<<<<<------run geo data error------>>>>>>>>>");
-        } catch (Exception e) {
-            e.printStackTrace();
-            System.out.println("<<<<<<<<------run geo data error------>>>>>>>>>");
-        }
-        System.out.println("<<<<<<<<------run geo data complete------>>>>>>>>>");
-    }
-
-    public Village getAreaCodeByLatlon(double lat, double lon) {
-        Village geoAC = null;
-        try {
-            Geometry point = reader.read("POINT (" + lon + " " + lat + ")");
-            for (int i = 0; i < mulPolygonList.size(); i++) {
-                if (mulPolygonList.get(i).contains(point)) {
-                    geoAC = propertiList.get(i);
-                    break;
+            for (GeoJsonBean bean : shAllToensPolygonList) {
+                if (bean.getMultiPolygon().contains(point)) {
+                    return bean;
                 }
             }
-        } catch (Exception e) {
-            e.printStackTrace();
             return null;
-        }
-        return geoAC;
-    }
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
 
-    public List<Village> getAreaCodeByLatlons(JSONArray locations) {
-        if (locations == null || locations.size() < 1) {
-            return null;
-        } else {
-            List<Village> result = new ArrayList<>();
-            try {
-                for (int i = 0; i < locations.size(); i++) {
-                    JSONObject jsonObject = locations.getJSONObject(i);
-                    Village geoAreaCode = getAreaCodeByLatlon(jsonObject.getDouble("lat"), jsonObject.getDouble("lon"));
-                    result.add(geoAreaCode);
-                }
-                return result;
-            } catch (Exception e) {
-                return null;
-            }
         }
     }
-
 }

+ 18 - 6
src/main/java/com/skyversation/poiaddr/service/impl/TestDataServiceImpl.java

@@ -5,7 +5,6 @@ import com.skyversation.poiaddr.addquery.Constant;
 import com.skyversation.poiaddr.bean.AddressResult;
 import com.skyversation.poiaddr.entity.TestData;
 import com.skyversation.poiaddr.service.TestDataRepository;
-import com.skyversation.poiaddr.util.ExcelReaderUtils;
 import com.skyversation.poiaddr.util.status.AddressLevel;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -37,6 +36,19 @@ public class TestDataServiceImpl {
         return testDataRepository.saveAll(testDataList);
     }
 
+    private boolean isOtherDistrictThanSongJiang(String address) {
+        // 将地址字符串转换为小写,以便进行不区分大小写的比较
+        String lowerCaseAddress = address.toLowerCase();
+        // 检查地址是否包含 "青浦区" 字样,如果不包含,则可能是其他区
+        // 列出上海市的其他区(已补充完整)
+        String[] otherDistricts = {"黄浦区", "徐汇区", "长宁区", "静安区", "普陀区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "金山区", "青浦区", "奉贤区", "崇明区", "浦东新区"};
+        for (String district : otherDistricts) {
+            if (lowerCaseAddress.contains(district.toLowerCase())) {
+                return false;
+            }
+        }
+        return true;
+    }
 
     /**
      * 首先要得到一个Page<T>对象,然后判断是否还有别的数据,有的话接着请求并返回新的Page<T>对象并迭代处理数据
@@ -65,19 +77,19 @@ public class TestDataServiceImpl {
                         item.setUpdateTime(null);
                     } else {
                         List<String> addrList = new ArrayList<>();
-                        if (item.getSkHjdz() != null && !item.getSkHjdz().isEmpty() && ExcelReaderUtils.isOtherDistrictThanSongJiang(item.getSkHjdz())) {
+                        if (item.getSkHjdz() != null && !item.getSkHjdz().isEmpty() && isOtherDistrictThanSongJiang(item.getSkHjdz())) {
 //                          实口户籍地址
                             addrList.add("上海市" + Constant.getArea() + "区" + AddressQueryEngine.addressReplaceAll(item.getSkHjdz()));
                         }
-                        if (item.getSkJzdz() != null && !item.getSkJzdz().isEmpty() && ExcelReaderUtils.isOtherDistrictThanSongJiang(item.getSkJzdz())) {
+                        if (item.getSkJzdz() != null && !item.getSkJzdz().isEmpty() && isOtherDistrictThanSongJiang(item.getSkJzdz())) {
 //                          实口居住地址
                             addrList.add("上海市" + Constant.getArea() + "区" + AddressQueryEngine.addressReplaceAll(item.getSkJzdz()));
                         }
-                        if (item.getJcHjdz() != null && !item.getJcHjdz().isEmpty() && ExcelReaderUtils.isOtherDistrictThanSongJiang(item.getJcHjdz())) {
+                        if (item.getJcHjdz() != null && !item.getJcHjdz().isEmpty() && isOtherDistrictThanSongJiang(item.getJcHjdz())) {
 //                          基层户籍地址
                             addrList.add("上海市" + Constant.getArea() + "区" + AddressQueryEngine.addressReplaceAll(item.getJcHjdz()));
                         }
-                        if (item.getJcJzdz() != null && !item.getJcJzdz().isEmpty() && ExcelReaderUtils.isOtherDistrictThanSongJiang(item.getJcJzdz())) {
+                        if (item.getJcJzdz() != null && !item.getJcJzdz().isEmpty() && isOtherDistrictThanSongJiang(item.getJcJzdz())) {
 //                          基层居住地址
                             addrList.add("上海市" + Constant.getArea() + "区" + AddressQueryEngine.addressReplaceAll(item.getJcJzdz()));
                         }
@@ -93,7 +105,7 @@ public class TestDataServiceImpl {
                                     try {
                                         for (AddressResult.ContentBean contentBean : addressResult.getData()) {
                                             String resultAddrKey = contentBean.getAddress();
-                                            if (resultAddrKey != null && contentBean.getLon() != null && contentBean.getLat() != null && ExcelReaderUtils.isOtherDistrictThanSongJiang(resultAddrKey) && contentBean.getAdJson() != null && contentBean.getTownJson() != null) {
+                                            if (resultAddrKey != null && contentBean.getLon() != null && contentBean.getLat() != null && isOtherDistrictThanSongJiang(resultAddrKey) && contentBean.getAdJson() != null && contentBean.getTownJson() != null) {
                                                 String lng = contentBean.getLat() + "";
                                                 String lat = contentBean.getLon() + "";
                                                 item.setInTheArea("是");

+ 0 - 742
src/main/java/com/skyversation/poiaddr/util/CoordTransform.java

@@ -1,742 +0,0 @@
-package com.skyversation.poiaddr.util;
-
-import org.opengis.referencing.operation.Projection;
-import org.osgeo.proj4j.*;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class CoordTransform {
-
-    private final double x_PI = (Math.PI * 3000.0) / 180.0;
-    private final double ee = 0.00669342162296594323;
-    private final double a = 6378245.0;
-
-
-    private final double BD_FACTOR = (3.14159265358979324 * 3000.0) / 180.0;
-    private final double PI = Math.PI;
-    private final double RADIUS = 6378245.0;
-    private final double EE = 0.00669342162296594323;
-
-
-    // 定义常量
-    private final double A = 6378245.0;
-
-    public enum Projs {
-        WGS84, GCJ02, BD09, UTM4, SHCJ, METER, DEGREE
-    }
-
-    public enum EPSG {
-        WGS84("+proj=longlat +datum=WGS84 +no_defs"),
-        MERCATOR("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"),
-        GAUSS_KRUGER("+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs");
-
-        private final String projString;
-
-        EPSG(String projString) {
-            this.projString = projString;
-        }
-
-        public String getProjString() {
-            return projString;
-        }
-    }
-
-    public static boolean outOfSh(double lng, double lat){
-        lat += lat;
-        lng +=lng;
-        return !(lng > 115.487 && lng < 123.696 && lat > 28.260 && lat < 33.521);
-    }
-
-    private static CoordTransform instance = new CoordTransform();
-    CoordTransform(){}
-    public static CoordTransform getInstance(){
-        if(instance == null) {
-            instance = new CoordTransform();
-        }
-        return instance;
-    }
-
-
-    // 定义投影字典
-    private static final List<Projection> projs = new ArrayList<>();
-
-    // 定义坐标转换方法
-    public double[] wgs84ToShcj(double x, double y) {
-        if (outOfChina(x, y)) {
-            return new double[]{x, y};
-        } else {
-            double[] dlatLng = transformLatLng(x - 105.0, y - 35.0);
-            double radLat = (y / 180.0) * PI;
-            double magic = Math.sin(radLat);
-            magic = 1 - ee * magic * magic;
-            double sqrtMagic = Math.sqrt(magic);
-            dlatLng[0] = (dlatLng[0] * 180.0) / (((a * (1 - ee)) / (magic * sqrtMagic)) * PI);
-            dlatLng[1] = (dlatLng[1] * 180.0) / ((a / sqrtMagic) * Math.cos(radLat) * PI);
-            double mglat = y + dlatLng[0];
-            double mglng = x + dlatLng[1];
-            return new double[]{mglng, mglat};
-        }
-    }
-
-    // 定义坐标转换方法
-    public double[] gcj02ToWgs84(double x, double y) {
-        if (outOfChina(x, y)) {
-            return new double[]{x, y};
-        } else {
-            double[] dlatLng = transformLatLng(x - 105.0, y - 35.0);
-            double radLat = (y / 180.0) * PI;
-            double magic = Math.sin(radLat);
-            magic = 1 - ee * magic * magic;
-            double sqrtMagic = Math.sqrt(magic);
-            dlatLng[0] = (dlatLng[0] * 180.0) / (((a * (1 - ee)) / (magic * sqrtMagic)) * PI);
-            dlatLng[1] = (dlatLng[1] * 180.0) / ((a / sqrtMagic) * Math.cos(radLat) * PI);
-            double mglat = y + dlatLng[0];
-            double mglng = x + dlatLng[1];
-            return new double[]{x * 2 - mglng, y * 2 - mglat};
-        }
-    }
-
-    // 定义判断是否在中国境内的方法
-    public boolean outOfChina(double x, double y) {
-        // 纬度 3.86~53.55,经度 73.66~135.05
-        return!(x > 73.66 && x < 135.05 && y > 3.86 && y < 53.55);
-    }
-
-    // 定义坐标转换方法
-    public double[] transformLatLng(double x, double y) {
-        double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
-        ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0;
-        ret += ((20.0 * Math.sin(y * PI) + 40.0 * Math.sin((y / 3.0) * PI)) * 2.0) / 3.0;
-        ret += ((160.0 * Math.sin((y / 12.0) * PI) + 320 * Math.sin((y * PI) / 30.0)) * 2.0) / 3.0;
-        return new double[]{ret, ret};
-    }
-
-    // 定义经纬度转米的方法
-    public double[] degreeToMeter(double x, double y) {
-        double lon = (x * 20037508.34) / 180;
-        double lat = Math.log(Math.tan(((90 + y) * PI) / 360)) / (PI / 180);
-        lat = (lat * 20037508.34) / 180;
-        return new double[]{lon, lat};
-    }
-
-    // 定义米转经纬度的方法
-    public double[] meterToDegree(double x, double y) {
-        double lon = (x / 20037508.34) * 180;
-        double lat = (y / 20037508.34) * 180;
-        lat = (180 / PI) * (2 * Math.atan(Math.exp((lat * PI) / 180)) - PI / 2);
-        return new double[]{lon, lat};
-    }
-
-    // 定义 WGS84 坐标转上海城建的方法
-    public double[] wgs84ToShcj2(double x, double y) {
-        double[] xy = shcjGetUTMFromWGS(x, y);
-        return utmToShcj4(xy[0], xy[1]);
-    }
-
-    // 定义 UTM 转上海城建的方法
-    public double[] utmToShcj4(double x, double y) {
-        double DX = -500199.29965;
-        double DY = -3457078.805985;
-        double T = 0.0000001755;
-        double K = 1.0004000106;
-        return covertByFourParm(x, y, DX, DY, T, K);
-    }
-
-    // 定义上海城建坐标转 UTM 的方法
-    public double[] shcjGetUTMFromWGS(double lon, double lat) {
-        double a = 6378137;
-        double b = 6356752.3142451;
-        double f = (a - b) / a;
-
-        double eSquare = 2 * f - f * f;
-        double k0 = 0.9996;
-        double lonOrigin = 121.46714714;
-        double FN = 0;
-        // # 确保 longtitude 位于-180.00----179.9 之间
-        double lonTemp = lon + 180 - Math.floor((lon + 180) / 360) * 360 - 180;
-        double latRad = (lat * PI) / 180;
-        double lonRad = (lonTemp * PI) / 180;
-        double lonOriginRad = (lonOrigin * PI) / 180;
-        double e2Square = eSquare / (1 - eSquare);
-
-        double V = a / Math.sqrt(1 - eSquare * Math.pow(Math.sin(latRad), 2));
-        double T = Math.pow(Math.tan(latRad), 2);
-        double C = e2Square * Math.pow(Math.cos(latRad), 2);
-        double A = Math.cos(latRad) * (lonRad - lonOriginRad);
-        double M = a * ((1 - eSquare / 4 - (3 * Math.pow(eSquare, 2)) / 64 - (5 * Math.pow(eSquare, 3)) / 256) * latRad - ((3 * eSquare) / 8 + (3 * Math.pow(eSquare, 2)) / 32 + (45 * Math.pow(eSquare, 3)) / 1024) * Math.sin(2 * latRad) + ((15 * Math.pow(eSquare, 2)) / 256 + (45 * Math.pow(eSquare, 3)) / 1024) * Math.sin(4 * latRad) - ((35 * Math.pow(eSquare, 3)) / 3072) * Math.sin(6 * latRad));
-
-        // # x
-        double UTMEasting = k0 * V * (A + ((1 - T + C) * Math.pow(A, 3)) / 6 + ((5 - 18 * T + Math.pow(T, 2) + 72 * C - 58 * e2Square) * Math.pow(A, 5)) / 120) + 500000.0;
-        //  # y
-        double UTMNorthing = k0 * (M + V * Math.tan(latRad) * (Math.pow(A, 2) / 2 + ((5 - T + 9 * C + 4 * Math.pow(C, 2)) * Math.pow(A, 4)) / 24 + ((61 - 58 * T + Math.pow(T, 2) + 600 * C - 330 * e2Square) * Math.pow(A, 6)) / 720));
-        //# 南半球纬度起点为 10000000.0m
-        UTMNorthing += FN;
-        double[] xy = new double[2];
-        xy[0] = UTMEasting;
-        xy[1] = UTMNorthing;
-        return xy;
-    }
-
-    // 定义上海城建坐标转 WGS84 的方法
-    public double[] shcjToWgs84(double x, double y) {
-        double[] xy = shcjToUtm4(x, y);
-        return shcjGetWGSFromUTM(xy[0], xy[1]);
-    }
-
-    // 定义上海城建坐标转 UTM 的方法
-    public double[] shcjToUtm4(double x, double y) {
-        double DX = 499999.90104;
-        double DY = 3455696.403019;
-        double T = -0.0000001755;
-        double K = 0.999600149344;
-        return covertByFourParm(x, y, DX, DY, T, K);
-    }
-
-    // 定义四参数公式
-    public double[] covertByFourParm(double x, double y, double dx, double dy, double a, double k) {
-        double px = 0;
-        double py = 0;
-        px = x * k * Math.cos(a) - y * k * Math.sin(a) + dx;
-        py = x * k * Math.sin(a) + y * k * Math.cos(a) + dy;
-        double[] xy = new double[2];
-        xy[0] = px;
-        xy[1] = py;
-        return xy;
-    }
-
-    // 定义上海城建坐标转 WGS84 的方法
-    public double[] shcjGetWGSFromUTM(double x, double y) {
-        // WGS84
-        double a = 6378137; // 椭球体长半轴
-        double b = 6356752.3142451; // 椭球体短半轴
-        x = 500000 - x;
-        double k0 = 0.9996;
-        double e = Math.sqrt(1 - Math.pow(b, 2) / Math.pow(a, 2));
-        // # calculate the meridional arc
-        double M = y / k0;
-        //# calculate footprint latitude
-        double mu = M / (a * (1 - Math.pow(e, 2) / 4 - (3 * Math.pow(e, 4)) / 64 - (5 * Math.pow(e, 6)) / 256));
-        double e1 = (1 - Math.pow(1 - Math.pow(e, 2), 1.0 / 2)) / (1 + Math.pow(1 - Math.pow(e, 2), 1.0 / 2));
-        double J1 = (3 * e1) / 2 - (27 * Math.pow(e1, 3)) / 32;
-        double J2 = (21 * Math.pow(e1, 2)) / 16 - (55 * Math.pow(e1, 4)) / 32;
-        double J3 = (151 * Math.pow(e1, 3)) / 96;
-        double J4 = (1097 * Math.pow(e1, 4)) / 512;
-        double fp = mu + J1 * Math.sin(2 * mu) + J2 * Math.sin(4 * mu) + J3 * Math.sin(6 * mu) + J4 * Math.sin(8 * mu);
-        // # Calculate Latitude and Longitude
-        double e2 = Math.pow(e, 2) / (1 - Math.pow(e, 2));
-        double C1 = e2 * Math.pow(Math.cos(fp), 2);
-        double T1 = Math.pow(Math.tan(fp), 2);
-        double R1 = (a * (1 - Math.pow(e, 2))) / Math.pow(1 - Math.pow(e * Math.sin(fp), 2), 3.0 / 2);
-        //# This is the same as rho in the forward conversion formulas above, but calculated for fp instead of lat.
-        double N1 = a / Math.pow(1 - Math.pow(e * Math.sin(fp), 2), 1.0 / 2);
-        //# This is the same as nu in the forward conversion formulas above, but calculated for fp instead of lat.
-        double D = x / (N1 * k0);
-        double Q1 = (N1 * Math.tan(fp)) / R1;
-        double Q2 = Math.pow(D, 2) / 2;
-        double Q3 = ((5 + 3 * T1 + 10 * C1 - 4 * Math.pow(C1, 2) - 9 * e2) * Math.pow(D, 4)) / 24;
-        double Q4 = ((61 + 90 * T1 + 298 * C1 + 45 * Math.pow(T1, 2) - 3 * Math.pow(C1, 2) - 252 * e2) * Math.pow(D, 6)) / 720;
-        double lat = ((fp - Q1 * (Q2 - Q3 + Q4)) * 180) / PI;
-        // System.out.println("lat===="+Math.toRadians(fp - Q1*(Q2 - Q3 + Q4)));
-        double Q5 = D;
-        double Q6 = ((1 + 2 * T1 + C1) * Math.pow(D, 3)) / 6;
-        double Q7 = ((5 - 2 * C1 + 28 * T1 - 3 * Math.pow(C1, 2) + 8 * e2 + 24 * Math.pow(T1, 2)) * Math.pow(D, 5)) / 120;
-        double lonMid = 121.46714714;
-        double lon = lonMid - (((Q5 - Q6 + Q7) / Math.cos(fp)) * 180) / PI;
-        double[] xy = new double[2];
-        xy[0] = lon;
-        xy[1] = lat;
-        return xy;
-    }
-
-    /***
-     *  计算两个经纬度之间的距离,返回单位米
-     * @param lat1
-     * @param lon1
-     * @param lat2
-     * @param lon2
-     * @return
-     */
-    public double calculateDistance(double lat1, double lon1, double lat2, double lon2) {
-        // 将经纬度转换为弧度
-        double lat1Rad = Math.toRadians(lat1);
-        double lon1Rad = Math.toRadians(lon1);
-        double lat2Rad = Math.toRadians(lat2);
-        double lon2Rad = Math.toRadians(lon2);
-
-//        // 地球半径(单位:千米)
-//        double earthRadius = 6371.0;
-
-        // Haversine公式计算两点之间的距离
-        double dLat = lat2Rad - lat1Rad;
-        double dLon = lon2Rad - lon1Rad;
-        double a = Math.pow(Math.sin(dLat / 2), 2) + Math.cos(lat1Rad) * Math.cos(lat2Rad) * Math.pow(Math.sin(dLon / 2), 2);
-        double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
-        double distance = 6378245.0 * c;
-
-        return distance;
-    }
-
-    public boolean checkLatlon(double lat, double lon){
-        if(lat >85 || lat < -85|| lon >180 || lon < -180){
-            return false;
-        }
-        return true;
-    }
-
-    public double[] bd09_to_gcj02(double bd_lon, double bd_lat) {
-        double x = bd_lon - 0.0065;
-        double y = bd_lat - 0.006;
-        double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_PI);
-        double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_PI);
-        double gg_lng = z * Math.cos(theta);
-        double gg_lat = z * Math.sin(theta);
-        return new double[]{gg_lng, gg_lat};
-    }
-
-    public double[] gcj02_to_bd09(double lng, double lat) {
-        double z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_PI);
-        double theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_PI);
-        double bd_lng = z * Math.cos(theta) + 0.0065;
-        double bd_lat = z * Math.sin(theta) + 0.006;
-        return new double[]{bd_lng, bd_lat};
-    }
-
-    public double[] wgs84_to_gcj02(double lng, double lat) {
-        if (out_of_china(lng, lat)) {
-            return new double[]{lng, lat};
-        } else {
-            double dlat = transformlat(lng - 105.0, lat - 35.0);
-            double dlng = transformlng(lng - 105.0, lat - 35.0);
-            double radlat = (lat / 180.0) * PI;
-            double magic = Math.sin(radlat);
-            magic = 1 - ee * magic * magic;
-            double sqrtmagic = Math.sqrt(magic);
-            dlat = (dlat * 180.0) / (((a * (1 - ee)) / (magic * sqrtmagic)) * PI);
-            dlng = (dlng * 180.0) / ((a / sqrtmagic) * Math.cos(radlat) * PI);
-            double mglat = lat + dlat;
-            double mglng = lng + dlng;
-            return new double[]{mglng, mglat};
-        }
-    }
-
-//    public double[] gcj02_to_wgs84(double lng, double lat) {
-//        if (out_of_china(lng, lat)) {
-//            return new double[]{lng, lat};
-//        } else {
-//            double dlat = transformlat(lng - 105.0, lat - 35.0);
-//            double dlng = transformlng(lng - 105.0, lat - 35.0);
-//            double radlat = (lat / 180.0) * PI;
-//            double magic = Math.sin(radlat);
-//            magic = 1 - ee * magic * magic;
-//            double sqrtmagic = Math.sqrt(magic);
-//            dlat = (dlat * 180.0) / (((a * (1 - ee)) / (magic * sqrtmagic)) * PI);
-//            dlng = (dlng * 180.0) / ((a / sqrtmagic) * Math.cos(radlat) * PI);
-//            double mglat = lat + dlat;
-//            double mglng = lng + dlng;
-//            return new double[]{lng * 2 - mglng, lat * 2 - mglat};
-//        }
-//    }
-
-//    public boolean out_of_china(double lng, double lat) {
-//        return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55);
-//    }
-
-//    public double transformlat(double lng, double lat) {
-//        double ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
-//        ret += ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0) / 3.0;
-//        ret += ((20.0 * Math.sin(lat * PI) + 40.0 * Math.sin((lat / 3.0) * PI)) * 2.0) / 3.0;
-//        ret += ((160.0 * Math.sin((lat / 12.0) * PI) + 320 * Math.sin((lat * PI) / 30.0)) * 2.0) / 3.0;
-//        return ret;
-//    }
-//
-//    public double transformlng(double lng, double lat) {
-//        double ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
-//        ret += ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0) / 3.0;
-//        ret += ((20.0 * Math.sin(lng * PI) + 40.0 * Math.sin((lng / 3.0) * PI)) * 2.0) / 3.0;
-//        ret += ((150.0 * Math.sin((lng / 12.0) * PI) + 300.0 * Math.sin((lng / 30.0) * PI)) * 2.0) / 3.0;
-//        return ret;
-//    }
-
-    public double[] degree_to_meter(double lng, double lat) {
-        double x = (lng * 20037508.34) / 180;
-        double y = Math.log(Math.tan(((90 + lat) * PI) / 360)) / (PI / 180);
-        y = (y * 20037508.34) / 180;
-        return new double[]{x, y};
-    }
-
-    public double[] meter_to_degree(double x, double y) {
-        double lon = (x / 20037508.34) * 180;
-        double lat = (y / 20037508.34) * 180;
-        lat = (180 / PI) * (2 * Math.atan(Math.exp((lat * PI) / 180)) - PI / 2);
-        return new double[]{lon, lat};
-    }
-
-//    public double[] wgs84_to_shcj(double x, double y) {
-//        double[] xy = new double[2];
-//        xy = shcj_get_UTM_from_WGS(x, y);
-//        return utm_to_shcj4(xy[0], xy[1]);
-//    }
-
-    public double[] utm_to_shcj4(double x, double y) {
-        double DX = -500199.29965;
-        double DY = -3457078.805985;
-        double T = 0.0000001755;
-        double K = 1.0004000106;
-        return covert_by_four_parm(x, y, DX, DY, T, K);
-    }
-
-    public double[] shcj_get_UTM_from_WGS(double lon, double lat) {
-        double a = 6378137;
-        double b = 6356752.3142451;
-        double f = (a - b) / a;
-        double eSquare = 2 * f - f * f;
-        double k0 = 0.9996;
-        double lonOrigin = 121.46714714;
-        double FN = 0;
-        double lonTemp = lon + 180 - Math.floor((lon + 180) / 360) * 360 - 180;
-        double latRad = (lat * PI) / 180;
-        double lonRad = (lonTemp * PI) / 180;
-        double lonOriginRad = (lonOrigin * PI) / 180;
-        double e2Square = eSquare / (1 - eSquare);
-        double V = a / Math.sqrt(1 - eSquare * Math.pow(Math.sin(latRad), 2));
-        double T = Math.pow(Math.tan(latRad), 2);
-        double C = e2Square * Math.pow(Math.cos(latRad), 2);
-        double A = Math.cos(latRad) * (lonRad - lonOriginRad);
-        double M = a * ((1 - eSquare / 4 - (3 * Math.pow(eSquare, 2)) / 64 - (5 * Math.pow(eSquare, 3)) / 256) * latRad -
-                ((3 * eSquare) / 8 + (3 * Math.pow(eSquare, 2)) / 32 + (45 * Math.pow(eSquare, 3)) / 1024) *
-                        Math.sin(2 * latRad) +
-                ((15 * Math.pow(eSquare, 2)) / 256 + (45 * Math.pow(eSquare, 3)) / 1024) *
-                        Math.sin(4 * latRad) -
-                ((35 * Math.pow(eSquare, 3)) / 3072) * Math.sin(6 * latRad));
-        double UTMEasting = k0 * V * (A + ((1 - T + C) * Math.pow(A, 3)) / 6 +
-                ((5 - 18 * T + Math.pow(T, 2) + 72 * C - 58 * e2Square) * Math.pow(A, 5)) / 120) + 500000.0;
-        double UTMNorthing = k0 * (M + V * Math.tan(latRad) * (Math.pow(A, 2) / 2 +
-                ((5 - T + 9 * C + 4 * Math.pow(C, 2)) * Math.pow(A, 4)) / 24 +
-                ((61 - 58 * T + Math.pow(T, 2) + 600 * C - 330 * e2Square) * Math.pow(A, 6)) / 720));
-        UTMNorthing += FN;
-        return new double[]{UTMEasting, UTMNorthing};
-    }
-
-    public double[] shcj_to_wgs84(double x, double y) {
-        double[] xy = new double[2];
-        xy = shcj_to_utm4(x, y);
-        return shcj_get_WGS_from_UTM(xy[0], xy[1]);
-    }
-
-    public double[] shcj_to_utm4(double x, double y) {
-        double DX = 499999.90104;
-        double DY = 3455696.403019;
-        double T = -0.0000001755;
-        double K = 0.999600149344;
-        return covert_by_four_parm(x, y, DX, DY, T, K);
-    }
-
-    public double[] covert_by_four_parm(double x, double y, double dx, double dy, double a, double k) {
-        double px = x * k * Math.cos(a) - y * k * Math.sin(a) + dx;
-        double py = x * k * Math.sin(a) + y * k * Math.cos(a) + dy;
-        return new double[]{px, py};
-    }
-
-    public double[] shcj_get_WGS_from_UTM(double x, double y) {
-        double a = 6378137;
-        double b = 6356752.3142451;
-        x = 500000 - x;
-        double k0 = 0.9996;
-        double e = Math.sqrt(1 - Math.pow(b, 2) / Math.pow(a, 2));
-        double M = y / k0;
-        double mu = M / (a * (1 - Math.pow(e, 2) / 4 - (3 * Math.pow(e, 4)) / 64 - (5 * Math.pow(e, 6)) / 256));
-        double e1 = (1 - Math.pow(1 - Math.pow(e, 2), 1.0 / 2)) / (1 + Math.pow(1 - Math.pow(e, 2), 1.0 / 2));
-        double J1 = (3 * e1) / 2 - (27 * Math.pow(e1, 3)) / 32;
-        double J2 = (21 * Math.pow(e1, 2)) / 16 - (55 * Math.pow(e1, 4)) / 32;
-        double J3 = (151 * Math.pow(e1, 3)) / 96;
-        double J4 = (1097 * Math.pow(e1, 4)) / 512;
-        double fp = mu + J1 * Math.sin(2 * mu) + J2 * Math.sin(4 * mu) + J3 * Math.sin(6 * mu) + J4 * Math.sin(8 * mu);
-        double e2 = Math.pow(e, 2) / (1 - Math.pow(e, 2));
-        double C1 = e2 * Math.pow(Math.cos(fp), 2);
-        double T1 = Math.pow(Math.tan(fp), 2);
-        double R1 = (a * (1 - Math.pow(e, 2))) / Math.pow(1 - Math.pow(e * Math.sin(fp), 2), 3.0 / 2);
-        double N1 = a / Math.pow(1 - Math.pow(e * Math.sin(fp), 2), 1.0 / 2);
-        double D = x / (N1 * k0);
-        double Q1 = (N1 * Math.tan(fp)) / R1;
-        double Q2 = Math.pow(D, 2) / 2;
-        double Q3 = ((5 + 3 * T1 + 10 * C1 - 4 * Math.pow(C1, 2) - 9 * e2) * Math.pow(D, 4)) / 24;
-        double Q4 = ((61 + 90 * T1 + 298 * C1 + 45 * Math.pow(T1, 2) - 3 * Math.pow(C1, 2) - 252 * e2) * Math.pow(D, 6)) / 720;
-        double lat = ((fp - Q1 * (Q2 - Q3 + Q4)) * 180) / PI;
-        double Q5 = D;
-        double Q6 = ((1 + 2 * T1 + C1) * Math.pow(D, 3)) / 6;
-        double Q7 = ((5 - 2 * C1 + 28 * T1 - 3 * Math.pow(C1, 2) + 8 * e2 + 24 * Math.pow(T1, 2)) * Math.pow(D, 5)) / 120;
-        double lonmid = 121.46714714;
-        double lon = lonmid - (((Q5 - Q6 + Q7) / Math.cos(fp)) * 180) / PI;
-        return new double[]{lon, lat};
-    }
-
-    public double[] wgs84_to_bd09(double x, double y) {
-        double[] ll = wgs84_to_gcj02(x, y);
-        ll = gcj02_to_bd09(ll[0], ll[1]);
-        return ll;
-    }
-
-    public double[] bd09_to_wgs84(double x, double y) {
-        double[] ll = bd09_to_gcj02(x, y);
-        ll = gcj02_to_wgs84(ll[0], ll[1]);
-        return ll;
-    }
-
-    public double[] gcj02_to_shcj(double x, double y) {
-        double[] ll = gcj02_to_wgs84(x, y);
-        ll = wgs84_to_shcj(ll[0], ll[1]);
-        return ll;
-    }
-
-    public double[] shcj_to_gcj02(double x, double y) {
-        double[] ll = shcj_to_wgs84(x, y);
-        ll = wgs84_to_gcj02(ll[0], ll[1]);
-        return ll;
-    }
-
-    public double[] convert_proj_from_to(Projs from, Projs to, double[] xy) {
-        if (from == to) {
-            return xy;
-        } else {
-            String fromProj = from.toString().toLowerCase();
-            String toProj = to.toString().toLowerCase();
-            String targetMethod = fromProj + "_to_" + toProj;
-            try {
-                return (double[]) this.getClass().getMethod(targetMethod, double.class, double.class).invoke(this, xy[0], xy[1]);
-            } catch (IllegalAccessException e) {
-                throw new RuntimeException(e);
-            } catch (InvocationTargetException e) {
-                throw new RuntimeException(e);
-            } catch (NoSuchMethodException e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    public double[] WGS84ToSH2000(double lng, double lat) {
-        if (out_of_sh(lng, lat)) {
-            return new double[]{lng, lat};
-        } else {
-            double[] templatlng = wgs84_to_shcj(lng, lat);
-            templatlng = meter_to_degree(templatlng[0], templatlng[1]);
-            return new double[]{templatlng[0], templatlng[1]};
-        }
-    }
-
-    public double[] SH2000ToWGS84(double x, double y) {
-        double[] templatlng = meter_to_degree(x, y);
-        if (out_of_sh2000(templatlng[0], templatlng[1])) {
-            return new double[]{x, y};
-        } else {
-            templatlng = shcj_to_wgs84(x, y);
-            return templatlng;
-        }
-    }
-
-    public double[] SH2000lnglatToWGS84(double lng, double lat) {
-        if (out_of_sh2000(lng, lat)) {
-            return new double[]{lng, lat};
-        } else {
-            double[] templatlng = degree_to_meter(lng, lat);
-            templatlng = shcj_to_wgs84(templatlng[0], templatlng[1]);
-            return templatlng;
-        }
-    }
-
-    private boolean out_of_sh(double lng, double lat) {
-        // 实现out_of_sh方法
-        return false;
-    }
-
-    private boolean out_of_sh2000(double lng, double lat) {
-        // 实现out_of_sh2000方法
-        return false;
-    }
-
-    public double[] wgs84_to_shcj(double x, double y) {
-        double[] xy = new double[2];
-        xy = shcj_get_UTM_from_WGS(x, y);
-        return utm_to_shcj4(xy[0], xy[1]);
-    }
-
-
-    public double[] BD09ToGCJ02(double lng, double lat) {
-        double x = lng - 0.0065;
-        double y = lat - 0.006;
-        double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * BD_FACTOR);
-        double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * BD_FACTOR);
-        double gg_lng = z * Math.cos(theta);
-        double gg_lat = z * Math.sin(theta);
-        return new double[]{gg_lng, gg_lat};
-    }
-
-    public double[] GCJ02ToBD09(double lng, double lat) {
-        lat = +lat;
-        lng = +lng;
-        double z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * BD_FACTOR);
-        double theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * BD_FACTOR);
-        double bd_lng = z * Math.cos(theta) + 0.0065;
-        double bd_lat = z * Math.sin(theta) + 0.006;
-        return new double[]{bd_lng, bd_lat};
-    }
-
-    public double[] WGS84ToBD09(double lng, double lat) {
-        double[] GCJ02latlng = WGS84ToGCJ02(lng, lat);
-        double[] BD09latlng = GCJ02ToBD09(GCJ02latlng[0], GCJ02latlng[1]);
-        return BD09latlng;
-    }
-
-    public double[] BD09ToWGS84(double lng, double lat) {
-        double[] GCJ02latlng = BD09ToGCJ02(lng, lat);
-        double[] wgslatlng = GCJ02ToWGS84(GCJ02latlng[0], GCJ02latlng[1]);
-        return wgslatlng;
-    }
-
-    public double[] WGS84ToGCJ02(double lng, double lat) {
-        lat = +lat;
-        lng = +lng;
-        if (out_of_china(lng, lat)) {
-            return new double[]{lng, lat};
-        } else {
-            double[] d = delta(lng, lat);
-            return new double[]{lng + d[0], lat + d[1]};
-        }
-    }
-
-    public double[] GCJ02ToWGS84(double lng, double lat) {
-        lat = +lat;
-        lng = +lng;
-        if (out_of_china(lng, lat)) {
-            return new double[]{lng, lat};
-        } else {
-            double[] d = delta(lng, lat);
-            double mgLng = lng + d[0];
-            double mgLat = lat + d[1];
-            return new double[]{lng * 2 - mgLng, lat * 2 - mgLat};
-        }
-    }
-
-    private double[] delta(double lng, double lat) {
-        double dLng = transformLng(lng - 105, lat - 35);
-        double dLat = transformLat(lng - 105, lat - 35);
-        double radLat = (lat / 180) * PI;
-        double magic = Math.sin(radLat);
-        magic = 1 - EE * magic * magic;
-        double sqrtMagic = Math.sqrt(magic);
-        dLng = (dLng * 180) / ((RADIUS / sqrtMagic) * Math.cos(radLat) * PI);
-        dLat = (dLat * 180) / (((RADIUS * (1 - EE)) / (magic * sqrtMagic)) * PI);
-        return new double[]{dLng, dLat};
-    }
-
-    private double transformLng(double lng, double lat) {
-        lat = +lat;
-        lng = +lng;
-        double ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
-        ret += ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0) / 3.0;
-        ret += ((20.0 * Math.sin(lng * PI) + 40.0 * Math.sin((lng / 3.0) * PI)) * 2.0) / 3.0;
-        ret += ((150.0 * Math.sin((lng / 12.0) * PI) + 300.0 * Math.sin((lng / 30.0) * PI)) * 2.0) / 3.0;
-        return ret;
-    }
-
-    private double transformLat(double lng, double lat) {
-        lat = +lat;
-        lng = +lng;
-        double ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
-        ret += ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0) / 3.0;
-        ret += ((20.0 * Math.sin(lat * PI) + 40.0 * Math.sin((lat / 3.0) * PI)) * 2.0) / 3.0;
-        ret += ((160.0 * Math.sin((lat / 12.0) * PI) + 320 * Math.sin((lat * PI) / 30.0)) * 2.0) / 3.0;
-        return ret;
-    }
-
-    private boolean out_of_china(double lng, double lat) {
-        lat = +lat;
-        lng = +lng;
-        return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55);
-    }
-
-    private CRSFactory crsFactory = new CRSFactory();
-
-    // 定义84坐标系
-    private String wgs84Str = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
-    //    private CoordinateReferenceSystem wgs84 = crsFactory.createFromParameters(
-//            "WGS84", wgs84Str);
-    private CoordinateReferenceSystem wgs84 =
-            crsFactory.createFromName("EPSG:4326");
-
-    // 定义CGCS2000坐标系
-    private String cgcs2000Str = "+proj=utm +zone=50 +ellps=GRS80 +units=m +no_defs";
-    //    private CoordinateReferenceSystem cgcs2000 = crsFactory.createFromParameters(
-//            "CGCS2000", cgcs2000Str);
-    private CoordinateReferenceSystem cgcs2000 =
-            crsFactory.createFromName("EPSG:4490");
-
-    public double[] gcj02_to_wgs84(double lng, double lat) {
-        if (out_of_china(lng, lat)) {
-            return new double[]{lng, lat};
-        } else {
-            double dlat = transformlat(lng - 105.0, lat - 35.0);
-            double dlng = transformlng(lng - 105.0, lat - 35.0);
-            double radlat = (lat / 180.0) * Math.PI;
-            double magic = Math.sin(radlat);
-            magic = 1 - EE * magic * magic;
-            double sqrtmagic = Math.sqrt(magic);
-            dlat = (dlat * 180.0) / (((A * (1 - EE)) / (magic * sqrtmagic)) * Math.PI);
-            dlng = (dlng * 180.0) / ((A / sqrtmagic) * Math.cos(radlat) * Math.PI);
-            double mglat = lat + dlat;
-            double mglng = lng + dlng;
-            return new double[]{lng * 2 - mglng, lat * 2 - mglat};
-        }
-    }
-
-    public double transformlng(double lng, double lat) {
-        double ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
-        ret += ((20.0 * Math.sin(6.0 * lng * Math.PI) + 20.0 * Math.sin(2.0 * lng * Math.PI)) * 2.0) / 3.0;
-        ret += ((20.0 * Math.sin(lng * Math.PI) + 40.0 * Math.sin((lng / 3.0) * Math.PI)) * 2.0) / 3.0;
-        ret += ((150.0 * Math.sin((lng / 12.0) * Math.PI) + 300.0 * Math.sin((lng / 30.0) * Math.PI)) * 2.0) / 3.0;
-        return ret;
-    }
-
-    public double transformlat(double lng, double lat) {
-        double ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
-        ret += ((20.0 * Math.sin(6.0 * lng * Math.PI) + 20.0 * Math.sin(2.0 * lng * Math.PI)) * 2.0) / 3.0;
-        ret += ((20.0 * Math.sin(lat * Math.PI) + 40.0 * Math.sin((lat / 3.0) * Math.PI)) * 2.0) / 3.0;
-        ret += ((160.0 * Math.sin((lat / 12.0) * Math.PI) + 320 * Math.sin((lat * Math.PI) / 30.0)) * 2.0) / 3.0;
-        return ret;
-    }
-
-    public double[] wgs84ToCGCS2000(double lng, double lat) {
-
-        // 定义WGS84坐标点
-        ProjCoordinate wgs84Point = new ProjCoordinate(lng, lat);
-
-        // 将WGS84坐标点转换为CGCS2000坐标点
-        ProjCoordinate cgcs2000Point = new ProjCoordinate();
-
-        // 创建坐标转换器
-        CoordinateTransformFactory ctf = new CoordinateTransformFactory();
-        CoordinateTransform transform = ctf.createTransform(wgs84, cgcs2000);
-
-        transform.transform(wgs84Point, cgcs2000Point);
-        System.out.println(cgcs2000Point.x + "," + cgcs2000Point.y);
-        return new double[]{cgcs2000Point.x, cgcs2000Point.y};
-    }
-
-    public double[] cgcs2000ToWGS84(double lng, double lat) {
-        // 定义CGCS2000坐标点
-        ProjCoordinate cgcs2000Point = new ProjCoordinate(lng, lat);
-
-        // 将CGCS2000坐标点转换为WGS84坐标点
-        ProjCoordinate wgs84Point = new ProjCoordinate();
-
-        // 创建坐标转换器
-        CoordinateTransformFactory ctf = new CoordinateTransformFactory();
-        CoordinateTransform transform = ctf.createTransform(cgcs2000, wgs84);
-
-        transform.transform(cgcs2000Point, wgs84Point);
-        System.out.println(wgs84Point.x + "," + wgs84Point.y);
-        return new double[]{wgs84Point.x, wgs84Point.y};
-    }
-
-}

+ 0 - 93
src/main/java/com/skyversation/poiaddr/util/CsvWriter.java

@@ -1,93 +0,0 @@
-package com.skyversation.poiaddr.util;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.*;
-
-public class CsvWriter {
-    /**
-     * 将 List<Map<String, Object>> 类型的数据写入 CSV 文件
-     * @param data 要写入的数据
-     * @param filePath CSV 文件的保存路径
-     * @throws IOException 如果写入文件时发生 I/O 错误
-     */
-    public static void writeToCsv(List<Map<String, Object>> data, String filePath) throws IOException {
-        if (data == null || data.isEmpty()) {
-            return;
-        }
-
-        // 获取所有的列名
-        Set<String> headers = new LinkedHashSet<>();
-        for (Map<String, Object> row : data) {
-            headers.addAll(row.keySet());
-        }
-
-        // 将列名写入 CSV 文件
-        try (FileWriter writer = new FileWriter(filePath)) {
-            writeLine(writer, new ArrayList<>(headers));
-
-            // 遍历数据,将每一行写入 CSV 文件
-            for (Map<String, Object> row : data) {
-                List<String> values = new ArrayList<>();
-                for (String header : headers) {
-                    Object value = row.get(header);
-                    values.add(value != null ? value.toString() : "");
-                }
-                writeLine(writer, values);
-            }
-        }
-    }
-
-    /**
-     * 将一行数据写入 CSV 文件
-     * @param writer 文件写入器
-     * @param values 一行数据的值
-     * @throws IOException 如果写入文件时发生 I/O 错误
-     */
-    private static void writeLine(FileWriter writer, List<String> values) throws IOException {
-        boolean firstValue = true;
-        for (String value : values) {
-            if (!firstValue) {
-                writer.append(",");
-            }
-            writer.append(escapeCsv(value));
-            firstValue = false;
-        }
-        writer.append("\n");
-    }
-
-    /**
-     * 转义 CSV 中的特殊字符
-     * @param value 要转义的值
-     * @return 转义后的字符串
-     */
-    private static String escapeCsv(String value) {
-        if (value == null) {
-            return "";
-        }
-        boolean needsQuotes = value.contains(",") || value.contains("\"") || value.contains("\n");
-        if (needsQuotes) {
-            value = value.replace("\"", "\"\"");
-            return "\"" + value + "\"";
-        }
-        return value;
-    }
-
-    public static void main(String[] args) {
-        List<Map<String, Object>> data = new ArrayList<>();
-        Map<String,Object> item = new HashMap<>();
-        item.put("列名1","test00");
-        item.put("列名3","test02");
-        Map<String,Object> item2 = new HashMap<>();
-        item2.put("列名2","test11");
-        item2.put("列名3","test12");
-        data.add(item);
-        data.add(item2);
-        // 这里可以添加测试数据
-        try {
-            writeToCsv(data, "C:\\Users\\Liumouren\\Desktop\\outputTest.csv");
-            System.out.println("CSV 文件写入成功!");
-        } catch (IOException e) {
-            System.err.println("写入 CSV 文件时发生错误:" + e.getMessage());
-        }
-    }
-}

+ 0 - 347
src/main/java/com/skyversation/poiaddr/util/ExcelReaderUtils.java

@@ -1,347 +0,0 @@
-package com.skyversation.poiaddr.util;
-
-import com.skyversation.poiaddr.addquery.Constant;
-import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.ss.usermodel.*;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.*;
-
-import org.apache.poi.util.IOUtils;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-
-import java.io.FileOutputStream;
-
-/**
- * xlsx文档解析并输出内容为List<Map<String,String>>
- * 大文件分割
- */
-public class ExcelReaderUtils {
-
-    public static void writeToExcel(List<Map<String, Object>> dataList, String filePath) throws IOException {
-        // 创建一个新的工作簿(对应一个Excel文件)
-        Workbook workbook = new XSSFWorkbook();
-        // 创建一个工作表
-        Sheet sheet = workbook.createSheet("Sheet1");
-
-        // 写入表头(从Map的键中获取列名)
-        if (!dataList.isEmpty()) {
-            Map<String, Object> firstMap = dataList.get(0);
-            int colIndex = 0;
-            Row headerRow = sheet.createRow(0);
-            for (String key : firstMap.keySet()) {
-                Cell cell = headerRow.createCell(colIndex++);
-                cell.setCellValue(key);
-            }
-        }
-
-        // 逐行写入数据
-        int rowIndex = 1;
-        for (Map<String, Object> dataMap : dataList) {
-            Row dataRow = sheet.createRow(rowIndex++);
-            int colIndex = 0;
-            for (Object value : dataMap.values()) {
-                Cell cell = dataRow.createCell(colIndex++);
-                if (value instanceof String) {
-                    cell.setCellValue((String) value);
-                } else if (value instanceof Integer) {
-                    cell.setCellValue((Integer) value);
-                } else if (value instanceof Double) {
-                    cell.setCellValue((Double) value);
-                } else if (value instanceof Boolean) {
-                    cell.setCellValue((Boolean) value);
-                } else {
-                    cell.setCellValue(value != null ? value.toString() : "");
-                }
-            }
-        }
-
-        // 将工作簿写入到文件
-        try (FileOutputStream outputStream = new FileOutputStream(filePath)) {
-            workbook.write(outputStream);
-        } finally {
-            workbook.close();
-        }
-    }
-
-    public static List<Map<String, Object>> readExcel(String filePath) throws IOException {
-        List<Map<String, Object>> resultList = new ArrayList<>();
-        FileInputStream fis = new FileInputStream(filePath);
-        IOUtils.setByteArrayMaxOverride(400000000);
-        // 创建工作簿对象,用于代表整个Excel文件
-        Workbook workbook = WorkbookFactory.create(fis);
-        // 这里我们默认读取第一个工作表,如果需要读取指定名称或者索引的工作表可以进行相应修改
-        Sheet sheet = workbook.getSheetAt(0);
-        // 获取表头行
-        Row headerRow = sheet.getRow(0);
-        int headerSize = headerRow.getLastCellNum();
-
-        // 遍历数据行(从第二行开始,第一行是表头)
-        for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
-            Row currentRow = sheet.getRow(rowIndex);
-            Map<String, Object> rowMap = new HashMap<>();
-            for (int cellIndex = 0; cellIndex < headerSize; cellIndex++) {
-                Cell headerCell = headerRow.getCell(cellIndex);
-                Cell currentCell = currentRow.getCell(cellIndex);
-                String headerValue = getCellValue(headerCell).toString();
-                Object currentValue = getCellValue(currentCell);
-                rowMap.put(headerValue, currentValue);
-            }
-            resultList.add(rowMap);
-        }
-
-        workbook.close();
-        fis.close();
-        return resultList;
-    }
-
-
-    public static List<Map<String, Object>> readExcel(File file) throws IOException {
-        List<Map<String, Object>> resultList = new ArrayList<>();
-        FileInputStream fis = new FileInputStream(file);
-        IOUtils.setByteArrayMaxOverride(400000000);
-        // 创建工作簿对象,用于代表整个Excel文件
-        Workbook workbook = WorkbookFactory.create(fis);
-        // 这里我们默认读取第一个工作表,如果需要读取指定名称或者索引的工作表可以进行相应修改
-        Sheet sheet = workbook.getSheetAt(0);
-        // 获取表头行
-        Row headerRow = sheet.getRow(0);
-        int headerSize = headerRow.getLastCellNum();
-
-        // 遍历数据行(从第二行开始,第一行是表头)
-        for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
-            Row currentRow = sheet.getRow(rowIndex);
-            Map<String, Object> rowMap = new HashMap<>();
-            for (int cellIndex = 0; cellIndex < headerSize; cellIndex++) {
-                Cell headerCell = headerRow.getCell(cellIndex);
-                Cell currentCell = currentRow.getCell(cellIndex);
-                String headerValue = getCellValue(headerCell).toString();
-                Object currentValue = getCellValue(currentCell);
-                rowMap.put(headerValue, currentValue);
-            }
-            resultList.add(rowMap);
-        }
-
-        workbook.close();
-        fis.close();
-        return resultList;
-    }
-
-    public static void splitExcelByRows(String inputFilePath, int rowsPerFile) throws IOException {
-        FileInputStream inputStream = new FileInputStream(new File(inputFilePath));
-        IOUtils.setByteArrayMaxOverride(400000000);
-        Workbook workbook = new XSSFWorkbook(inputStream);
-        Sheet sheet = workbook.getSheetAt(0);
-
-        int totalRows = sheet.getLastRowNum() + 1;
-        int fileCount = (totalRows / rowsPerFile) + (totalRows % rowsPerFile == 0 ? 0 : 1);
-
-        for (int i = 0; i < fileCount; i++) {
-            Workbook newWorkbook = new XSSFWorkbook();
-            Sheet newSheet = newWorkbook.createSheet("Sheet1");
-            int startRow = i * rowsPerFile;
-            int endRow = Math.min((i + 1) * rowsPerFile, totalRows);
-
-            for (int rowIndex = startRow; rowIndex < endRow; rowIndex++) {
-                Row sourceRow = sheet.getRow(rowIndex);
-                Row newRow = newSheet.createRow(rowIndex - startRow);
-                if (sourceRow != null) {
-                    for (int cellIndex = 0; cellIndex < sourceRow.getLastCellNum(); cellIndex++) {
-                        Cell sourceCell = sourceRow.getCell(cellIndex);
-                        Cell newCell = newRow.createCell(cellIndex);
-                        if (sourceCell != null) {
-                            switch (sourceCell.getCellType()) {
-                                case STRING:
-                                    newCell.setCellValue(sourceCell.getStringCellValue());
-                                    break;
-                                case NUMERIC:
-                                    newCell.setCellValue(sourceCell.getNumericCellValue());
-                                    break;
-                                case BOOLEAN:
-                                    newCell.setCellValue(sourceCell.getBooleanCellValue());
-                                    break;
-                                // 可以根据实际情况添加更多的类型处理,比如日期等
-                                default:
-                                    newCell.setCellValue("");
-                            }
-                        }
-                    }
-                }
-            }
-
-            String outputFilePath = getOutputFilePath(inputFilePath, i);
-            FileOutputStream outputStream = new FileOutputStream(outputFilePath);
-            newWorkbook.write(outputStream);
-            outputStream.close();
-            newWorkbook.close();
-        }
-
-        workbook.close();
-        inputStream.close();
-    }
-
-    private static String getOutputFilePath(String inputFilePath, int index) {
-        String baseName = inputFilePath.substring(0, inputFilePath.lastIndexOf('.'));
-        String extension = inputFilePath.substring(inputFilePath.lastIndexOf('.'));
-        return baseName + "_part_" + (index + 1) + extension;
-    }
-
-    private static String getCellValueAsString(Cell cell) {
-        switch (cell.getCellType()) {
-            case STRING:
-                return cell.getStringCellValue();
-            case NUMERIC:
-                if (DateUtil.isCellDateFormatted(cell)) {
-                    return cell.getDateCellValue().toString();
-                } else {
-                    return String.valueOf(cell.getNumericCellValue());
-                }
-            case BOOLEAN:
-                return String.valueOf(cell.getBooleanCellValue());
-            case FORMULA:
-                try {
-                    return cell.getCellFormula();
-                } catch (Exception e) {
-                    return "";
-                }
-            default:
-                return "";
-        }
-    }
-
-    private static void XlsxFileSplitByRowRange(String filePath, int tag) {
-        try {
-            // 读取原始xlsx文件
-            Workbook workbook = new XSSFWorkbook(new File(filePath));
-            Sheet sheet = workbook.getSheetAt(0);
-            int totalRows = sheet.getLastRowNum();
-            int rowsPerFile = 10000; // 每个分割文件包含的行数
-            for (int i = 0; i <= totalRows; i += rowsPerFile) {
-                // 创建新的工作簿用于保存分割后的行数据
-                Workbook newWorkbook = new XSSFWorkbook();
-                Sheet newSheet = newWorkbook.createSheet();
-                int endRow = Math.min(i + rowsPerFile, totalRows + 1);
-                for (int j = i; j < endRow; j++) {
-                    Row row = sheet.getRow(j);
-                    if (row != null) {
-                        Row newRow = newSheet.createRow(j - i);
-                        for (Cell cell : row) {
-                            if (cell != null) {
-                                Cell newCell = newRow.createCell(cell.getColumnIndex());
-                                // 复制单元格类型和值
-                                newCell.setCellType(cell.getCellType());
-                                if (cell.getCellType() == CellType.STRING) {
-                                    newCell.setCellValue(cell.getStringCellValue());
-                                } else if (cell.getCellType() == CellType.NUMERIC) {
-                                    newCell.setCellValue(cell.getNumericCellValue());
-                                } else if (cell.getCellType() == CellType.BOOLEAN) {
-                                    newCell.setCellValue(cell.getBooleanCellValue());
-                                }
-                            }
-                        }
-                    }
-                }
-                // 将分割后的行数据保存为新的xlsx文件
-                FileOutputStream outputStream = new FileOutputStream("C:\\Users\\Liumouren\\Desktop\\临时文件\\元以科技\\青浦\\青浦城建所\\poiAddr\\doc\\output_" + tag + "_" + (i / rowsPerFile) + ".xlsx");
-                newWorkbook.write(outputStream);
-                outputStream.close();
-                newWorkbook.close();
-            }
-            workbook.close();
-        } catch (IOException | InvalidFormatException e) {
-            e.printStackTrace();
-        }
-    }
-
-    private static Object getCellValue(Cell cell) {
-        if (cell == null) {
-            return null;
-        }
-        CellType cellType = cell.getCellType();
-        switch (cellType) {
-            case STRING:
-                return cell.getStringCellValue();
-            case NUMERIC:
-                if (DateUtil.isCellDateFormatted(cell)) {
-                    return cell.getDateCellValue();
-                } else {
-                    return cell.getNumericCellValue();
-                }
-            case BOOLEAN:
-                return cell.getBooleanCellValue();
-            case FORMULA:
-                return cell.getCellFormula();
-            default:
-                return null;
-        }
-    }
-
-    public static List<File> listFilesInDirectory(String path) {
-        List<File> fileList = new ArrayList<>();
-        File directory = new File(path);
-        // 首先判断给定的路径是否是一个目录
-        if (directory.isDirectory()) {
-            File[] files = directory.listFiles();
-            if (files != null) {
-                for (File file : files) {
-                    if (file.isFile()) {
-                        fileList.add(file);
-                    } else if (file.isDirectory()) {
-                        // 如果是子目录,递归调用获取子目录下的文件
-                        fileList.addAll(listFilesInDirectory(file.getAbsolutePath()));
-                    }
-                }
-            }
-        }
-        return fileList;
-    }
-
-    public static boolean isOtherDistrictThanQingpu(String address) {
-        // 将地址字符串转换为小写,以便进行不区分大小写的比较
-        String lowerCaseAddress = address.toLowerCase();
-        // 检查地址是否包含 "青浦区" 字样,如果不包含,则可能是其他区
-        // 列出上海市的其他区(已补充完整)
-        String[] otherDistricts = {"黄浦区", "徐汇区", "长宁区", "静安区", "普陀区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "金山区", ("青浦".equals(Constant.getArea()) ? "松江区" : "青浦区"), "奉贤区", "崇明区", "浦东新区"};
-        for (String district : otherDistricts) {
-            if (lowerCaseAddress.contains(district.toLowerCase())) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-
-    public static boolean isOtherDistrictThanSongJiang(String address) {
-        // 将地址字符串转换为小写,以便进行不区分大小写的比较
-        String lowerCaseAddress = address.toLowerCase();
-        // 检查地址是否包含 "青浦区" 字样,如果不包含,则可能是其他区
-        // 列出上海市的其他区(已补充完整)
-        String[] otherDistricts = {"黄浦区", "徐汇区", "长宁区", "静安区", "普陀区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "金山区", "青浦区", "奉贤区", "崇明区", "浦东新区"};
-        for (String district : otherDistricts) {
-            if (lowerCaseAddress.contains(district.toLowerCase())) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /*public static void main(String[] args) {
-//        根据Map字段修改表头
-//        ModifyExcelHeaderJExcelApi();
-        //          根据文件路径得到下面的所有文件集合
-        List<File> fileList = listFilesInDirectory("C:\\Users\\Liumouren\\Desktop\\临时文件\\元以科技\\青浦\\青浦城建所\\poiAddr\\doc\\");
-//            TODO 所有文件加入
-        int tagIndex = 0;
-        for (File fileItem : fileList) {
-            if (fileItem.getPath().contains(".xlsx") && fileItem.getPath().contains("marge_excel_uuid")) {
-                System.out.println(fileItem.getPath());
-                tagIndex++;
-//                分割文件
-                XlsxFileSplitByRowRange(fileItem.getPath(), tagIndex);
-            }
-        }
-        System.exit(0);
-    }*/
-}

+ 0 - 45
src/main/java/com/skyversation/poiaddr/util/SerializationUtils.java

@@ -1,45 +0,0 @@
-package com.skyversation.poiaddr.util;
-import com.skyversation.poiaddr.entity.FileDataDto;
-
-import java.io.*;
-import java.util.List;
-
-public class SerializationUtils {
-
-    /**
-     * 将 List<T> 序列化并保存到本地文件
-     * @param list 要序列化的 List
-     * @param filePath 保存文件的路径
-     * @param <T> 泛型类型
-     */
-    public static <T extends Serializable> void serialize(List<T> list, String filePath) {
-        try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(filePath))) {
-            oos.writeObject(list);
-            System.out.println("数据已成功序列化并保存到 " + filePath);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * 从本地文件中反序列化读取 List<T>
-     * @param filePath 读取文件的路径
-     * @param <T> 泛型类型
-     * @return 反序列化后的 List
-     */
-    @SuppressWarnings("unchecked")
-    public static <T extends Serializable> List<T> deserialize(String filePath) {
-        List<T> list = null;
-        try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filePath))) {
-            list = (List<T>) ois.readObject();
-            System.out.println("数据已成功从 " + filePath + " 反序列化");
-        } catch (IOException | ClassNotFoundException e) {
-            e.printStackTrace();
-        }
-        return list;
-    }
-
-    public static void main(String[] args) {
-        System.out.println(Runtime.getRuntime().availableProcessors());
-    }
-}

+ 0 - 62
src/main/java/com/skyversation/poiaddr/util/dms/DmsTools.java

@@ -1,62 +0,0 @@
-package com.skyversation.poiaddr.util.dms;
-
-import com.skyversation.poiaddr.addquery.Constant;
-import com.skyversation.poiaddr.util.RequestUtils;
-import org.json.JSONArray;
-import org.json.simple.JSONObject;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class DmsTools {
-    public static String DmsToken;
-
-    //  登录操作,请求token
-    public static String getDmsToken() {
-        JSONObject resultObject = RequestUtils.requestPost(Constant.Oauth_login_URL, null, null);
-        if (resultObject != null && resultObject.containsKey("message") && resultObject.get("message") != null) {
-            DmsToken = resultObject.get("message").toString();
-        }
-        return DmsToken;
-    }
-
-    public static JSONObject selectDms(String columnId) {
-        Map<String, String> headers = new HashMap<>();
-        if (DmsToken != null && DmsToken.length() > 0) {
-            headers.put("Token", DmsToken);
-        } else {
-            headers.put("Token", getDmsToken());
-        }
-        Map<String, String> formDatas = new HashMap<>();
-        formDatas.put("columnId", columnId);
-        formDatas.put("states", "0");
-        formDatas.put("pageSize", "9999");
-        formDatas.put("page", "0");
-        return RequestUtils.requestPost(Constant.DMS_selectContentList_URL, headers, formDatas);
-    }
-
-    public static JSONObject addContent(org.json.JSONObject formDatas) {
-        Map<String, String> headers = new HashMap<>();
-        if (DmsToken != null && DmsToken.length() > 0) {
-            headers.put("Token", DmsToken);
-        } else {
-            headers.put("Token", getDmsToken());
-        }
-        return RequestUtils.requestPost2(Constant.DMS_addContent_URL, headers, formDatas);
-    }
-
-    public static JSONObject updateContent(org.json.JSONObject formDatas) {
-        Map<String, String> headers = new HashMap<>();
-        if (DmsToken != null && DmsToken.length() > 0) {
-            headers.put("Token", DmsToken);
-        } else {
-            headers.put("Token", getDmsToken());
-        }
-        return RequestUtils.requestPost2(Constant.DMS_updateContent_URL, headers, formDatas);
-    }
-}

+ 0 - 200
src/main/java/com/skyversation/poiaddr/util/fileTools/ReadFileData.java

@@ -1,200 +0,0 @@
-package com.skyversation.poiaddr.util.fileTools;
-
-import com.skyversation.poiaddr.entity.FeatureDiy;
-import com.skyversation.poiaddr.entity.FileDataDto;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.opencsv.CSVReader;
-import com.opencsv.exceptions.CsvException;
-import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.util.IOUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 文件内容解析
- */
-public class ReadFileData {
-    //    文件内容解析
-    public static List<FileDataDto> ReadMultipartFile(MultipartFile multipartFile) throws IOException {
-        List<FileDataDto> fileDataDtoList = new ArrayList<>();
-//      首先判断文件类型,走不同的解析方法
-        String fileName = multipartFile.getOriginalFilename();
-        assert fileName != null;
-        String extension = fileName.substring(fileName.lastIndexOf(".") + 1);
-        extension = extension.toLowerCase();
-        // 创建临时文件
-        File file = convert(multipartFile);
-        if ("geojson".equals(extension) || "json".equals(extension)) {
-            fileDataDtoList = readGeojson(file);
-        } else if ("csv".equals(extension)) {
-            fileDataDtoList = readCsv(file);
-        } else if ("xlsx".equals(extension) || "xls".equals(extension)) {
-            fileDataDtoList = readExcel(file);
-        }
-        return fileDataDtoList;
-    }
-
-    public static List<FileDataDto> readGeojson(File file) throws IOException {
-        List<FileDataDto> resultList = new ArrayList<>();
-        ObjectMapper mapper = new ObjectMapper();
-        List<FeatureDiy> features = mapper.readValue(file, new TypeReference<List<FeatureDiy>>() {
-        });
-        for (FeatureDiy featureDiy : features) {
-            FileDataDto fileDataDto = new FileDataDto();
-            fileDataDto.setGeometry(featureDiy.getGeometry());
-            fileDataDto.setProperties(featureDiy.getProperties());
-            resultList.add(fileDataDto);
-        }
-        return resultList;
-    }
-
-    //    csv文件内容解析
-    public static List<FileDataDto> readCsv(File file) {
-        List<FileDataDto> resultList = new ArrayList<>();
-        try {
-            // 读取CSV文件
-            CSVReader reader = new CSVReader(new FileReader(file));
-            List<String[]> csvData = reader.readAll();
-            reader.close();
-            String[] headers = new String[]{};
-            int index = 0;
-            for (String[] row : csvData) {
-                int rowSize = row.length;
-                if (index == 0) {
-                    headers = new String[rowSize];
-                    for (int i = 0; i < rowSize; i++) {
-                        headers[i] = row[i];
-                    }
-                } else {
-                    FileDataDto fileDataDto = new FileDataDto();
-                    Map<String, Object> colData = new HashMap<>();
-                    for (int i = 0; i < rowSize; i++) {
-                        colData.put(headers[i], row[i]);
-                    }
-                    fileDataDto.setProperties(colData);
-                    resultList.add(fileDataDto);
-                }
-                index++;
-            }
-        } catch (IOException | CsvException e) {
-            e.printStackTrace();
-        }
-        return resultList;
-    }
-
-    //    xlsx文件内容读取
-    public static List<FileDataDto> readExcel(File file) throws IOException {
-        List<FileDataDto> resultList = new ArrayList<>();
-        FileInputStream fis = new FileInputStream(file);
-        IOUtils.setByteArrayMaxOverride(400000000);
-        // 创建工作簿对象,用于代表整个Excel文件
-        Workbook workbook = WorkbookFactory.create(fis);
-        // 这里我们默认读取第一个工作表,如果需要读取指定名称或者索引的工作表可以进行相应修改
-        Sheet sheet = workbook.getSheetAt(0);
-        // 获取表头行
-        Row headerRow = sheet.getRow(0);
-        int headerSize = headerRow.getLastCellNum();
-
-        // 遍历数据行(从第二行开始,第一行是表头)
-        for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
-            FileDataDto fileDataDto = new FileDataDto();
-            Row currentRow = sheet.getRow(rowIndex);
-            Map<String, Object> rowMap = new HashMap<>();
-            for (int cellIndex = 0; cellIndex < headerSize; cellIndex++) {
-                Cell headerCell = headerRow.getCell(cellIndex);
-                Cell currentCell = currentRow.getCell(cellIndex);
-                if (currentCell != null) {
-                    currentCell.setCellType(CellType.STRING);
-                    rowMap.put(getCellValue(headerCell).toString(), getCellValue(currentCell).toString());
-                } else {
-                    rowMap.put(getCellValue(headerCell).toString(), null);
-                }
-            }
-            fileDataDto.setProperties(rowMap);
-            resultList.add(fileDataDto);
-        }
-
-        workbook.close();
-        fis.close();
-        return resultList;
-    }
-
-    //    xlsx行内数据解析
-    private static Object getCellValue(Cell cell) {
-        if (cell == null) {
-            return null;
-        }
-        CellType cellType = cell.getCellType();
-        switch (cellType) {
-            case STRING:
-                return cell.getStringCellValue();
-            case NUMERIC:
-                if (DateUtil.isCellDateFormatted(cell)) {
-                    return cell.getDateCellValue();
-                } else {
-                    return cell.getNumericCellValue();
-                }
-            case BOOLEAN:
-                return cell.getBooleanCellValue();
-            case FORMULA:
-                return cell.getCellFormula();
-            default:
-                return null;
-        }
-    }
-
-    //    文件格式转换
-    public static File convert(MultipartFile multipartFile) throws IOException {
-        // 获取原始文件名
-        String originalFilename = multipartFile.getOriginalFilename();
-        // 获取文件后缀
-        String fileExtension = originalFilename.substring(originalFilename.lastIndexOf("."));
-        // 创建文件对象
-        File convFile = File.createTempFile("temp", fileExtension);
-        // 将 MultipartFile 转换为 Path
-        Path path = Paths.get(convFile.getAbsolutePath());
-        // 复制文件内容
-        Files.copy(multipartFile.getInputStream(), path, StandardCopyOption.REPLACE_EXISTING);
-        return convFile;
-    }
-
-    //    根据文件地址返回文件流
-    public static void outputFile(String filePath, HttpServletResponse response) throws IOException {
-        File file = new File(filePath);
-        if (file.exists()) {
-            // 设置响应头
-            response.setContentType("application/octet-stream");
-            response.setHeader("Content-Disposition", "attachment; filename=\"" + file.getName() + "\"");
-            response.setContentLength((int) file.length());
-
-            // 获取文件输入流
-            try (FileInputStream fis = new FileInputStream(file);
-                 OutputStream os = response.getOutputStream()) {
-                byte[] buffer = new byte[4096];
-                int bytesRead;
-                // 从文件输入流读取数据并写入响应输出流
-                while ((bytesRead = fis.read(buffer)) != -1) {
-                    os.write(buffer, 0, bytesRead);
-                }
-                os.flush();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        } else {
-            // 文件不存在,返回 404 错误
-            response.sendError(HttpServletResponse.SC_NOT_FOUND, "文件未找到");
-        }
-    }
-
-}

+ 0 - 388
src/main/java/com/skyversation/poiaddr/util/geotools/GeoHelpScript.java

@@ -1,388 +0,0 @@
-package com.skyversation.poiaddr.util.geotools;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-
-import java.math.BigDecimal;
-
-/**
- * 坐标系转换工具
- */
-public class GeoHelpScript {
-    /**
-     * 常量定义
-     */
-    private final Double PI = Math.PI;
-    private final Double x_PI = (PI * 3000.0) / 180.0;
-    private final Double ee = 0.00669342162296594323;
-    private final Double a = 6378245.0;
-
-    /**
-     * 主运行方法
-     * geoJson格式坐标系转换
-     * @param fileDataStr  geoJson字符串
-     * @param selectValue  转换前的坐标系名称 {"WGS84(国际通用)", "GCJ02(高德、QQ地图)", "BD09(百度地图)", "上海2000坐标系"}
-     * @param selectValue2 转换后的坐标系名称 {"WGS84(国际通用)", "GCJ02(高德、QQ地图)", "BD09(百度地图)", "上海2000坐标系"}
-     * @return JSONObject
-     * 转换前的坐标系名称和转换后的坐标系名称不能一样
-     */
-    public JSONObject run(String fileDataStr, String selectValue, String selectValue2) {
-        JSONObject fileData = JSONObject.parseObject(fileDataStr);
-            JSONArray features = fileData.getJSONArray("features");
-            for (int i = 0; i < features.size(); i++) {
-                JSONObject feature = (JSONObject) features.get(i);
-                JSONObject geometry = feature.getJSONObject("geometry");
-                JSONArray coordinates = geometry.getJSONArray("coordinates");
-                CoordinateSystemTransformation(coordinates, selectValue, selectValue2);
-            }
-        return fileData;
-    }
-
-    /**
-     * shp格式的坐标系转换
-     * @param fileDataStr shp文件数据
-     * @param selectValue 转换前坐标系 {"WGS84(国际通用)", "GCJ02(高德、QQ地图)", "BD09(百度地图)", "上海2000坐标系"}
-     * @param selectValue2 转换后坐标系 {"WGS84(国际通用)", "GCJ02(高德、QQ地图)", "BD09(百度地图)", "上海2000坐标系"}
-     * @return JSONArray
-     */
-    public JSONArray runShp(String fileDataStr, String selectValue, String selectValue2) {
-        JSONArray fileData = JSONArray.parseArray(fileDataStr);
-        for (int i = 0; i < fileData.size(); i++) {
-            JSONObject feature = fileData.getJSONObject(i);
-            if(feature.containsKey("fileName") && feature.containsKey("dataList")){
-                //      如果是geoJson的zip包格式
-                JSONArray dataList = feature.getJSONArray("dataList");
-                for (int j = 0; j < dataList.size(); j++) {
-                    JSONObject feature2 = dataList.getJSONObject(j);
-                    JSONObject geometry = feature2.getJSONObject("geometry");
-                    JSONArray coordinates = geometry.getJSONArray("coordinates");
-//                  坐标系转换
-                    CoordinateSystemTransformation(coordinates, selectValue, selectValue2);
-                }
-            }else{
-                JSONObject geometry = feature.getJSONObject("geometry");
-                JSONArray coordinates = geometry.getJSONArray("coordinates");
-//                坐标系转换
-                CoordinateSystemTransformation(coordinates, selectValue, selectValue2);
-            }
-        }
-        return fileData;
-    }
-
-    /**
-     * 迭代遍历 coordinates并转换坐标
-     *
-     * @param coordinates
-     */
-    public void CoordinateSystemTransformation(JSONArray coordinates, String selectValue, String selectValue2) {
-        if (coordinates.get(0) instanceof BigDecimal) {
-            Double[] outData;
-            if ("WGS84".equals(selectValue)) {
-                switch (selectValue2) {
-                    case "GCJ02":
-                        outData = wgs84_to_gcj02(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                    case "BD09":
-                        outData = wgs84_to_bd09(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                    case "SH2000":
-                        outData = wgs84_to_shcj(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                }
-            } else if ("GCJ02".equals(selectValue)) {
-                switch (selectValue2) {
-                    case "WGS84":
-                        outData = gcj02_to_wgs84(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                    case "BD09":
-                        outData = gcj02_to_bd09(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                    case "SH2000":
-                        outData = gcj02_to_shcj(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                }
-            } else if ("BD09".equals(selectValue)) {
-                switch (selectValue2) {
-                    case "WGS84":
-                        outData = bd09_to_wgs84(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                    case "GCJ02":
-                        outData = bd09_to_gcj02(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                    case "SH2000":
-                        Double[] lngLat = bd09_to_wgs84(coordinates.getDouble(0), coordinates.getDouble(1));
-                        outData = wgs84_to_shcj(lngLat[0], lngLat[1]);
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                }
-            } else if ("SH2000".equals(selectValue)) {
-                switch (selectValue2) {
-                    case "WGS84":
-                        outData = shcj_to_wgs84(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                    case "BD09":
-                        Double[] lngLat = shcj_to_wgs84(coordinates.getDouble(0), coordinates.getDouble(1));
-                        outData = wgs84_to_bd09(lngLat[0], lngLat[1]);
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                    case "GCJ02":
-                        outData = shcj_to_gcj02(coordinates.getDouble(0), coordinates.getDouble(1));
-                        coordinates.set(0, outData[0]);
-                        coordinates.set(1, outData[1]);
-                        break;
-                }
-            }
-        } else {
-            for (int i = 0; i < coordinates.size(); i++) {
-                JSONArray coordinate = coordinates.getJSONArray(i);
-                CoordinateSystemTransformation(coordinate, selectValue, selectValue2);
-            }
-        }
-    }
-
-    public Double[] wgs84_to_gcj02(Double lng, Double lat) {
-        if (out_of_china(lng, lat)) {
-            return new Double[]{lng, lat};
-        } else {
-            double dlat = transformlat(lng - 105.0, lat - 35.0);
-            double dlng = transformlng(lng - 105.0, lat - 35.0);
-            double radlat = (lat / 180.0) * PI;
-            double magic = Math.sin(radlat);
-            magic = 1 - ee * magic * magic;
-            double sqrtmagic = Math.sqrt(magic);
-            dlat = (dlat * 180.0) / (((a * (1 - ee)) / (magic * sqrtmagic)) * PI);
-            dlng = (dlng * 180.0) / ((a / sqrtmagic) * Math.cos(radlat) * PI);
-            Double[] gg = new Double[2];
-            gg[0] = lng + dlng;
-            gg[1] = lat + dlat;
-            return gg;
-        }
-    }
-
-    public Double[] gcj02_to_wgs84(Double lng, Double lat) {
-        if (out_of_china(lng, lat)) {
-            return new Double[]{lng, lat};
-        } else {
-            double dlat = transformlat(lng - 105.0, lat - 35.0);
-            double dlng = transformlng(lng - 105.0, lat - 35.0);
-            double radlat = (lat / 180.0) * PI;
-            double magic = Math.sin(radlat);
-            magic = 1 - ee * magic * magic;
-            double sqrtmagic = Math.sqrt(magic);
-            dlat = (dlat * 180.0) / (((a * (1 - ee)) / (magic * sqrtmagic)) * PI);
-            dlng = (dlng * 180.0) / ((a / sqrtmagic) * Math.cos(radlat) * PI);
-            Double[] gg = new Double[2];
-            gg[0] = lng - dlng;
-            gg[1] = lat - dlat;
-            return gg;
-        }
-    }
-
-
-    public Double[] wgs84_to_shcj(Double x, Double y) {
-        Double[] xy = shcj_get_UTM_from_WGS(x, y);
-        return utm_to_shcj4(xy[0], xy[1]);
-    }
-
-    public Double[] shcj_to_wgs84(Double x, Double y) {
-        Double[] xy = shcj_to_utm4(x, y);
-        return shcj_get_WGS_from_UTM(xy[0], xy[1]);
-    }
-
-    public Double[] wgs84_to_bd09(Double x, Double y) {
-        Double[] xy = wgs84_to_gcj02(x, y);
-        return gcj02_to_bd09(xy[0], xy[1]);
-    }
-
-    public Double[] bd09_to_wgs84(Double x, Double y) {
-        Double[] xy = bd09_to_gcj02(x, y);
-        return gcj02_to_wgs84(xy[0], xy[1]);
-    }
-
-    public Double[] gcj02_to_shcj(Double x, Double y) {
-        Double[] xy = gcj02_to_wgs84(x, y);
-        return wgs84_to_shcj(xy[0], xy[1]);
-    }
-
-    public Double[] shcj_to_gcj02(Double x, Double y) {
-        Double[] xy = shcj_to_wgs84(x, y);
-        return wgs84_to_gcj02(xy[0], xy[1]);
-    }
-
-    public Double[] shcj_to_utm4(Double x, Double y) {
-        double DX, DY, T, K;
-        DX = 499999.90104;
-        DY = 3455696.403019;
-        T = -0.0000001755;
-        K = 0.999600149344;
-        return covert_by_four_parm(x, y, DX, DY, T, K);
-    }
-
-    public Double[] utm_to_shcj4(Double x, Double y) {
-        double DX, DY, T, K;
-        DX = -500199.29965;
-        DY = -3457078.805985;
-        T = 0.0000001755;
-        K = 1.0004000106;
-        return covert_by_four_parm(x, y, DX, DY, T, K);
-    }
-
-    public Double[] bd09_to_gcj02(Double bd_lon, Double bd_lat) {
-        Double x = bd_lon - 0.0065;
-        Double y = bd_lat - 0.006;
-        double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_PI);
-        double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_PI);
-        double gg_lng = z * Math.cos(theta);
-        double gg_lat = z * Math.sin(theta);
-        Double[] gg = new Double[2];
-        gg[0] = gg_lng;
-        gg[1] = gg_lat;
-        return gg;
-    }
-
-    public Double[] gcj02_to_bd09(Double lng, Double lat) {
-        double z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_PI);
-        double theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_PI);
-        Double[] gg = new Double[2];
-        gg[0] = z * Math.cos(theta) + 0.0065;
-        gg[1] = z * Math.sin(theta) + 0.006;
-        return gg;
-    }
-
-    public Boolean out_of_china(Double lng, Double lat) {
-        // 纬度3.86~53.55,经度73.66~135.05
-        return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55);
-    }
-
-
-    public double transformlat(Double lng, Double lat) {
-        double ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
-        ret += ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0) / 3.0;
-        ret += ((20.0 * Math.sin(lat * PI) + 40.0 * Math.sin((lat / 3.0) * PI)) * 2.0) / 3.0;
-        ret += ((160.0 * Math.sin((lat / 12.0) * PI) + 320 * Math.sin((lat * PI) / 30.0)) * 2.0) / 3.0;
-        return ret;
-    }
-
-    public double transformlng(Double lng, Double lat) {
-        double ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat +
-                0.1 * Math.sqrt(Math.abs(lng));
-        ret += ((20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0) / 3.0;
-        ret += ((20.0 * Math.sin(lng * PI) + 40.0 * Math.sin((lng / 3.0) * PI)) * 2.0) / 3.0;
-        ret += ((150.0 * Math.sin((lng / 12.0) * PI) + 300.0 * Math.sin((lng / 30.0) * PI)) * 2.0) / 3.0;
-        return ret;
-    }
-
-    //四参数公式
-    public Double[] covert_by_four_parm(Double x, Double y, Double dx, Double dy, Double a, Double k) {
-        double px = 0;
-        double py = 0;
-        px = x * k * Math.cos(a) - y * k * Math.sin(a) + dx;
-        py = x * k * Math.sin(a) + y * k * Math.cos(a) + dy;
-        Double[] gg = new Double[2];
-        gg[0] = px;
-        gg[1] = py;
-        return gg;
-    }
-
-    public Double[] shcj_get_UTM_from_WGS(Double lon, Double lat) {
-        double a = 6378137;
-        double b = 6356752.3142451;
-        double f = (a - b) / a;
-
-        double eSquare = 2 * f - f * f;
-        double k0 = 0.9996;
-        double lonOrigin = 121.46714714;
-        double FN = 0;
-        // # 确保longtitude位于-180.00----179.9之间
-        double lonTemp = lon + 180 - Math.floor((lon + 180) / 360) * 360 - 180;
-        double latRad = (lat * PI) / 180;
-        double lonRad = (lonTemp * PI) / 180;
-        double lonOriginRad = (lonOrigin * PI) / 180;
-        double e2Square = eSquare / (1 - eSquare);
-
-        double V = a / Math.sqrt(1 - eSquare * Math.pow(Math.sin(latRad), 2));
-        double T = Math.pow(Math.tan(latRad), 2);
-        double C = e2Square * Math.pow(Math.cos(latRad), 2);
-        double A = Math.cos(latRad) * (lonRad - lonOriginRad);
-        double M = a * ((1 - eSquare / 4 - (3 * Math.pow(eSquare, 2)) / 64 - (5 * Math.pow(eSquare, 3)) / 256) * latRad - ((3 * eSquare) / 8 + (3 * Math.pow(eSquare, 2)) / 32 + (45 * Math.pow(eSquare, 3)) / 1024) * Math.sin(2 * latRad) + ((15 * Math.pow(eSquare, 2)) / 256 + (45 * Math.pow(eSquare, 3)) / 1024) * Math.sin(4 * latRad) - ((35 * Math.pow(eSquare, 3)) / 3072) * Math.sin(6 * latRad));
-
-        // # x
-        double UTMEasting = k0 * V * (A + ((1 - T + C) * Math.pow(A, 3)) / 6 + ((5 - 18 * T + Math.pow(T, 2) + 72 * C - 58 * e2Square) * Math.pow(A, 5)) / 120) + 500000.0;
-        //  # y
-        double UTMNorthing = k0 * (M + V * Math.tan(latRad) * (Math.pow(A, 2) / 2 + ((5 - T + 9 * C + 4 * Math.pow(C, 2)) * Math.pow(A, 4)) / 24 + ((61 - 58 * T + Math.pow(T, 2) + 600 * C - 330 * e2Square) * Math.pow(A, 6)) / 720));
-        //# 南半球纬度起点为10000000.0m
-        UTMNorthing += FN;
-        Double[] gg = new Double[2];
-        gg[0] = UTMEasting;
-        gg[1] = UTMNorthing;
-        return gg;
-    }
-
-
-    public Double[] shcj_get_WGS_from_UTM(Double x, Double y) {
-        //WGS84
-        double a = 6378137; //椭球体长半轴
-        double b = 6356752.3142451; //椭球体短半轴
-        x = 500000 - x;
-        double k0 = 0.9996;
-        double e = Math.sqrt(1 - Math.pow(b, 2) / Math.pow(a, 2));
-        // # calculate the meridional arc
-        double M = y / k0;
-        //# calculate footprint latitude
-        double mu = M / (a * (1 - Math.pow(e, 2) / 4 - (3 * Math.pow(e, 4)) / 64 - (5 * Math.pow(e, 6)) / 256));
-        double e1 = (1 - Math.pow(1 - Math.pow(e, 2), 1.0 / 2)) / (1 + Math.pow(1 - Math.pow(e, 2), 1.0 / 2));
-
-        double J1 = (3 * e1) / 2 - (27 * Math.pow(e1, 3)) / 32;
-        double J2 = (21 * Math.pow(e1, 2)) / 16 - (55 * Math.pow(e1, 4)) / 32;
-        double J3 = (151 * Math.pow(e1, 3)) / 96;
-        double J4 = (1097 * Math.pow(e1, 4)) / 512;
-        double fp = mu + J1 * Math.sin(2 * mu) + J2 * Math.sin(4 * mu) + J3 * Math.sin(6 * mu) + J4 * Math.sin(8 * mu);
-
-        // # Calculate Latitude and Longitude
-
-        double e2 = Math.pow(e, 2) / (1 - Math.pow(e, 2));
-        double C1 = e2 * Math.pow(Math.cos(fp), 2);
-        double T1 = Math.pow(Math.tan(fp), 2);
-        double R1 = (a * (1 - Math.pow(e, 2))) / Math.pow(1 - Math.pow(e * Math.sin(fp), 2), 3.0 / 2);
-        //# This is the same as rho in the forward conversion formulas above, but calculated for fp instead of lat.
-        double N1 = a / Math.pow(1 - Math.pow(e * Math.sin(fp), 2), 1.0 / 2);
-        //# This is the same as nu in the forward conversion formulas above, but calculated for fp instead of lat.
-        double D = x / (N1 * k0);
-
-        double Q1 = (N1 * Math.tan(fp)) / R1;
-        double Q2 = Math.pow(D, 2) / 2;
-        double Q3 = ((5 + 3 * T1 + 10 * C1 - 4 * Math.pow(C1, 2) - 9 * e2) * Math.pow(D, 4)) / 24;
-        double Q4 = ((61 + 90 * T1 + 298 * C1 + 45 * Math.pow(T1, 2) - 3 * Math.pow(C1, 2) - 252 * e2) * Math.pow(D, 6)) / 720;
-        double lat = ((fp - Q1 * (Q2 - Q3 + Q4)) * 180) / PI;
-        // System.out.println("lat===="+Math.toRadians(fp - Q1*(Q2 - Q3 + Q4)));
-        double Q5 = D;
-        double Q6 = ((1 + 2 * T1 + C1) * Math.pow(D, 3)) / 6;
-        double Q7 = ((5 - 2 * C1 + 28 * T1 - 3 * Math.pow(C1, 2) + 8 * e2 + 24 * Math.pow(T1, 2)) * Math.pow(D, 5)) / 120;
-        double lonmid = 121.46714714;
-        double lon = lonmid - (((Q5 - Q6 + Q7) / Math.cos(fp)) * 180) / PI;
-        Double[] gg = new Double[2];
-        gg[0] = lon;
-        gg[1] = lat;
-        return gg;
-    }
-}

+ 0 - 75
src/main/java/com/skyversation/poiaddr/util/geotools/GeoJsonIntersector.java

@@ -1,75 +0,0 @@
-package com.skyversation.poiaddr.util.geotools;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import org.json.simple.parser.JSONParser;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * 根据街道名称和村名得到青浦匹配的村庄geojson合集
- */
-public class GeoJsonIntersector {
-    /*public static void main(String[] args) throws Exception {
-        run("香花桥街道", "向阳村,爱星村,大联村,东方村,金米村,东斜村,新姚村,新桥村,民惠第三居委会,燕南村,泾阳村,胜利村,天一村,曹泾村,香花桥居委会,朝阳村,金星村,都汇华庭居委会,陈桥村,盈中村,石西村,杨元村,袁家村,七汇村,郏一村,青山居委会,金巷居委会", "博文中学");
-//        run("香花桥街道", "燕南村,泾阳村,东方村,大联村,金米村,新桥村,爱星村,大盈居委会,民惠居委会,民惠第二居委会,民惠第三居委会,新姚村,友爱居委会,胜利村,天一村,向阳村,曹泾村,东斜村", "博文小学");
-//        run("香花桥街道","香花桥居委会,朝阳村,金星村,都汇华庭居委会,盈中村,石西村,杨元村,七汇村,袁家村,郏一村,青山居委会,金巷居委会","香花桥小学");
-//        run("夏阳街道", "青华居委,南箐园社区居委,塔湾村,南门塔湾,大生桥,李腰泾,王仙村,城南村,塘郁村,枫泾村,太来村,新阳村,金家村,夏阳村,夏阳湖社区居委,青平居委,华骥苑社区居委,桂花园社区居委", "豫英小学");
-//        run("夏阳街道", "南门塔湾,大生桥,李腰泾,王仙村,城南村,塘郁村,枫泾村,太来村,新阳村,金家村,夏阳村,丝绸新村,志诚上和里", "豫才中学");
-//        run("盈浦街道", "南横村", "思源中学");
-//        run("夏阳街道","仓桥村","仓桥村");
-
-    }*/
-
-    public static void run(String jdNameStr, String czNameStr, String fileName) throws Exception {
-        List<String> jdNameList = new ArrayList<>(Arrays.asList(jdNameStr.split(",")));
-        List<String> nameList = new ArrayList<>();
-        if (czNameStr != null && !czNameStr.isEmpty()) {
-            nameList = new ArrayList<>(Arrays.asList(czNameStr.split(",")));
-            System.out.println("******需要匹配的村名个数:" + nameList.size());
-        }
-
-        JSONObject processingGeoJson = readGeoJson("src/main/resources/geojson/qp_cunju.geojson");
-        JSONArray features = (JSONArray) processingGeoJson.get("features");
-        JSONArray newFeatures = new JSONArray();
-        for (Object feature : features) {
-            JSONObject item = JSONObject.parseObject(feature.toString());
-            String jiezhen = item.getJSONObject("properties").getString("jz");
-            String cunName = item.getJSONObject("properties").getString("cjname");
-            if (jdNameList.contains(jiezhen)) {
-                if (czNameStr == null || czNameStr.isEmpty()) {
-                    newFeatures.add(feature);
-                } else if (nameList.contains(cunName)) {
-                    newFeatures.add(feature);
-                    System.out.println("++++匹配到:" + jiezhen + "." + cunName);
-                    nameList.remove(cunName);
-                }
-            }
-        }
-        if (nameList.size() > 0) {
-            for (String cName : nameList) {
-                System.out.println("----没有匹配到:" + cName);
-            }
-        }
-        System.out.println("******匹配到的村名个数:" + newFeatures.size());
-        System.out.println("******没有匹配到的村名个数:" + nameList.size());
-        processingGeoJson.put("features", newFeatures);
-        // 5. 保存结果
-        saveGeoJson(processingGeoJson, "output/result_" + fileName + ".geojson");
-        System.out.println("解析完成,已保存结果geojson文件到output/,文件名称:result_" + fileName + ".geojson");
-    }
-
-    private static JSONObject readGeoJson(String path) throws Exception {
-        String fileData = new JSONParser().parse(new FileReader(path)).toString();
-        return JSONObject.parseObject(fileData);
-    }
-
-    private static void saveGeoJson(JSONObject geoJson, String path) throws Exception {
-        try (FileWriter writer = new FileWriter(path)) {
-            writer.write(geoJson.toJSONString());
-        }
-    }
-}

+ 0 - 42
src/main/java/com/skyversation/poiaddr/util/geotools/GeoJsonPointInRegion.java

@@ -1,42 +0,0 @@
-package com.skyversation.poiaddr.util.geotools;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.locationtech.jts.geom.Coordinate;
-import org.locationtech.jts.geom.Geometry;
-import org.locationtech.jts.geom.GeometryFactory;
-import org.locationtech.jts.io.ParseException;
-import java.io.IOException;
-
-/**
- * 根据经纬度和geojson字符串,判断是否是包含关系
- */
-public class GeoJsonPointInRegion {
-
-    public static boolean isPointInGeoJsonRegion(String geoJson, double longitude, double latitude) throws IOException, ParseException {
-        ObjectMapper mapper = new ObjectMapper();
-        // 将GeoJSON字符串解析成Geometry对象
-        Geometry geo = mapper.readValue(geoJson, Geometry.class);
-
-        GeometryFactory geometryFactory = new GeometryFactory();
-        // 创建表示点的Geometry对象
-        Coordinate point = new Coordinate(longitude, latitude);
-        Geometry pointGeom = geometryFactory.createPoint(point);
-
-        return geo.contains(pointGeom);
-    }
-
-    /*public static void main(String[] args) {
-        String sampleGeoJson = "{\"type\":\"Polygon\",\"coordinates\":[[[116.3,39.9],[116.4,39.9],[116.4,40.0],[116.3,40.0],[116.3,39.9]]]}";
-        double lon = 116.35;
-        double lat = 39.95;
-        try {
-            boolean result = isPointInGeoJsonRegion(sampleGeoJson, lon, lat);
-            if (result) {
-                System.out.println("点在区域内");
-            } else {
-                System.out.println("点不在区域内");
-            }
-        } catch (IOException | ParseException e) {
-            e.printStackTrace();
-        }
-    }*/
-}

+ 0 - 56
src/main/java/com/skyversation/poiaddr/util/geotools/GeometryIntersectionAndDisjoint.java

@@ -1,56 +0,0 @@
-package com.skyversation.poiaddr.util.geotools;
-import org.locationtech.jts.geom.Geometry;
-import org.locationtech.jts.geom.GeometryFactory;
-import org.locationtech.jts.io.ParseException;
-import org.locationtech.jts.io.WKTReader;
-
-/**
- * 创建 GeometryFactory 和 WKTReader:
- * GeometryFactory 用于创建各种几何对象。
- * WKTReader 用于将 Well-Known Text (WKT) 格式的字符串转换为 Geometry 对象。
- * 定义几何对象:
- * 这里使用 WKT 字符串来表示几何对象。wkt1 和 wkt2 分别表示两个多边形。你可以根据需要修改这些字符串,它们可以是任何支持的几何类型,如 POINT、LINESTRING、POLYGON 等。
- * 将 WKT 字符串解析为 Geometry 对象:
- * 使用 wktReader.read(wkt) 方法将 WKT 字符串转换为 Geometry 对象。
- * 相交判断:
- * geometry1.intersects(geometry2) 方法用于判断 geometry1 和 geometry2 是否相交。
- * 如果相交,返回 true,否则返回 false。
- * 相离判断:
- * geometry1.disjoint(geometry2) 方法用于判断 geometry1 和 geometry2 是否相离。
- * 如果相离,返回 true,否则返回 false。
- */
-public class GeometryIntersectionAndDisjoint {
-
-    /*public static void main(String[] args) {
-        GeometryFactory geometryFactory = new GeometryFactory();
-        WKTReader wktReader = new WKTReader(geometryFactory);
-
-        try {
-            // 定义两个几何对象,这里使用 WKT 格式的字符串表示
-            String wkt1 = "POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))";
-            String wkt2 = "POLYGON((5 5, 5 15, 15 15, 15 5, 5 5))";
-
-            // 将 WKT 字符串解析为 Geometry 对象
-            Geometry geometry1 = wktReader.read(wkt1);
-            Geometry geometry2 = wktReader.read(wkt2);
-
-            // 判断两个几何对象是否相交
-            boolean intersects = geometry1.intersects(geometry2);
-            System.out.println("两个几何对象是否相交: " + intersects);
-
-            // 判断两个几何对象是否相离
-            boolean disjoint = geometry1.disjoint(geometry2);
-            System.out.println("两个几何对象是否相离: " + disjoint);
-
-            // 判断 geometry2 是否包含 geometry1
-            boolean containsReverse = geometry2.contains(geometry1);
-            System.out.println("geometry2 是否包含 geometry1: " + containsReverse);
-
-            // 计算几何对象的面积
-            double area = geometry2.getArea();
-            System.out.println("该几何对象的面积为: " + area);
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-    }*/
-}

+ 0 - 155
src/main/java/com/skyversation/poiaddr/util/net/MultiThreadedAsyncHttpClient.java

@@ -1,155 +0,0 @@
-package com.skyversation.poiaddr.util.net;
-import java.net.URI;
-import java.net.URLEncoder;
-//import java.net.http.HttpClient;
-//import java.net.http.HttpRequest;
-//import java.net.http.HttpResponse;
-import java.nio.charset.StandardCharsets;
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- * java 11支持的版本
- * executeAsyncRequests 方法:
- * 接收请求的 URL 列表、请求头和请求参数作为输入。
- * 创建一个固定大小的线程池,线程池的大小与 URL 列表的大小相同。
- * 使用 CountDownLatch 来确保所有任务都执行完毕。
- * 遍历 URL 列表,为每个 URL 创建一个 RequestTask 任务,并提交到线程池中执行。
- * 等待所有任务完成后,关闭线程池并返回所有请求的结果。
- * RequestTask 类:
- * 实现了 Runnable 接口,用于定义请求任务。
- * 在 run 方法中,构建请求 URL,添加请求头和参数,使用 HttpClient 发送异步请求。
- * 处理响应并将结果添加到 results 列表中。
- * 在 finally 块中调用 latch.countDown() 方法,减少计数器的值,表示任务完成。
- * saveResultsToDatabase 方法:
- * 模拟将请求结果存储到数据库的操作,这里只是简单地打印结果。
- *
- * 注意事项
- * 线程池大小:线程池的大小应根据系统资源和请求的性质进行合理调整,避免创建过多线程导致系统资源耗尽。
- * 异常处理:在 RequestTask 的 run 方法中捕获并处理可能的异常,确保任务的稳定性。
- * 数据库存储:实际应用中,需要根据具体的数据库类型和使用的数据库访问框架(如 JDBC、MyBatis 等)来实现将结果存储到数据库的功能。
- * 通过这种方式,可以实现多线程异步请求,并在所有请求完成后将结果存储到数据库。
- */
-public class MultiThreadedAsyncHttpClient {
-//
-//    public static void main(String[] args) {
-//        // 模拟请求的 URL 列表
-//        List<String> urls = Arrays.asList(
-//                "https://www.example.com/api/endpoint1",
-//                "https://www.example.com/api/endpoint2"
-//        );
-//
-//        // 配置请求头
-//        Map<String, String> headers = new HashMap<>();
-//        headers.put("Authorization", "Bearer your_token");
-//        headers.put("Content-Type", "application/json");
-//
-//        // 配置请求参数
-//        Map<String, String> params = new HashMap<>();
-//        params.put("param1", "value1");
-//        params.put("param2", "value2");
-//
-//        // 执行多线程异步请求
-//        List<String> results = executeAsyncRequests(urls, headers, params);
-//
-//        // 模拟将结果存储到数据库
-//        saveResultsToDatabase(results);
-//    }
-//
-//    public static List<String> executeAsyncRequests(List<String> urls, Map<String, String> headers, Map<String, String> params) {
-//        // 创建一个固定大小的线程池
-//        int threadPoolSize = urls.size();
-//        ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize);
-//
-//        // 创建 CountDownLatch 用于等待所有任务完成
-//        CountDownLatch latch = new CountDownLatch(threadPoolSize);
-//
-//        // 用于存储所有请求的结果
-//        List<String> results = new CopyOnWriteArrayList<>();
-//
-//        // 创建并提交任务到线程池
-//        for (String url : urls) {
-//            executorService.submit(new RequestTask(url, headers, params, latch, results));
-//        }
-//
-//        try {
-//            // 等待所有任务完成
-//            latch.await();
-//        } catch (InterruptedException e) {
-//            Thread.currentThread().interrupt();
-//            e.printStackTrace();
-//        }
-//
-//        // 关闭线程池
-//        executorService.shutdown();
-//
-//        return results;
-//    }
-//
-//    static class RequestTask implements Runnable {
-//        private final String url;
-//        private final Map<String, String> headers;
-//        private final Map<String, String> params;
-//        private final CountDownLatch latch;
-//        private final List<String> results;
-//
-//        public RequestTask(String url, Map<String, String> headers, Map<String, String> params, CountDownLatch latch, List<String> results) {
-//            this.url = url;
-//            this.headers = headers;
-//            this.params = params;
-//            this.latch = latch;
-//            this.results = results;
-//        }
-//
-//        @Override
-//        public void run() {
-//            try {
-//                // 创建 HttpClient 实例
-//                HttpClient client = HttpClient.newHttpClient();
-//
-//                // 构建请求 URL,添加参数
-//                StringBuilder query = new StringBuilder();
-//                for (Map.Entry<String, String> entry : params.entrySet()) {
-//                    if (query.length() > 0) {
-//                        query.append("&");
-//                    }
-//                    query.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8));
-//                    query.append("=");
-//                    query.append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8));
-//                }
-//                String fullUrl = url + "?" + query.toString();
-//
-//                // 创建 HttpRequest 实例
-//                HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
-//                        .uri(URI.create(fullUrl));
-//
-//                // 添加请求头
-//                for (Map.Entry<String, String> entry : headers.entrySet()) {
-//                    requestBuilder.header(entry.getKey(), entry.getValue());
-//                }
-//
-//                HttpRequest request = requestBuilder.build();
-//
-//                // 发送异步请求
-//                CompletableFuture<HttpResponse<String>> future = client.sendAsync(request, HttpResponse.BodyHandlers.ofString());
-//                HttpResponse<String> response = future.get();
-//
-//                // 处理响应
-//                results.add(response.body());
-//            } catch (Exception e) {
-//                e.printStackTrace();
-//            } finally {
-//                // 任务完成,减少计数器
-//                latch.countDown();
-//            }
-//        }
-//    }
-//
-//    public static void saveResultsToDatabase(List<String> results) {
-//        // 模拟将结果存储到数据库
-//        System.out.println("将以下结果存储到数据库:");
-//        for (String result : results) {
-//            System.out.println(result);
-//        }
-//    }
-}

+ 0 - 58
src/main/java/com/skyversation/poiaddr/util/test/NetworkRequestTest.java

@@ -1,58 +0,0 @@
-package com.skyversation.poiaddr.util.test;
-
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.*;
-
-/**
- * 根据测试数据条数,测试市大数据中心接口响应时间
- */
-public class NetworkRequestTest {
-    private static final String URL = "https://service-api.onemap.sh.gov.cn/data-service-manage-service/MapProxyApi/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBsaWNhdGlvbl9pZCI6NjEsImFwcGxpY2F0aW9uX25hbWUiOiLpnZLmtabkuozkuInnu7TmnI3liqHns7vnu58iLCJleHAiOjIwNDY2Nzg0MDN9.IKUMdjUX4U1jncIUNren-iotL7duXI90aLECMjpvUX8/address_search/MapServer?region=310118&page_num=1&page_size=1&query=馨浦苑西区"; // 替换为实际的接口地址
-    private static final int TEST_DURATION = 1000; // 测试请求次数
-
-    public static void main(String[] args) throws InterruptedException {
-        int threadCount = Runtime.getRuntime().availableProcessors();
-        ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
-
-        long startTime = System.currentTimeMillis();
-        List<Future<?>> futures = new ArrayList<>();
-        for (int i = 0; i < TEST_DURATION - 1; i++) {
-            futures.add(executorService.submit(() -> {
-                try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
-                    HttpGet httpGet = new HttpGet(URL);
-                    try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
-                        // 处理响应
-                        System.out.println("-----------------请求结果:" + response.toString());
-                        EntityUtils.consume(response.getEntity());
-                    }
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }));
-        }
-
-        // 等待所有任务完成
-        for (Future<?> future : futures) {
-            try {
-                future.get();
-            } catch (InterruptedException | ExecutionException e) {
-                e.printStackTrace();
-            }
-        }
-        // 关闭线程池
-        executorService.shutdown();
-        long endTime = System.currentTimeMillis();
-        System.out.println("线程个数:" + threadCount);
-        long time = (endTime - startTime) / 1000;
-        System.out.println(TEST_DURATION + "个请求所用的时间: " + time + "秒!");
-        System.out.println("平均一秒请求" + TEST_DURATION / time + "个!");
-    }
-}

+ 0 - 294
src/main/java/com/skyversation/poiaddr/util/zipunit/CompressUtil.java

@@ -1,294 +0,0 @@
-package com.skyversation.poiaddr.util.zipunit;
-
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.zip.CRC32;
-import java.util.zip.CheckedOutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-/**
- * @author fhey
- * @date 2023-05-11 20:48:28
- * @description: 压缩工具类
- */
-
-public class CompressUtil {
-
-    private static final Logger logger = LoggerFactory.getLogger(CompressUtil.class);
-
-    /**
-     * 将文件打包到zip并创建文件
-     *
-     * @param sourceFilePath
-     * @param zipFilePath
-     * @throws IOException
-     */
-    public static void createLocalCompressFile(String sourceFilePath, String zipFilePath) throws IOException {
-        createLocalCompressFile(sourceFilePath, zipFilePath, null);
-    }
-
-    /**
-     * 将文件打包到zip并创建文件
-     *
-     * @param sourceFilePath
-     * @param zipFilePath
-     * @param zipName
-     * @throws IOException
-     */
-    public static void createLocalCompressFile(String sourceFilePath, String zipFilePath, String zipName) throws IOException {
-        File sourceFile = new File(sourceFilePath);
-        if (!sourceFile.exists()) {
-            throw new RuntimeException(sourceFilePath + "不存在!");
-        }
-        if(StringUtils.isBlank(zipName)){
-            zipName = sourceFile.getName();
-        }
-        File zipFile = createNewFile(zipFilePath + File.separator + zipName + ".zip");
-        try (FileOutputStream fileOutputStream = new FileOutputStream(zipFile)) {
-            compressFile(sourceFile, fileOutputStream);
-        }
-    }
-
-    /**
-     * 获取压缩文件流
-     *
-     * @param sourceFilePath
-     * @return ByteArrayOutputStream
-     * @throws IOException
-     */
-    public static OutputStream compressFile(String sourceFilePath, OutputStream outputStream) throws IOException {
-        File sourceFile = new File(sourceFilePath);
-        if (!sourceFile.exists()) {
-            throw new RuntimeException(sourceFilePath + "不存在!");
-        }
-        return compressFile(sourceFile, outputStream);
-    }
-
-    /**
-     * 获取压缩文件流
-     *
-     * @param sourceFile
-     * @return ByteArrayOutputStream
-     * @throws IOException
-     */
-    private static OutputStream compressFile(File sourceFile, OutputStream outputStream) throws IOException {
-        try (CheckedOutputStream checkedOutputStream = new CheckedOutputStream(outputStream, new CRC32());
-             ZipOutputStream zipOutputStream = new ZipOutputStream(checkedOutputStream)) {
-            doCompressFile(sourceFile, zipOutputStream, StringUtils.EMPTY);
-            return outputStream;
-        }
-    }
-
-    /**
-     * 处理目录下的文件
-     *
-     * @param sourceFile
-     * @param zipOutputStream
-     * @param zipFilePath
-     * @throws IOException
-     */
-    private static void doCompressFile(File sourceFile, ZipOutputStream zipOutputStream, String zipFilePath) throws IOException {
-        // 如果文件是隐藏的,不进行压缩
-        if (sourceFile.isHidden()) {
-            return;
-        }
-        if (sourceFile.isDirectory()) {//如果是文件夹
-            handDirectory(sourceFile, zipOutputStream, zipFilePath);
-        } else {//如果是文件就添加到压缩包中
-            try (FileInputStream fileInputStream = new FileInputStream(sourceFile)) {
-                String fileName = zipFilePath + sourceFile.getName();
-                addCompressFile(fileInputStream, fileName, zipOutputStream);
-            }
-        }
-    }
-
-    /**
-     * 处理文件夹
-     *
-     * @param dir         文件夹
-     * @param zipOut      压缩包输出流
-     * @param zipFilePath 压缩包中的文件夹路径
-     * @throws IOException
-     */
-    private static void handDirectory(File dir, ZipOutputStream zipOut, String zipFilePath) throws IOException {
-        File[] files = dir.listFiles();
-        if (ArrayUtils.isEmpty(files)) {
-            ZipEntry zipEntry = new ZipEntry(zipFilePath + dir.getName() + File.separator);
-            zipOut.putNextEntry(zipEntry);
-            zipOut.closeEntry();
-            return;
-        }
-        for (File file : files) {
-            doCompressFile(file, zipOut, zipFilePath + dir.getName() + File.separator);
-        }
-    }
-
-    /**
-     * 获取压缩文件流
-     *
-     * @param documentList 需要压缩的文件集合
-     * @return ByteArrayOutputStream
-     */
-    public static OutputStream compressFile(List<FileInfo> documentList, OutputStream outputStream) {
-        Map<String, List<FileInfo>> documentMap = new HashMap<>();
-        documentMap.put("", documentList);
-        return compressFile(documentMap, outputStream);
-    }
-
-    /**
-     * 将文件打包到zip
-     *
-     * @param documentMap 需要下载的附件集合 map的key对应zip里的文件夹名
-     * @return ByteArrayOutputStream
-     */
-    public static OutputStream compressFile(Map<String, List<FileInfo>> documentMap, OutputStream outputStream) {
-        CheckedOutputStream checkedOutputStream = new CheckedOutputStream(outputStream, new CRC32());
-        ZipOutputStream zipOutputStream = new ZipOutputStream(checkedOutputStream);
-        try {
-            for (Map.Entry<String, List<FileInfo>> documentListEntry : documentMap.entrySet()) {
-                String dirName = documentMap.size() > 1 ? documentListEntry.getKey() : "";
-                Map<String, Integer> fileNameToLen = new HashMap<>();//记录单个合同号文件夹下每个文件名称出现的次数(对重复文件名重命名)
-                for (FileInfo document : documentListEntry.getValue()) {
-                    try {
-                        //防止单个文件夹下文件名重复 对重复的文件进行重命名
-                        String documentName = document.getFileName();
-                        if (fileNameToLen.get(documentName) == null) {
-                            fileNameToLen.put(documentName, 1);
-                        } else {
-                            int fileLen = fileNameToLen.get(documentName) + 1;
-                            fileNameToLen.put(documentName, fileLen);
-                            documentName = documentName + "(" + fileLen + ")";
-                        }
-                        String fileName = documentName + "." + document.getSuffix();
-                        if (StringUtils.isNotBlank(dirName)) {
-                            fileName = dirName + File.separator + fileName;
-                        }
-                        addCompressFile(document.getFileInputStream(), fileName, zipOutputStream);
-                    } catch (Exception e) {
-                        logger.info("filesToZip exception :", e);
-                    }
-                }
-            }
-        } catch (Exception e) {
-            logger.error("filesToZip exception:" + e.getMessage(), e);
-        }
-        return outputStream;
-    }
-
-    /**
-     * 将单个文件写入文件压缩包
-     *
-     * @param inputStream     文件输入流
-     * @param fileName        文件在压缩包中的相对全路径
-     * @param zipOutputStream 压缩包输出流
-     */
-    private static void addCompressFile(InputStream inputStream, String fileName, ZipOutputStream zipOutputStream) {
-        try (BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream)) {
-            ZipEntry zipEntry = new ZipEntry(fileName);
-            zipOutputStream.putNextEntry(zipEntry);
-            byte[] bytes = new byte[1024];
-            int length;
-            while ((length = bufferedInputStream.read(bytes)) >= 0) {
-                zipOutputStream.write(bytes, 0, length);
-                zipOutputStream.flush();
-            }
-            zipOutputStream.closeEntry();
-        } catch (Exception e) {
-            logger.info("addFileToZip exception:", e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * 通过网络请求下载zip
-     *
-     * @param sourceFilePath       需要压缩的文件路径
-     * @param response            HttpServletResponse
-     * @param zipName            压缩包名称
-     * @throws IOException
-     */
-    public static void httpDownloadCompressFile(String sourceFilePath, HttpServletResponse response, String zipName) throws IOException {
-        File sourceFile = new File(sourceFilePath);
-        if (!sourceFile.exists()) {
-            throw new RuntimeException(sourceFilePath + "不存在!");
-        }
-        if(StringUtils.isBlank(zipName)){
-            zipName = sourceFile.getName();
-        }
-        try (ServletOutputStream servletOutputStream = response.getOutputStream()){
-            CompressUtil.compressFile(sourceFile, servletOutputStream);
-            response.setContentType("application/zip");
-            response.setHeader("Content-Disposition", "attachment; filename=\"" + zipName + ".zip\"");
-            servletOutputStream.flush();
-        }
-    }
-
-    public static void httpDownloadCompressFileOld(String sourceFilePath, HttpServletResponse response, String zipName) throws IOException {
-        try (ServletOutputStream servletOutputStream = response.getOutputStream()){
-            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-            byte[] zipBytes = byteArrayOutputStream.toByteArray();
-            response.setContentType("application/zip");
-            response.setHeader("Content-Disposition", "attachment; filename=\"" + zipName + ".zip\"");
-            response.setContentLength(zipBytes.length);
-            servletOutputStream.write(zipBytes);
-            servletOutputStream.flush();
-        }
-    }
-
-    /**
-     * 通过网络请求下载zip
-     *
-     * @param sourceFilePath       需要压缩的文件路径
-     * @param response            HttpServletResponse
-     * @throws IOException
-     */
-    public static void httpDownloadCompressFile(String sourceFilePath, HttpServletResponse response) throws IOException {
-        httpDownloadCompressFile(sourceFilePath, response, null);
-    }
-
-
-    /**
-     * 检查文件名是否已经存在,如果存在,就在文件名后面加上“(1)”,如果文件名“(1)”也存在,则改为“(2)”,以此类推。如果文件名不存在,就直接创建一个新文件。
-     *
-     * @param filename 文件名
-     * @return File
-     */
-    public static File createNewFile(String filename) {
-        File file = new File(filename);
-        if (!file.exists()) {
-            try {
-                file.createNewFile();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        } else {
-            String base = filename.substring(0, filename.lastIndexOf("."));
-            String ext = filename.substring(filename.lastIndexOf("."));
-            int i = 1;
-            while (true) {
-                String newFilename = base + "(" + i + ")" + ext;
-                file = new File(newFilename);
-                if (!file.exists()) {
-                    try {
-                        file.createNewFile();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                    break;
-                }
-                i++;
-            }
-        }
-        return file;
-    }
-}

+ 0 - 188
src/main/java/com/skyversation/poiaddr/util/zipunit/DataExportUtil.java

@@ -1,188 +0,0 @@
-package com.skyversation.poiaddr.util.zipunit;
-import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.util.*;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-/**
- * exportDataToZip 方法:
- * 首先创建保存 XLSX 文件的目录。
- * 将数据按每 10000 条进行分割。
- * 调用 createXlsxFile 方法将每组数据生成 XLSX 文件。
- * 调用 zipDirectory 方法将生成的 XLSX 文件目录打包成 ZIP 文件。
- * 设置响应头,将 ZIP 文件流输出给客户端。
- * 最后删除临时文件和目录。
- * createXlsxFile 方法:
- * 使用 Apache POI 库创建 XLSX 文件。
- * 生成表头,将数据填充到表格中。
- * 自动调整列宽。
- * zipDirectory 方法:
- * 使用 ZipOutputStream 将指定目录下的文件打包成 ZIP 文件。
- * deleteDirectory 方法:
- * 递归删除指定目录及其所有子文件和子目录。
- */
-public class DataExportUtil {
-
-    public static void exportDataToZip(List<Map<String, Object>> dataList, String filePath, HttpServletResponse response,String outFileType) throws IOException {
-        // 创建保存 XLSX 文件的目录
-        File directory = new File(filePath);
-        if (!directory.exists()) {
-            directory.mkdirs();
-        }
-
-        // 分割数据,每 10000 条数据一组
-        List<List<Map<String, Object>>> dataChunks = new ArrayList<>();
-        for (int i = 0; i < dataList.size(); i += 10000) {
-            dataChunks.add(dataList.subList(i, Math.min(i + 10000, dataList.size())));
-        }
-        switch (outFileType) {
-            case "xlsx":
-                // 生成 XLSX 文件
-                for (int i = 0; i < dataChunks.size(); i++) {
-                    List<Map<String, Object>> chunk = dataChunks.get(i);
-                    String fileName = filePath + File.separator + "data_" + (i + 1) + ".xlsx";
-                    createXlsxFile(chunk, fileName);
-                }
-                break;
-            case "csv":
-                // 生成 CSV 文件
-                for (int i = 0; i < dataChunks.size(); i++) {
-                    List<Map<String, Object>> chunk = dataChunks.get(i);
-                    String fileName = filePath + File.separator + "data_" + (i + 1) + ".csv";
-                    createCsvFile(chunk, fileName);
-                }
-                break;
-            case "geojson":
-                break;
-        }
-
-        // 创建 ZIP 文件
-        String zipFilePath = filePath + File.separator + "data.zip";
-        zipDirectory(directory, zipFilePath);
-
-        // 设置响应头
-        response.setContentType("application/zip");
-        response.setHeader("Content-Disposition", "attachment; filename=data.zip");
-
-        // 输出 ZIP 文件流
-        try (ServletOutputStream outputStream = response.getOutputStream();
-             FileInputStream fileInputStream = new FileInputStream(zipFilePath)) {
-            byte[] buffer = new byte[4096];
-            int bytesRead;
-            while ((bytesRead = fileInputStream.read(buffer)) != -1) {
-                outputStream.write(buffer, 0, bytesRead);
-            }
-            outputStream.flush();
-        }
-
-        // 删除临时文件和目录
-        deleteDirectory(directory);
-    }
-
-    private static void createXlsxFile(List<Map<String, Object>> data, String filePath) throws IOException {
-        try (Workbook workbook = new XSSFWorkbook();
-             FileOutputStream fileOut = new FileOutputStream(filePath)) {
-            Sheet sheet = workbook.createSheet("Data");
-
-            // 创建表头
-            Row headerRow = sheet.createRow(0);
-            Set<String> headers = new LinkedHashSet<>();
-            for (Map<String, Object> rowData : data) {
-                headers.addAll(rowData.keySet());
-            }
-            int columnIndex = 0;
-            for (String header : headers) {
-                Cell cell = headerRow.createCell(columnIndex++);
-                cell.setCellValue(header);
-            }
-
-            // 填充数据
-            for (int i = 0; i < data.size(); i++) {
-                Row row = sheet.createRow(i + 1);
-                columnIndex = 0;
-                for (String header : headers) {
-                    Cell cell = row.createCell(columnIndex++);
-                    Object value = data.get(i).get(header);
-                    if (value != null) {
-                        cell.setCellValue(value.toString());
-                    }
-                }
-            }
-
-            // 自动调整列宽
-            for (int i = 0; i < headers.size(); i++) {
-                sheet.autoSizeColumn(i);
-            }
-
-            workbook.write(fileOut);
-        }
-    }
-
-    private static void createCsvFile(List<Map<String, Object>> data, String filePath) throws IOException {
-        try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath))) {
-            // 获取表头
-            Set<String> headers = new LinkedHashSet<>();
-            for (Map<String, Object> rowData : data) {
-                headers.addAll(rowData.keySet());
-            }
-
-            // 写入表头
-            writer.write(String.join(",", headers));
-            writer.newLine();
-
-            // 写入数据
-            for (Map<String, Object> rowData : data) {
-                List<String> values = new ArrayList<>();
-                for (String header : headers) {
-                    Object value = rowData.get(header);
-                    values.add(value != null ? value.toString() : "");
-                }
-                writer.write(String.join(",", values));
-                writer.newLine();
-            }
-        }
-    }
-
-    private static void zipDirectory(File directory, String zipFilePath) throws IOException {
-        try (ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipFilePath))) {
-            File[] files = directory.listFiles();
-            if (files != null) {
-                for (File file : files) {
-                    if (!file.isDirectory()) {
-                        try (FileInputStream fileIn = new FileInputStream(file)) {
-                            ZipEntry zipEntry = new ZipEntry(file.getName());
-                            zipOut.putNextEntry(zipEntry);
-
-                            byte[] bytes = new byte[1024];
-                            int length;
-                            while ((length = fileIn.read(bytes)) >= 0) {
-                                zipOut.write(bytes, 0, length);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    private static boolean deleteDirectory(File directory) {
-        if (directory.exists()) {
-            File[] files = directory.listFiles();
-            if (files != null) {
-                for (File file : files) {
-                    if (file.isDirectory()) {
-                        deleteDirectory(file);
-                    } else {
-                        file.delete();
-                    }
-                }
-            }
-        }
-        return directory.delete();
-    }
-}

+ 0 - 21
src/main/java/com/skyversation/poiaddr/util/zipunit/FileInfo.java

@@ -1,21 +0,0 @@
-package com.skyversation.poiaddr.util.zipunit;
-
-import lombok.Data;
-
-import java.io.InputStream;
-
-/**
- * @author fhey
- * @date 2023-05-11 21:01:26
- * @description: TODO
- */
-@Data
-public class FileInfo {
-    private InputStream fileInputStream;
-
-    private String suffix;
-
-    private String fileName;
-
-    private boolean isDirectory;
-}

+ 0 - 172
src/main/java/com/skyversation/poiaddr/util/根据jsonarray查询地址_四中心搜索_V4.java

@@ -1,172 +0,0 @@
-package com.skyversation.poiaddr.util;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.skyversation.poiaddr.util.net.AddressNetTools;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.StringUtils;
-
-import java.io.IOException;
-import java.util.*;
-
-/**
- * 政务网
- */
-public class 根据jsonarray查询地址_四中心搜索_V4 {
-    public static final String szxUrl = "https://service-api.onemap.sh.gov.cn/data-service-manage-service/MapProxyApi/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBsaWNhdGlvbl9pZCI6NjEsImFwcGxpY2F0aW9uX25hbWUiOiLpnZLmtabkuozkuInnu7TmnI3liqHns7vnu58iLCJleHAiOjIwNDY2Nzg0MDN9.IKUMdjUX4U1jncIUNren-iotL7duXI90aLECMjpvUX8/address_search/MapServer?region=310118&page_num=1&page_size=10&query=";
-    public static final String v4Url = "http://10.235.245.174:10011/proxy/address/getAddressV4?token=65463DEE-620A-0ED5-2385-17ECD07CD351&address=";
-    //  TODO 是否使用市中心的返回方法
-    public static final Boolean ifSzxResult = true;
-
-    public static void main(String[] args) {
-        String path = "D:\\work\\晗哥\\城建所\\数据处理\\赵巷单位2.xlsx";
-        String outputPath = "D:\\work\\晗哥\\城建所\\数据处理\\output赵巷单位2.xlsx";
-//        // V4地名地址,结果:33空地址,地址不完全匹配
-        searchLocToV4ByAddress("上海市青浦区", "经营地址", path, outputPath);
-
-
-    }
-
-    public static void searchLocToV4ByAddress(String heaeName, String addressKey, String path, String outputPath) {
-        try {
-            List<Map<String, Object>> listAddr = ExcelReaderUtils.readExcel(path);
-            int size = (listAddr.size() / 1000) + 1;
-            System.out.println("<<<<<<<   " + size + "     >>>>>>>>>");
-//            ExecutorService executor = Executors.newFixedThreadPool(size);
-//            for(int i = 0; i < size; i ++){
-
-//                List<Map<String, String>> list = listAddr.subList(i * 1000, (i+1)*1000 > listAddr.size() ? listAddr.size(): (i+1)*1000);
-            List<Map<String, Object>> list = listAddr;
-
-//                executor.execute(() ->{
-            List<Map<String, Object>> result = new ArrayList<>();
-            for (Map<String, Object> map : list) {
-                if (map.get("搜索结果地址") != null && StringUtils.hasText(map.get("搜索结果地址").toString())) {
-                    result.add(map);
-                } else {
-                    // 开始查询
-                    String address = map.get(addressKey).toString().trim().replaceAll("-", "");
-                    address = address.replace("上海市", "");
-                    address = address.replace("青浦区", "");
-                    address = heaeName + address;
-                    ResponseEntity response = AddressNetTools.getInstance().requestGet((ifSzxResult ? szxUrl : v4Url) + address, null, null, 1);
-                    if (response != null) {
-                        JSONObject json = JSONObject.parseObject(response.getBody() + "");
-                        JSONArray array = null;
-                        if (ifSzxResult) {
-//                          TODO 市中心搜索方法
-                            array = json.getJSONArray("result");
-                        } else {
-//                          TODO V4搜索方法
-                            JSONObject content = json.getJSONObject("content");
-                            int resultCode = content.getInteger("resultCode");
-                            if (resultCode == 0) {
-                                array = content.getJSONArray("exactResult");
-                            } else {
-                                array = content.getJSONArray("recomResult");
-                            }
-                        }
-                        if (array == null || array.size() < 1) {
-//                            map.put("所属区县", " ");
-//                            map.put("所属街道", " ");
-                            map.put("搜索结果纬度", " ");
-                            map.put("搜索结果经度", " ");
-//                            map.put("所属居委", " ");
-                            map.put("是否精确", "否");
-                            map.put("搜索结果地址", "");
-                        } else {
-                            for (int j = 0; j < array.size(); j++) {
-                                JSONObject jsonRes = array.getJSONObject(j);
-                                String lng = "";
-                                String lat = "";
-                                String resultAddrKey = jsonRes.getString(ifSzxResult ? "address" : "搜索结果地址");
-                                if (ifSzxResult && jsonRes.getJSONObject("location") != null && jsonRes.getJSONObject("location").get("lng") != null && jsonRes.getJSONObject("location").get("lat") != null) {
-                                    lng = jsonRes.getJSONObject("location").getDoubleValue("lng") + "";
-                                    lat = jsonRes.getJSONObject("location").getDoubleValue("lat") + "";
-                                } else if (jsonRes.get("纬度") != null && jsonRes.get("经度") != null) {
-                                    lng = jsonRes.getDoubleValue("纬度") + "";
-                                    lat = jsonRes.getDoubleValue("经度") + "";
-                                } else {
-                                    map.put("搜索结果纬度", "");
-                                    map.put("搜索结果经度", "");
-                                    map.put("搜索结果地址", "");
-                                    continue;
-                                }
-                                map.put("搜索结果纬度", lng);
-                                map.put("搜索结果经度", lat);
-                                map.put("搜索结果地址", resultAddrKey);
-//                              map.put("所属区县", jsonRes.getString("所属区县"));
-//                              map.put("所属街道", jsonRes.getString("所属街道"));
-//                              map.put("所属居委", jsonRes.getJSONObject("村居信息").getString("所属居委"));
-                                if (("上海市青浦区" + resultAddrKey).contains(address.replace("上海市青浦区", ""))) {
-                                    map.put("是否精确", "是");
-                                    break;
-                                } else if (resultAddrKey != null && !resultAddrKey.isEmpty() && address.contains(resultAddrKey.replace("上海市青浦区", ""))) {
-                                    map.put("是否精确", "近似");
-                                    break;
-                                } else {
-                                    double lat1 = Double.parseDouble(map.get("经度") + "");
-                                    double lon1 = Double.parseDouble(map.get("纬度") + "");
-                                    double lat2 = Double.parseDouble(lat);
-                                    double lon2 = Double.parseDouble(lng);
-                                    if (Coordinate.calculateDistance(lat1, lon1, lat2, lon2) <= 100) {
-                                        map.put("是否精确", "接近100m");
-                                        break;
-                                    } else {
-                                        map.put("搜索结果纬度", "");
-                                        map.put("搜索结果经度", "");
-                                        map.put("搜索结果地址", "");
-                                        continue;
-                                    }
-                                }
-                            }
-
-                            if (!ifSzxResult && !StringUtils.hasText(map.get("搜索结果经度") + "")) {
-                                boolean isError = false;
-                                JSONObject json1 = array.getJSONObject(0);
-                                if (json1.getString("搜索结果地址").length() < 5) {
-                                    try {
-                                        json1 = array.getJSONObject(1);
-                                    } catch (Exception e) {
-                                        isError = true;
-//                                        map.put("所属区县", " ");
-//                                        map.put("所属街道", " ");
-                                        map.put("搜索结果纬度", " ");
-                                        map.put("搜索结果经度", " ");
-//                                        map.put("所属居委", " ");
-                                        map.put("是否精确", "否");
-                                        map.put("搜索结果地址", "");
-                                    }
-                                }
-                                if (!isError) {
-//                                    JSONObject jsonWWG = json1.getJSONObject("微格网信息");
-//                                    map.put("所属区县", jsonWWG.getString("所属区县"));
-//                                    map.put("所属街道", jsonWWG.getString("所属街道"));
-                                    map.put("搜索结果纬度", json1.getDoubleValue("纬度") + "");
-                                    map.put("搜索结果经度", json1.getDoubleValue("经度") + "");
-                                    map.put("是否精确", "否");
-                                    map.put("搜索结果地址", json1.getString("搜索结果地址"));
-//                                    map.put("所属居委", json1.getJSONObject("村居信息").getString("所属居委"));
-                                }
-                            }
-                        }
-                    }
-                    result.add(map);
-                }
-            }
-            try {
-                ExcelReaderUtils.writeToExcel(result, outputPath.replace(".xlsx", UUID.randomUUID().toString() + ".xlsx"));
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
-//                });
-
-//            }
-//            executor.shutdown();
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-}

ファイルの差分が大きいため隠しています
+ 0 - 0
src/main/resources/geojson/qp_cunju.geojson


ファイルの差分が大きいため隠しています
+ 0 - 0
src/main/resources/geojson/zerenwangluo.json


ファイルの差分が大きいため隠しています
+ 0 - 0
src/main/resources/geojson/责任网格-wgs84.geojson


ファイルの差分が大きいため隠しています
+ 0 - 0
src/main/resources/geojson/青浦区微网格-wgs84.geojson


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません