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();
相关推荐
程序员清风31 分钟前
AI时代建议学点自己真正感兴趣的!
java·后端·面试
Wang's Blog37 分钟前
Java框架 SpringCloud 快速入门: Nacos 配置热更新
java·spring·spring cloud
西索斯coding40 分钟前
Kimi k2.7-code-highspeed 接入 Cline 教程:baseURL 路由变更 + model_id 正确写法
java·服务器·数据库·ai
用户094248568031 小时前
第29章:【OpenJDK中级篇综合实战】百万长连接网关的JVM稳定性工程
java·jvm
吠品1 小时前
HTTPS 真身:HTTP 套了层 TLS
java·服务器·前端
钝挫力PROGRAMER1 小时前
Java 日常开发常用 API 总结与示例
java
小鹿的周先生1 小时前
第16章-RAG
java·人工智能·ai编程
夜不会漫长2 小时前
C++:内存管理
java·开发语言·c++
vipxieliang2 小时前
ValidX 财务系统发票验证:发票号、税号、金额校验
java·spring boot
天空鸟_时光不老2 小时前
06-给AI流程加一道人工闸门
java·人工智能·spring boot·后端·spring·spring cloud·架构