From 35cb086a6e05bf0b6e2a6831330fbcd2c740eba7 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Mon, 01 Apr 2024 20:44:21 +0800
Subject: [PATCH] 修改workspaceId
---
src/main/java/com/dji/sample/patches/utils/ShapeFileUtil.java | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/dji/sample/patches/utils/ShapeFileUtil.java b/src/main/java/com/dji/sample/patches/utils/ShapeFileUtil.java
index b1325f4..c1a8a54 100644
--- a/src/main/java/com/dji/sample/patches/utils/ShapeFileUtil.java
+++ b/src/main/java/com/dji/sample/patches/utils/ShapeFileUtil.java
@@ -11,7 +11,6 @@
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.filter.Filter;
-
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
@@ -54,10 +53,11 @@
Filter filter = Filter.INCLUDE;
FeatureCollection<SimpleFeatureType, SimpleFeature> collection = source.getFeatures(filter);
return collection;
- }catch (Exception e){
+ } catch (Exception e) {
throw e;
}
}
+
/**
* @param zipFile:
* @return JSONObject
@@ -67,15 +67,15 @@
*/
public static List<String> shpToGeoJson(File zipFile) throws IOException {
FeatureJSON fjson = new FeatureJSON();
- JSONObject geoJsonObject=new JSONObject();
- geoJsonObject.put("type","FeatureCollection");
- List<String> strings=new ArrayList<>();
+ JSONObject geoJsonObject = new JSONObject();
+ geoJsonObject.put("type", "FeatureCollection");
+ List<String> strings = new ArrayList<>();
try {
// 获取FeatureCollection
FeatureCollection collection = getFeatureCollectionByShpFile(zipFile);
FeatureIterator iterator = collection.features();
- List<JSONObject> array = new ArrayList<JSONObject>();
+ List<JSONObject> array = new ArrayList<JSONObject>();
//遍历feature转为json对象
while (iterator.hasNext()) {
SimpleFeature feature = (SimpleFeature) iterator.next();
@@ -91,10 +91,10 @@
}
iterator.close();
//添加到geojsonObject
- geoJsonObject.put("features",array);
+ geoJsonObject.put("features", array);
iterator.close();
- }catch (Exception e){
+ } catch (Exception e) {
throw e;
}
return strings;
--
Gitblit v1.9.3