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();
相关推荐
正在努力Coding2 小时前
SpringAI - 工具调用
java·spring·ai
我尽力学3 小时前
面试 总结
java·spring boot·面试
爬台阶的蚂蚁3 小时前
Spring AI Alibaba基础概念
java·spring·ai
计算机学姐3 小时前
基于SpringBoot的演唱会抢票系统
java·spring boot·后端·spring·tomcat·intellij-idea·推荐算法
huohuopro3 小时前
Mybatis的七种传参方式
java·开发语言·mybatis
Lee_SmallNorth3 小时前
变态需求之【角色不同访问数据库的用户不同】
java·开发语言·数据库
扶苏-su3 小时前
Java网络编程:InetAddress 详解
java·开发语言·网络
Anastasiozzzz3 小时前
leetcode力扣hot100困难题--4.俩个正序数列的中位数
java·算法·leetcode·面试·职场和发展
木风小助理4 小时前
JavaStreamAPI的性能审视,优雅语法背后的隐形成本与优化实践
java·前端·数据库
Chan164 小时前
《Java并发编程的艺术》| ConcurrentHashMap 在 JDK 1.7 与 1.8 的底层实现
java·spring boot·java-ee·intellij-idea·juc