geotools 解析GeoJson

Maven:

XML 复制代码
<dependency>
  <groupId>org.geotools</groupId>
  <artifactId>gt-geojson</artifactId>
  <version>${geotools.version}</version>
</dependency>

Here is a small example from the test cases:

java 复制代码
GeometryJSON gjson = new GeometryJSON();
// be sure to strip whitespace
String json = "{'type':'Point','coordinates':[100.1,0.1]}";

Reader reader = new StringReader(json);
Point p = gjson.readPoint( reader );

Working with Features is also supported:

java 复制代码
FeatureJSON fjson = new FeatureJSON();
StringWriter writer = new StringWriter();

fjson.writeFeature(feature(1), writer);

String json = writer.toString();
相关推荐
间彧9 小时前
Java双亲委派模型工作原理
java
smileSunshineMan9 小时前
idea启动kafka源码
java·kafka·intellij-idea
indexsunny9 小时前
互联网大厂Java面试实战:核心技术与微服务架构解析
java·数据库·spring boot·缓存·微服务·面试·消息队列
想用offer打牌9 小时前
非常好用的工具: curl
java·后端·github
·云扬·9 小时前
ClickHouse数据备份与恢复实战:从基础操作到工具应用
android·java·clickhouse
程序员清风9 小时前
贝壳一面:Spring是怎么实现的?谈谈你的理解?
java·后端·面试
坚持学习前端日记9 小时前
后台管理系统文档
java·开发语言·windows·spring boot·python·spring
雨中飘荡的记忆9 小时前
Spring Security入门:从零开始构建安全应用
java·安全·spring
凯哥Java9 小时前
MaxKB4J:基于Java的高效知识库问答系统与工作流智能解决方案
java·开发语言
悟能不能悟9 小时前
Postman Pre-request Script 详细讲解与高级技巧
java·开发语言·前端