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();
相关推荐
丘山一郎21 分钟前
Spring 中的IOC控制反转 和DI依赖注入
java·后端·spring
码视野23 分钟前
基于 Spring Boot + Vue3 的【大学英语四六级 (CET-4/6) 作文智能评分与句式润色系统】设计与实现(含PRD/三端高保真源码/大屏)
java·前端·人工智能·spring boot·后端·vue3
MetaLite26 分钟前
Spring-AOP自调用为什么失效-AopContext真能解决吗
java·后端·spring
大模型码小白29 分钟前
AI 对话流性能调优:万级消息的虚拟滚动落地
java·大数据·前端·javascript·人工智能·算法·机器学习
许彰午1 小时前
14-字段级SM4加密与SM2签名
java·低代码·架构
许彰午2 小时前
13-describe元数据输出
java·低代码·架构·状态模式
用户3721574261353 小时前
Java 设置 Word 文档编辑限制并允许指定区域编辑
java
宠友信息4 小时前
社区类源码开发实践中的仿小红书系统技术要点分析
java·spring boot·redis·mysql·uni-app·vue·内容运营
用户3721574261354 小时前
Java 设置 PDF 表单域只读或扁平化
java
luteres5 小时前
Spring学习笔记
java·后端·spring