arcgis js如何对两个polygon求交集

arcgis js如何对两个polygon求交集,生成一个新的geometry
已邀请:

turtle

赞同来自: 谢军

方案一:利用GeometryServiceTask中intersect函数实现(https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#intersect  不过该函数我没试过)

官方文档说明:The intersect operation is performed on a geometry service resource. This operation constructs the set-theoretic intersection between an array of geometries and another geometry.


方案二:想要实现目前api没有直接提供的功能,题主可以考虑一下先在桌面端构建功能模型(ModelBuilder),并发布成地理处理服务(GPService),这样就可以在浏览器端调用该服务(https://developers.arcgis.com/javascript/3/jsapi/geoprocessor-amd.html) 来实现相应功能。
关于地理处理服务的相关介绍和发布流程详见GP服务

 Geoprocessing services are how you expose the powerful analytic capability of ArcGIS to the world-wide web. Geoprocessing services contain geoprocessing tasks, and a task takes simple data captured in a web application, processes it, and returns meaningful and useful output in the form of features, maps, reports, and files. A task could calculate the probable evacuation area for a hazardous chemical spill, the predicted track and strength of a gathering hurricane, a report of land cover and soils within a user-defined watershed, a parcel map with historical details of ownership, or a permitting application for a septic system. The possibilities for these services are infinite.


 
 

binghuan123 - 80后

赞同来自:

楼上的第一个方法是可以的,只不过要连接服务器,其实也可以使用客户端的方法,在geometryEngine里面的intersect();不过要经常配合simplify()方法使用,把intersect()方法返回的结果使用simplify()执行一下。
require(["esri/geometry/geometryEngine"]
geometryEngine.intersect() 
 

jsforweb

赞同来自:

求交集用intersect()可以了,那如果求并集呢,有没有方法的,谢谢啦!

要回复问题请先登录注册