I do not understand why this simple script won't work. I can get it to dissolve in model builder but not from a script that I run from inside the map document. My output results are 4 polygons, just like my input file. I only want one.
Any suggestions?
# Import arcpy module
import arcpy
from arcpy import env
# Local variables:
env.workspace="C:\\Test\\shapefiles"
infeatures = "Multipolys.shp"
outfeatures = "C:\\Test\\shapefiles\\Dissolve.shp"
# Process: Dissolve
arcpy.Dissolve_management(infeatures, outfeatures, "", "", "SINGLE_PART", "DISSOLVE_LINES")
correct syntax is:
arcpy.Dissolve_management(infeatures, outfeatures, "", "", "MULTI_PART", "DISSOLVE_LINES")
ArcGIS 10.1 advanced.
1 Answer 1
The syntax is
Dissolve_management (in_features, out_feature_class, {dissolve_field}, {statistics_fields}, {multi_part}, {unsplit_lines})
You need to specify the dissolve_field as the third parameter - here you've left it blank.
-
I intentionally left it blank (it is optional) as I do not want to dissolved on a field. I want it one polygon. Dissolving it on a field will not do this. Coordinates are the same, ran repair. Might need to run in 'foreground'. How would I do this?user12059– user120592013年04月13日 15:23:16 +00:00Commented Apr 13, 2013 at 15:23
-
Duh. Syntax is 'arcpy.Dissolve_management(infeatures, outfeatures, "", "", "MULTI_PART", "DISSOLVE_LINES")' Still need to figure out how to run in foreground though.user12059– user120592013年04月13日 16:01:10 +00:00Commented Apr 13, 2013 at 16:01
Explore related questions
See similar questions with these tags.