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();
相关推荐
WanderInk8 分钟前
揭秘Java协变返回类型:让你的API少一点强转,多一点优雅
java·后端
paopaokaka_luck20 分钟前
基于SpringBoot+Vue的非遗文化传承管理系统(websocket即时通讯、协同过滤算法、支付宝沙盒支付、可分享链接、功能量非常大)
java·数据库·vue.js·spring boot·后端·spring·小程序
iteye_993922 分钟前
让 3 个线程串行的几种方式
java·linux
YuTaoShao29 分钟前
【LeetCode 热题 100】142. 环形链表 II——快慢指针
java·算法·leetcode·链表
找不到、了1 小时前
分布式理论:CAP、Base理论
java·分布式
天天摸鱼的java工程师1 小时前
2025已过半,Java就业大环境究竟咋样了?
java·后端
人生在勤,不索何获-白大侠1 小时前
day16——Java集合进阶(Collection、List、Set)
java·开发语言
Zedthm1 小时前
LeetCode1004. 最大连续1的个数 III
java·算法·leetcode
艺杯羹2 小时前
MyBatis之核心对象与工作流程及SqlSession操作
java·mybatis
神的孩子都在歌唱2 小时前
3423. 循环数组中相邻元素的最大差值 — day97
java·数据结构·算法