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();
相关推荐
阿维的博客日记14 小时前
MultipartFile 是不是表示仅仅是一个分片?
java·后端·spring·multipartfile
程序员无隅14 小时前
Coding Agent 为什么压缩上下文后还能继续工作?上下文模块设计拆解
java·开发语言·数据库
Python+9914 小时前
Java 枚举类(Enum)详解:从基础到高级应用
java·开发语言·python
二炮手亮子15 小时前
浅记java线程池
java·开发语言
一路向北North15 小时前
Spring Security OAuth2.0(23):分布式系统授权-转发明文给微服务
java·spring·微服务
爱吃牛肉的大老虎17 小时前
rust基础之环境搭建
java·开发语言·rust
tellmewhoisi18 小时前
多版本共用redis的token有效期校验(过期重新登录)
java·redis·缓存
疯狂打码的少年18 小时前
【软件工程】结构化设计:模块独立性与耦合内聚
java·开发语言·笔记·软件工程
乐观的Terry18 小时前
3、数据库设计与领域实体
java·数据库·spring boot·spring cloud·ai编程
C++、Java和Python的菜鸟18 小时前
第4章 后端Web基础(基础知识)
java·开发语言