Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周健威
rs-cloud-platform
Commits
86e57850
Commit
86e57850
authored
Dec 23, 2021
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
b1bf08ae
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
305 additions
and
1 deletion
+305
-1
pom.xml
rs-universal/rs-universal-server/pom.xml
+49
-0
UploadService.java
...m/upyuns/platform/rs/universal/service/UploadService.java
+3
-1
ShpToGeojson.java
.../com/upyuns/platform/rs/universal/utils/ShpToGeojson.java
+253
-0
No files found.
rs-universal/rs-universal-server/pom.xml
View file @
86e57850
...
@@ -128,6 +128,55 @@
...
@@ -128,6 +128,55 @@
<version>
2.0-rscp-SNAPSHOT
</version>
<version>
2.0-rscp-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.vividsolutions
</groupId>
<artifactId>
jts
</artifactId>
<version>
1.13
</version>
</dependency>
<dependency>
<groupId>
org.geotools
</groupId>
<artifactId>
gt-geojson
</artifactId>
<version>
24.3
</version>
</dependency>
<dependency>
<groupId>
org.geotools
</groupId>
<artifactId>
gt-main
</artifactId>
<version>
24.3
</version>
</dependency>
<dependency>
<groupId>
org.geotools
</groupId>
<artifactId>
gt-shapefile
</artifactId>
<version>
24.3
</version>
</dependency>
<dependency>
<groupId>
org.geotools
</groupId>
<artifactId>
gt-swing
</artifactId>
<version>
24.3
</version>
</dependency>
<dependency>
<groupId>
org.geotools
</groupId>
<artifactId>
gt-opengis
</artifactId>
<version>
24.3
</version>
</dependency>
<dependency>
<groupId>
org.geotools
</groupId>
<artifactId>
gt-referencing
</artifactId>
<version>
24.3
</version>
</dependency>
<!-- 添加geotools-jdbc -->
<dependency>
<groupId>
org.geotools.jdbc
</groupId>
<artifactId>
gt-jdbc-postgis
</artifactId>
<version>
24.3
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
rs-universal/rs-universal-server/src/main/java/com/upyuns/platform/rs/universal/service/UploadService.java
View file @
86e57850
...
@@ -9,6 +9,7 @@ import com.upyuns.platform.rs.universal.constant.RedisKey;
...
@@ -9,6 +9,7 @@ import com.upyuns.platform.rs.universal.constant.RedisKey;
import
com.upyuns.platform.rs.universal.controller.UploadController
;
import
com.upyuns.platform.rs.universal.controller.UploadController
;
import
com.upyuns.platform.rs.universal.utils.ImageWatermarkUtil
;
import
com.upyuns.platform.rs.universal.utils.ImageWatermarkUtil
;
import
com.upyuns.platform.rs.universal.utils.ImgBase64Util
;
import
com.upyuns.platform.rs.universal.utils.ImgBase64Util
;
import
com.upyuns.platform.rs.universal.utils.ShpToGeojson
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormat
;
...
@@ -64,7 +65,8 @@ public class UploadService {
...
@@ -64,7 +65,8 @@ public class UploadService {
//将文件写入指定位置
//将文件写入指定位置
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
new
File
(
filePath
));
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
new
File
(
filePath
));
String
key
=
"shp:"
+
UUIDUtils
.
generateShortUuid
();
String
key
=
"shp:"
+
UUIDUtils
.
generateShortUuid
();
redisTemplate
.
opsForValue
().
setIfAbsent
(
key
,
filePath
);
String
geomJson
=
ShpToGeojson
.
shp2geojson
(
filePath
);
redisTemplate
.
opsForValue
().
setIfAbsent
(
key
,
geomJson
);
// realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath;
// realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath;
return
key
;
return
key
;
}
}
...
...
rs-universal/rs-universal-server/src/main/java/com/upyuns/platform/rs/universal/utils/ShpToGeojson.java
0 → 100644
View file @
86e57850
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment