当前位置: 首页 > news >正文

JTS: 12 Descriptions 图形覆盖

这里写目录标题

      • 版本
      • 代码
        • Intersection 交集
        • Union 并集
        • Difference 差集
        • SymDifference 补集

版本

org.locationtech.jts:jts-core:1.19.0
链接: github

代码

在这里插入图片描述

/*** 图形覆盖操作* @author LiHan* 2023年10月12日 19:34:09*/
public class GeometryDescriptions {private final GeometryFactory geometryFactory = new GeometryFactory();private static final Logger LOGGER = LoggerFactory.getLogger(GeometryDescriptions.class);private static final WKTWriter WKT_WRITER = new WKTWriter();private final Coordinate[] coordinate1 = {new Coordinate(3, 9), new Coordinate(3, 4), new Coordinate(14, 4), new Coordinate(14, 9), new Coordinate(3, 9)};private final Coordinate[] coordinate2 = {new Coordinate(3, 6), new Coordinate(3, 1), new Coordinate(14, 1), new Coordinate(14, 6), new Coordinate(3, 6)};private final Polygon polygon1 = geometryFactory.createPolygon(coordinate1);private final Polygon polygon2 = geometryFactory.createPolygon(coordinate2);public static void main(String[] args) {GeometryDescriptions geometryDescriptions = new GeometryDescriptions();geometryDescriptions.test03();}
}
Intersection 交集

在这里插入图片描述

public void test00() {LOGGER.info("交集:{}", polygon1.intersection(polygon2));
}
Union 并集

在这里插入图片描述

public void test01() {LOGGER.info("并集:{}", polygon1.union(polygon2));
}
Difference 差集

在这里插入图片描述

public void test02() {Geometry geometry = polygon1.difference(polygon2);LOGGER.info("差集:{}", geometry);
}
SymDifference 补集

在这里插入图片描述

public void test03() {Geometry geometry = polygon1.symDifference(polygon2);LOGGER.info("补集:{}", geometry);
}
http://www.lryc.cn/news/191165.html

相关文章:

  • 业务安全五重价值:防攻击、保稳定、助增收、促合规、提升满意度
  • shiro反序列化和log4j
  • 『Linux项目自动化构建工具』make/Makefile
  • github提示Permission denied (publickey),如何才能解决
  • 金x软件有限公司安全测试岗位面试
  • c语言之strlen函数使用和实现
  • 网络初识(JAVA EE)
  • kantts docker化
  • Axure RP医疗在线挂号问诊原型图医院APP原形模板
  • Vuex的基础使用存值及异步
  • git 重置到某次提交
  • Delphi 生成包含图片的 HTML 文件并使用 Edge 浏览器打开
  • 凉鞋的 Godot 笔记 108. 第二个通识:增删改查
  • AI Web3 盛会「EDGE」在港闭幕,融云国际影响力持续提升
  • 启动Spring Boot项目
  • 竞赛选题 深度学习 机器视觉 车位识别车道线检测 - python opencv
  • axios调用springboot项目接口获取数据简述版
  • MPP 架构在 OLAP 数据库的运用
  • 什么影响香港服务器的速度原因
  • HTML复习笔记
  • 「五度情报站」网罗全量企业情报,找客户、查竞品、寻商机!
  • Ubuntu 22.04‘Temporary failure resolving‘ 解决方案
  • 移动电源被亚马逊下架怎么办?UL2056认证解析
  • ssm+vue的课程网络学习平台管理系统(有报告)。Javaee项目,ssm vue前后端分离项目。
  • 10月13日上课内容 Ansible 的脚本 --- playbook 剧本
  • 碰撞检测算法——分离轴算法在Unity中实现(二)
  • 04在命令行中使用Maven命令创建Maven版的Web工程,并将工程部署到服务器的步骤
  • 什么是指标体系,怎么搭建一套完整的指标体系?(附PDF素材)
  • Windows提权方法论
  • 推荐系统领域,over-uniform和oversmoothing问题