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();
相关推荐
怒放吧德德7 小时前
Spring Boot 实战:RSA+AES 接口全链路加解密(防篡改 / 防重放)
java·spring boot·后端
郑州光合科技余经理10 小时前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php
大大水瓶11 小时前
Tomcat
java·tomcat
dustcell.11 小时前
haproxy七层代理
java·开发语言·前端
游离态指针11 小时前
以为发消息=下单成功?RabbitMQ从0到秒杀实战的完整踩坑笔记
java
BD_Marathon11 小时前
工厂方法模式
android·java·工厂方法模式
玹外之音12 小时前
Spring AI MCP 无状态服务器实战:构建AI智能用户管理系统
java·后端
java干货12 小时前
Redis 的 ZipList 是什么?它是怎么解决内存碎片问题的?
java
失重外太空啦12 小时前
Tomcat
java·服务器·tomcat
屎到临头想搅便12 小时前
TOMCAT
java·tomcat