JTS: 20 InteriorPoint 内部中心点

编程入门 行业动态 更新时间:2024-10-17 19:23:09

JTS: 20 InteriorPoint 内部<a href=https://www.elefans.com/category/jswz/34/1733457.html style=中心点"/>

JTS: 20 InteriorPoint 内部中心点

文章目录

      • 版本
      • 代码

版本

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

代码

package pers.stu.algorithm;import org.locationtech.jts.algorithm.InteriorPoint;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Polygon;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pers.stu.util.GeoGebraUtil;/*** 内部中心点* @author LiHan* 2023-11-13 10:11:16*/
public class InteriorPointUse {private static final Logger LOGGER = LoggerFactory.getLogger(AngleUse.class);public static void main(String[] args) {InteriorPointUse interiorPointUse = new InteriorPointUse();interiorPointUse.test00();}public void test00() {GeometryFactory geometryFactory = new GeometryFactory();Coordinate[] coordinates = new Coordinate[] {new Coordinate(3, 10), new Coordinate(12, 10),new Coordinate(12, 3), new Coordinate(3, 3),new Coordinate(3, 10)};Polygon polygon = geometryFactory.createPolygon(coordinates);LOGGER.info(GeoGebraUtilpare(polygon));Coordinate coordinate = InteriorPoint.getInteriorPoint(polygon);LOGGER.info("中心点:{}", coordinate);}
}
18:17:57.118 [main] INFO  pers.stu.util.GeoGebraUtil - geometry类型:Polygon
18:17:57.120 [main] INFO  pers.stu.algorithm.AngleUse - Polygon(Point({3.0,10.0}),Point({12.0,10.0}),Point({12.0,3.0}),Point({3.0,3.0}),Point({3.0,10.0}))
18:17:57.123 [main] INFO  pers.stu.algorithm.AngleUse - 中心点:(7.5, 6.5, NaN)

更多推荐

JTS: 20 InteriorPoint 内部中心点

本文发布于:2023-11-15 01:04:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1590924.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中心点   JTS   InteriorPoint

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!