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 小时前
5.4.1 锁分类
java·数据库·mysql
linux-hzh8 小时前
百日算法修炼 · Day 03
java·算法
不负岁月无痕9 小时前
简单理解操作系统结构
java·linux·c语言·开发语言·c++·面试
mister_guo9 小时前
Java线程池参数应该如何设置(ThreadPoolExecutor)
java
余额瞒着我当琳9 小时前
C++模板初阶与STL初探
android·java·c++
淡海水9 小时前
15-02-YooAsset面试篇-Unity架构设计与源码
java·unity·面试·c#·游戏引擎·yooasset
qq_4480111610 小时前
C语言中的指针函数和函数指针
java·c语言·开发语言
weixin_BYSJ198710 小时前
springboot酒店管理系统--附源码27436
java·spring boot·python·随机森林·贪心算法·eclipse·django
2401_8949155310 小时前
GEO 源码部署如何实现精准地域分发?核心配置参数深度讲解
java·运维·服务器·后端·开源
evans在进步11 小时前
LeetCode 2 两数相加:链表模拟加法,Java 图解进位过程
java·leetcode·链表