JTS简介
JTS提供了一套操作几何向量的java类库。早期版本 com.vividsolutions,已废弃不在维护。现在版本 com.locationtech.jts 由eclipse开源基金会托管
使用说明
入门指导
jts-core 核心库使用说明
jts-core核心类库使用说明
具体结合示例代码详细介绍JTS下面核心包下面的geometry、coordinate、wkb、wkt等操作使用说明
各包使用说明
1.org.locationtech.jts.geom 基础包
geom几何建模参考OGC SFS标准进行java模型建立;
SFS 中定义的几何对象模型:图中显示的是SFS中几何对象的关系结构,简单要素中的几何对象主要就是定义了点、线、面和多点、多线、多面
另外,几何对象还涉及一系列的操作:
1.1 说明
1.1.1 提供几何接口与几何操作相关类
Coordinate使用说明
CoordinateArrays使用说明
Geometry与其子类等使用说明
Envelope使用说明
IntersectionMatrix说明
PrecisionModel精度说明
PreparedGeometry使用说明
1.1.2 操作工厂类
GeometryFactory使用说明
Coordinate工厂使用说明
org.locationtech.jts.geom.util 几何相关工具包
AffineTransformation仿射变换理论基础
AffineTransformation仿射说明
org.locationtech.jts.edgegraph 边与图
EdgeGraph使用说明
org.locationtech.jts.index 空间索引算法
SpatialIndex使用说明
org.locationtech.jts.io 格式输入输出工具包
WKT格式输入输出使用说明
WKB格式输入输出使用说明
org.locationtech.jts.algorithm 算法包
Angle角度计算
Orientation方向计算
豪斯多夫距离计算
点到几何距离,最近形状点计算
coordinate位于geometry的位置
AreaSimilarityMeasure判断几何相似性
ConvexHull凸包计算
Length计算长度
InteriorPoint内部点计算
Intersection判断两条线段的交点
MinimumBoundingCircle计算最小包裹圆
MinimumDiameter最小直径计算
org.locationtech.jts.densifier 丰富点包
Densifier给定距离插点丰富线段
org.locationtech.jts.operation 操作包
LineMerger合并线段
org.locationtech.jts.dissolver
LineDissolver根据输入的geometry拆分成独立的linestring
jts案例
计算点到线的垂线
延线的画线方向,判断点在线的右侧还是左侧
线到线投影
根据起始点求一个线的子线
计算线上面距离点起点一定距离的交点坐标
扩buffer,左扩N米右扩N米
单位换算
代码类库地址
代码包结构
核心模块:
jts-core
- 核心类库:提供geometry model, operations, algorithms, and spatial data structuresjts-io-common
- I/O classes for open spatial formats
The following modules depend on proprietary libraries, and are not built by default:
jts-io-ora
- Oracle reader and writerjts-io-sde
- SDE reader and writer
The following modules are applications and data for testing and working with JTS
jts-tests
- The JTS XML test suite and the Test Runner applicationjts-app
-The TestBuilder GUI, for working with JTS geometry interactively
Maven坐标
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
<version>1.16.1</version>
</dependency>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2022-08-29 spring-boot-starter-data-jpa + SQLite简单例子(含全部代码)
2022-08-29 C#中Trim()、TrimStart()、 TrimEnd()的用法