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();
相关推荐
舞者H3 分钟前
源码层面学习动态代理
java·学习
焱行软件科技计算机毕设7 分钟前
【java计算机毕设】线上花店销售商城系统java MySQL ssm JSP maven项目代码源码+文档ppt
java·mysql·课程设计
专注成就自我12 分钟前
java使用easypoi模版导出word详细步骤
java·开发语言·word
多多*35 分钟前
SpringBoot 启动流程六
java·开发语言·spring boot·后端·spring
极乐码农38 分钟前
Spring学习03-[Spring容器核心技术IOC学习进阶]
java·学习·spring
m0_5883833238 分钟前
初学Spring之 JavaConfig 实现配置
java·spring
让你三行代码QAQ41 分钟前
SpringSecurity初始化过程
java·开发语言
Enaium1 小时前
Rust入门实战 编写Minecraft启动器#1启动方法
java·后端·rust
滔滔不绝tao1 小时前
SpringBoot拦截器
java·spring boot·spring
Mr_Richard1 小时前
Java动态代理的实现方式
java·开发语言