JTS空间分析工具包(GIS开源)学习 JAVA
来源:互联网 发布:软件著作权登记公告 编辑:程序博客网 时间:2024/06/12 00:39
JST空间分析工具包是一套JAVA API,提供一系列的空间数据分析操作。最近开发项目刚好需要用到,上网搜资料也少,就自己写下来记录一下。C++版本的拓扑分析开源工具叫:geos;.NET版本的拓扑分析开源工具叫:NTS。
1.下载
工具包下载地址:点击打开链接
2.学习资料
- 工具包里的官方入门文档:doc文件夹里的JTS Developer Guide.pdf。下载地址
- 官方API:jts-1.14\doc\javadoc\index.html
3.示例
(开发之前先引入lib文件夹内的所有JAR)
以两个多边形判断是否相交为例:
package com.jts;import com.vividsolutions.jts.JTSVersion;import com.vividsolutions.jts.geom.Coordinate;import com.vividsolutions.jts.geom.Geometry;import com.vividsolutions.jts.geom.GeometryFactory;public class 四边形求交1 {public static void main(String[] args) {// TODO Auto-generated method stub Coordinate[] coordinates1 = new Coordinate[]{ new Coordinate(117.2,34.8),new Coordinate(122.2,34.8), new Coordinate(122.2,31.5),new Coordinate(117.2,31.5),new Coordinate(117.2,34.8) }; Coordinate[] coordinates2 = new Coordinate[]{ new Coordinate(118.9,33.8),new Coordinate(120.8,33.8), new Coordinate(120.8,32.6),new Coordinate(118.9,32.6),new Coordinate(118.9,33.8) };// Coordinate[] coordinates2 = new Coordinate[]{// new Coordinate(1,1),new Coordinate(2,2),// new Coordinate(3,3),new Coordinate(4,4),new Coordinate(1,1)// }; Geometry g1 = new GeometryFactory().createPolygon(coordinates1); Geometry g2 = new GeometryFactory().createPolygon(coordinates2); boolean isIter = g1.intersects(g2); if(isIter)System.out.println("相交"); else System.out.println("不相交"); }}
结果如图:
阅读全文
1 0
- JTS空间分析工具包(GIS开源)学习 JAVA
- GeoTools,JTS和GeoAPI -- (学习GIS【3】)
- Jts Geometry 的Difference 空间差异分析
- JTS 空间数据模型
- 【JTS】JTS空间拓扑关系的测试
- GIS空间分析算法 内容简介
- GIS=数据+空间分析
- ArcView GIS 应用与开发技术(11)-空间分析
- JTS学习-com.vividsolutions.jts.algorithm包
- JTS学习-com.vividsolutions.jts.operation包
- Java并发工具包学习
- GIS中空间分析中的八个问题
- 工具包中QuestHttpContent.java分析
- 开源GIS现状分析
- 开源GIS现状分析
- 看JTS源码,感受Java优化编程(一)
- Mysql gis 空间数据库功能详解学习
- Mysql gis 空间数据库功能详解学习
- 【02】《UNIX高级环境编程》全书精华集锦(更新中)
- IT基础8
- IT基础9
- 修复“勒索漏洞”,“想哭漏洞”,“445端口漏洞”,修复微软“KB4012212”补丁的一些办法
- 转:svn和git的区别,maven是什么
- JTS空间分析工具包(GIS开源)学习 JAVA
- ThreadLocal详解
- IT基础10
- Java中Properties文件读取工具类
- [leetcode: Python]475.Heaters
- 将资源文件发布到Linux(以CentOS为例)服务器(虚拟机)上
- /usr/bin/ld: cannot find -lnvcuvid
- Ajax简单实例
- IT基础11