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();
相关推荐
m0_5474866624 分钟前
《Java程序设计与实践 》全套PPT课件2026
java·开发语言
土司大王1 小时前
LeetCode hto100——字母异位词分组
java·算法·leetcode
码匠许师傅1 小时前
【C++ 面试真题】聊聊 C++ 中的 lambda 表达式
java·c++·面试
QCodingDev2 小时前
Spring AI Alibaba ReAct Agent实战:从Tool Calling到Agent,企业AI复杂业务该如何设计?
java·人工智能·agent·ai编程·spring ai
RainCity2 小时前
Java Swing 自定义组件库分享(十六)
java·笔记·后端
赵广陆3 小时前
企业实战:Markdown图片检索
android·java·开发语言
C++、Java和Python的菜鸟3 小时前
第3章 从0开始用若依
java·开发语言
Json____3 小时前
五金制品行业-企业官网源码
java·大数据·数据库·企业站·wwwoop.com
counting money5 小时前
Spring AI Alibaba 从入门到实战:构建企业级 AI 应用
java·人工智能·spring
原野池予5 小时前
深入Java集合框架:数组与List互转底层原理剖析(JDK 8)
java·数据结构·list