当前位置:网站首页>[modulebuilder] GP service realizes the intersection selection of two layers in SDE
[modulebuilder] GP service realizes the intersection selection of two layers in SDE
2022-06-25 23:11:00 【DORIC. MA】
0 demand
SDE Save two feature classes in , One is the range line data , One is the target element data . Need to use GP The service implements a function , That is, specify a feature in the scope line feature class , Automatically filter out the features in the target feature class that intersect with the range line , And return the attribute information of intersecting elements .
1 Ideas
Several problems need to be solved :
- What analysis method is used to judge the intersection relationship between elements ?
- How to make
GPService can callSDEData in ?
About the problem 1:
The most straightforward way to judge the intersection relationship is to use 【 Analysis tools - Superposition analysis - The intersection 】 Tools , There is no big problem with this approach , But it needs to generate intermediate feature classes , And it takes a relatively long time , Not a good solution . One recommended way is to use 【 Data management tools - Layer and table views - Select layers by spatial location 】 Tools , The tool can also realize complex spatial relationship selection , No intermediate feature classes are generated and the time is short .
One more thing to pay attention to when judging the intersection relationship , In the use of 【 Select layers by spatial location 】 When the tool judges intersecting elements , Feature classes that share edges with the scope line are also judged to intersect , It is necessary to eliminate this special case from the search results .
About the problem 2:
call SDE The premise of the data in is Connect SDE, Can generate SDE Save the connection file to a specific path and assign the absolute path to GP Tools .
2 Realization
GP The tool flow is shown in the figure :

In this tool flow , The upper edge is the target feature class , The lower edge is the scope line feature class . The two intersect at 【 Select layers by spatial location 】, Then remove the common edge feature class , Get the target results . Detail the steps :
step 1: Specify the feature layer
Make Feature Layer The tool assigns the feature layer , Convert feature classes to feature layers , Make it a follow-up 【 Select layers by spatial location 】 Input class of the tool .
In the upper branch Dest_Name As Make Feature Layer Preconditions for tools , Represents the name of the target feature class , Used to dynamically specify the use of SDE Which feature class in is the target feature , Can improve the whole of GP Reusability of tools .
In the upper branch Dest Is a string variable , Used for setting up SDE Location of the feature class , The content is SDE The absolute path to the connection file and its internal feature classes .
In the upper branch Make Feature Layer The input variable is Dest, Output Dest_Layer.
The overall idea of the upper branch is similar to that of the upper branch , The only difference is to increase Code Variable input , This variable is used to construct SQL Statement to filter a specific feature in the scope line feature class . This variable is specified as GP Input parameters of the tool , Ensure that this parameter can be specified from the front end after the service is published .
step 2: Select layers by location
This link will Dest_Layer and Extent_Layer Select as input , Spatial relationship selection INTERSECT.
step 3: Remove common edge features
Input steps 2 The result of our choice , Spatial relationship selection 【 Edge intersection 】, Enter the range line again , The selection type is 【 Remove from the selected results 】. Set the processing result of this step as the output parameter , Ensure release GP After the service, the front end can obtain the processing results .

step 4: Execute tools and publish Services
Complete step by step GP Service release
3 Example GP Download tool
边栏推荐
- MySQL数据库索引
- The wisdom of questioning? How to ask questions?
- Flex & Bison 開始
- 判断预约时间是否已经过期
- ES6 const constants and array deconstruction
- APP测试要点
- Unity technical manual - getKey and getaxis and getbutton
- NLP text summary: use the pre training model to perform text summary tasks [transformers:pipeline, T5, Bart, Pegasus]
- 字符串变形(字符串大小写切换和变现)
- Initialization process of gstlibav
猜你喜欢

Civil Aviation Administration: by 2025, China will initially build a safe, intelligent, efficient and green aviation logistics system

Canoe: the fifth simulation project: simulation + test

How to use JMeter for interface testing

ES6 -- 形参设置初始值、拓展运算符、迭代器、生成函数

多台云服务器的 Kubernetes 集群搭建

Oracle - getting started

ES6-Const常量与数组解构

Why is BeanUtils not recommended?

STM32开发板+机智云AIoT+家庭监测控制系统

再突破!阿里云进入Gartner云AI开发者服务挑战者象限
随机推荐
ES6-- 模板字符串、对象的简化写法、箭头函数
Mysql database index
zabbix_ Server configuration file details
Utilisation de la classe Ping d'Unity
2022-2028 global iridium electrode industry research and trend analysis report
. SQL database import error: / *! 40101 SET @OLD_ COLLATION_ [email protected]@COLLATION_ CONNECTION */
.sql数据库导入错误:/*!40101 SET @[email protected]@COLLATION_CONNECTION */
建立自己的网站(15)
How to use JMeter for interface testing
腾讯《和平精英》新版本将至:新增账号安全保护系统,游戏内违规行为检测升级
2022-2028 global co extrusion production line industry research and trend analysis report
Analysis report on market demand situation and investment direction of China's optical transmission equipment industry from 2022 to 2028
zabbix_server配置文件详解
2022-2028 global open source cloud storage industry research and trend analysis report
What are the channels for Internet advertising to gain customers?
华为云SRE确定性运维专刊(第一期)
2022-2028 global TFT touch screen industry research and trend analysis report
adb常用命令
NLP pre training model-2018:bert dictionary
pdm导入vscode的实现方式