MergeDissolve (arcpyproduction.generalization)
摘要
Dissolves polygons that touch based on field values.
讨论
This function can be used to merge smaller features within the same feature class so they are all part of the correct subtype. For instance, suppose you have shrub and grass next to each other. At a larger scale, it may be easier to see the grass symbol beneath other features than the shrub. In this case, you could merge the shrub with the grass so it is easier to see on larger-scale maps.
语法
参数 | 说明 | 数据类型 |
polygon_feature_layer |
The features that are going to be merged. | Layer |
field | The field used to merge features. Features are only merged if the field values match. | Field |
order | Indicates whether the field values are prioritized in ascending or descending order. For instance, suppose you have two building features, one with a subtype of Education and another Unknown. If you use the subtype field to determine the merging, descending order would cause the features to merge as part of an Education feature. Ascending order would cause the features to be merged as part of an Unknown building feature.
| String |
代码实例
This example merges park features.
import arcpy
import arcpyproduction
from arcpyproduction import generalization
# set environment
arcpy.env.workspace="c:/Data/LocalGovernment.gdb"
# Check out Production Mapping license
arcpy.CheckOutExtension("Foundation")
# Define variables
inFeatures="ReferenceData/FacilitySite"
field='fcode'
where="FCODE='Park'"
# Create a feature layer
inFeatLayer=arcpy.MakeFeatureLayer_management(inFeatures,"Facilitieslyr",where)
# Execute the MergeDissolve function
generalization.MergeDissolve(inFeatLayer,field,'ASC')