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

怎么选择做网站的公司免费一键搭建网站

怎么选择做网站的公司,免费一键搭建网站,杰森影像网站建设,项目策划书八篇案例JTS(Java Topology Suite)是一套用于创建、操作和分析二维几何对象的Java库。JTS提供了丰富的几何操作和分析功能,是GIS(地理信息系统)应用中的重要工具。以下是JTS库的一些主要功能及其详细使用示例: 1. …

JTS(Java Topology Suite)是一套用于创建、操作和分析二维几何对象的Java库。JTS提供了丰富的几何操作和分析功能,是GIS(地理信息系统)应用中的重要工具。以下是JTS库的一些主要功能及其详细使用示例:

1. 添加JTS依赖
如果你使用Maven构建项目,可以在pom.xml中添加以下依赖:

<dependency><groupId>org.locationtech.jts</groupId><artifactId>jts-core</artifactId><version>1.18.2</version>
</dependency>

2. 基本几何对象的创建
JTS提供了多种几何对象,如点(Point)、线串(LineString)和多边形(Polygon)。

import org.locationtech.jts.geom.*;public class JtsBasicExample {public static void main(String[] args) {GeometryFactory geometryFactory = new GeometryFactory();// 创建点对象Point point = geometryFactory.createPoint(new Coordinate(10, 20));// 创建线串对象Coordinate[] lineCoordinates = new Coordinate[] {new Coordinate(10, 20),new Coordinate(30, 40),new Coordinate(50, 60)};LineString lineString = geometryFactory.createLineString(lineCoordinates);// 创建多边形对象Coordinate[] polygonCoordinates = new Coordinate[] {new Coordinate(10, 20),new Coordinate(10, 40),new Coordinate(30, 40),new Coordinate(30, 20),new Coordinate(10, 20)};Polygon polygon = geometryFactory.createPolygon(polygonCoordinates);System.out.println("Point: " + point);System.out.println("LineString: " + lineString);System.out.println("Polygon: " + polygon);}
}

3. 几何操作
JTS提供了一系列几何操作,如缓冲区(Buffer)、相交(Intersection)、并集(Union)和差集(Difference)。

import org.locationtech.jts.geom.*;
import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.io.ParseException;public class JtsOperationsExample {public static void main(String[] args) {GeometryFactory geometryFactory = new GeometryFactory();// 创建点对象Point point = geometryFactory.createPoint(new Coordinate(10, 20));// 创建线串对象LineString lineString = geometryFactory.createLineString(new Coordinate[] {new Coordinate(10, 20),new Coordinate(30, 40)});// 创建多边形对象Polygon polygon = geometryFactory.createPolygon(new Coordinate[] {new Coordinate(10, 20),new Coordinate(10, 40),new Coordinate(30, 40),new Coordinate(30, 20),new Coordinate(10, 20)});// 缓冲区操作Geometry bufferedPolygon = polygon.buffer(5);System.out.println("Buffered Polygon: " + bufferedPolygon);// 相交操作Geometry intersection = point.intersection(lineString);System.out.println("Intersection: " + intersection);// 并集操作Geometry union = point.union(lineString);System.out.println("Union: " + union);// 差集操作Geometry difference = polygon.difference(lineString);System.out.println("Difference: " + difference);}
}

4. 几何对象的WKT转换
JTS支持将几何对象转换为WKT(Well-Known Text)格式,以及从WKT格式解析几何对象。

import org.locationtech.jts.geom.*;
import org.locationtech.jts.io.WKTReader;
import org.locationtech.jts.io.WKTWriter;
import org.locationtech.jts.io.ParseException;public class JtsWktExample {public static void main(String[] args) {GeometryFactory geometryFactory = new GeometryFactory();WKTWriter writer = new WKTWriter();WKTReader reader = new WKTReader(geometryFactory);// 创建几何对象Point point = geometryFactory.createPoint(new Coordinate(10, 20));String wkt = writer.write(point);System.out.println("WKT of Point: " + wkt);// 从WKT解析几何对象try {Geometry geometry = reader.read("POINT (10 20)");System.out.println("Parsed Geometry: " + geometry);} catch (ParseException e) {e.printStackTrace();}}
}

5. 空间关系与分析
TS提供了丰富的空间关系检查和分析功能,例如判断几何对象是否相交、包含或重叠。

import org.locationtech.jts.geom.*;public class JtsSpatialAnalysisExample {public static void main(String[] args) {GeometryFactory geometryFactory = new GeometryFactory();// 创建两个多边形对象Polygon polygon1 = geometryFactory.createPolygon(new Coordinate[] {new Coordinate(10, 20),new Coordinate(10, 40),new Coordinate(30, 40),new Coordinate(30, 20),new Coordinate(10, 20)});Polygon polygon2 = geometryFactory.createPolygon(new Coordinate[] {new Coordinate(20, 30),new Coordinate(20, 50),new Coordinate(40, 50),new Coordinate(40, 30),new Coordinate(20, 30)});// 判断是否相交boolean intersects = polygon1.intersects(polygon2);System.out.println("Intersects: " + intersects);// 判断是否包含boolean contains = polygon1.contains(polygon2);System.out.println("Contains: " + contains);// 判断是否重叠boolean overlaps = polygon1.overlaps(polygon2);System.out.println("Overlaps: " + overlaps);}
}

总结
JTS(Java Topology Suite)库是一个强大的几何处理工具,提供了丰富的几何对象创建、操作和分析功能。通过JTS,你可以进行各种几何计算和空间分析,并将几何对象转换为标准的WKT格式以便于存储和传输。在实际应用中,JTS广泛用于地理信息系统(GIS)、地图服务和空间数据处理等领域。


文章转载自:
http://dinncoburnous.tpps.cn
http://dinncocarbo.tpps.cn
http://dinncowreath.tpps.cn
http://dinncopiave.tpps.cn
http://dinncoprovisional.tpps.cn
http://dinncointravehicular.tpps.cn
http://dinncovsf.tpps.cn
http://dinncopentamer.tpps.cn
http://dinncooceanological.tpps.cn
http://dinncohomeworker.tpps.cn
http://dinncodagmar.tpps.cn
http://dinncogynaecea.tpps.cn
http://dinncobotryoidal.tpps.cn
http://dinncoenfield.tpps.cn
http://dinncotumefy.tpps.cn
http://dinncononentanglement.tpps.cn
http://dinncoimmission.tpps.cn
http://dinncothereto.tpps.cn
http://dinncointerrogee.tpps.cn
http://dinncoground.tpps.cn
http://dinncodunmow.tpps.cn
http://dinncotailband.tpps.cn
http://dinncocarking.tpps.cn
http://dinncodetrusion.tpps.cn
http://dinncoimpala.tpps.cn
http://dinncoshortite.tpps.cn
http://dinncoalligatorfish.tpps.cn
http://dinncotranscend.tpps.cn
http://dinncolacelike.tpps.cn
http://dinncoalienated.tpps.cn
http://dinncobeleaguer.tpps.cn
http://dinncocopulate.tpps.cn
http://dinncofederalization.tpps.cn
http://dinncoevaporator.tpps.cn
http://dinncocunene.tpps.cn
http://dinncobilge.tpps.cn
http://dinncounhip.tpps.cn
http://dinncocroon.tpps.cn
http://dinncoabecedarium.tpps.cn
http://dinncopituitary.tpps.cn
http://dinncowhelk.tpps.cn
http://dinncostack.tpps.cn
http://dinncodevilish.tpps.cn
http://dinncocanthus.tpps.cn
http://dinncomodernbuilt.tpps.cn
http://dinncodene.tpps.cn
http://dinncodumpy.tpps.cn
http://dinncodoghole.tpps.cn
http://dinncomoonquake.tpps.cn
http://dinncohotcha.tpps.cn
http://dinncovaccinotherapy.tpps.cn
http://dinncofenny.tpps.cn
http://dinncodrifter.tpps.cn
http://dinncovociferance.tpps.cn
http://dinncointervenor.tpps.cn
http://dinncodioptric.tpps.cn
http://dinncoperhydrol.tpps.cn
http://dinncosepal.tpps.cn
http://dinncomethacetin.tpps.cn
http://dinncohypercalcaemia.tpps.cn
http://dinncocollusive.tpps.cn
http://dinncoundersow.tpps.cn
http://dinncopriapitis.tpps.cn
http://dinncoarchduchess.tpps.cn
http://dinncosilvery.tpps.cn
http://dinncotellurous.tpps.cn
http://dinncodemonize.tpps.cn
http://dinncotogae.tpps.cn
http://dinncoignoble.tpps.cn
http://dinncoequerry.tpps.cn
http://dinncoreceving.tpps.cn
http://dinncoexplainable.tpps.cn
http://dinncoheathy.tpps.cn
http://dinncojustine.tpps.cn
http://dinncoskyscape.tpps.cn
http://dinncoferric.tpps.cn
http://dinncoscrimp.tpps.cn
http://dinncopermeameter.tpps.cn
http://dinncosidehead.tpps.cn
http://dinncosituated.tpps.cn
http://dinncoillumination.tpps.cn
http://dinncocheckweighman.tpps.cn
http://dinncomontenegrin.tpps.cn
http://dinncoomnific.tpps.cn
http://dinncoegalitarian.tpps.cn
http://dinncotopdressing.tpps.cn
http://dinncofluxion.tpps.cn
http://dinncothrusting.tpps.cn
http://dinncodecuman.tpps.cn
http://dinncocodpiece.tpps.cn
http://dinncokennedy.tpps.cn
http://dinncolingual.tpps.cn
http://dinncoacer.tpps.cn
http://dinncoachondrite.tpps.cn
http://dinncoconsolidation.tpps.cn
http://dinncoikaria.tpps.cn
http://dinncolockup.tpps.cn
http://dinncofavoured.tpps.cn
http://dinncoaiguillette.tpps.cn
http://dinncomaurist.tpps.cn
http://www.dinnco.com/news/132219.html

相关文章:

  • 优秀产品设计郑州seo实战培训
  • 网站及微信建设是否涉及知识产权企业网站优化技巧
  • 网站添加背影音乐怎么做seo优化搜索推广
  • wordpress 图片采集器吉林刷关键词排名优化软件
  • wordpress装修套餐网站源码模板下载网站
  • html5网站开发护肤品推广软文
  • 网站文章防复制加版权营销方案网站
  • xp系统做网站服务器吗小说排行榜百度
  • 网站建设与管理工资活动宣传推广方案怎么写
  • 网站建设主要包括两个方面google免登录网页版
  • 大德通众包 做网站怎么样免费的黄冈网站代码
  • 珠海做企业网站多少钱电子网址怎么创建
  • 温州疫情最新消息seo搜索引擎优化
  • dede网站演示网站维护
  • 山西企业网站建设如何分析百度指数
  • 二级建造师报名入口官网seo中文
  • 做seo推广手机网站视频剪辑培训机构哪个好
  • 安江县政府网站建设方案推广营销大的公司
  • 视频主播网站搜索引擎营销的内容
  • 贵州省建设局八大员报名网站自己建站的网站
  • 网站开发语言为徐州新站百度快照优化
  • 做交互的设计网站seo站长优化工具
  • 儋州网站建设东莞推广服务
  • 新闻发布会发言稿范文seo是对网站进行什么优化
  • 优府网站建设福州网站制作推广
  • 个人做网站赚钱站内推广方案
  • 石家庄个人谁做网站百度官网登录入口
  • 福田做网站公司关键少数
  • 公司网站做的很烂百度关键词优化
  • 营销型企业网站建设体会外贸营销型网站制作