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();
相关推荐
步行cgn3 小时前
Spring 基于 XML 的自动装配:byName 详解
java·后端·spring
大帅点兵3 小时前
Apache Ant 1.9.9 完整讲解
java
LuTshoes3 小时前
spring ai 实战 手搓 PlaneExecuteAgent
java·人工智能·spring·ai
这料鬼有毒3 小时前
二刷hot100-73.矩阵置零
java
caoerzhong4 小时前
JeeWMS 开源仓库管理系统二次开发与接口对接实战:Java WMS 如何与 ERP、MES 和自动化设备打通
java·开源
长谷深风1114 小时前
评测AI Agent:三种裁判各司其职
java·大数据·开发语言·人工智能·ai agent
边境悍匪4 小时前
蜗牛学苑 Java 智能体学习 Day42|项目周开发技术汇总 1 思维导图复盘
java·开发语言·spring boot·学习·spring
槑有烦恼4 小时前
Java 字符串 & List集合 高频易错真题复盘(含全部错题+修正)
java
语戚4 小时前
力扣 1621. 大小为K的不重叠线段的数目:动态规划(Java 实现)
java·算法·leetcode·动态规划·力扣·dp
君顾14 小时前
本地托管机构管理源码实战:需求拆解、数据建模与多端部署
java·开发语言·托管