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();
相关推荐
paishishaba32 分钟前
JAVA面试复习笔记(待完善)
java·笔记·后端·面试
四谎真好看1 小时前
Java 黑马程序员学习笔记(进阶篇19)
java·笔记·学习·学习笔记
從南走到北2 小时前
JAVA代泊车接机送机服务代客泊车系统源码支持小程序+APP+H5
java·开发语言·微信小程序·小程序
apocelipes7 小时前
golang unique包和字符串内部化
java·python·性能优化·golang
Full Stack Developme8 小时前
java.text 包详解
java·开发语言·python
刘梦凡呀8 小时前
C#获取钉钉平台考勤记录
java·c#·钉钉
best_virtuoso9 小时前
PostgreSQL 常见数组操作函数语法、功能
java·数据结构·postgresql
yudiandian20149 小时前
02 Oracle JDK 下载及配置(解压缩版)
java·开发语言
楚韵天工9 小时前
宠物服务平台(程序+文档)
java·网络·数据库·spring cloud·编辑器·intellij-idea·宠物