Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
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 Apr 13 '13 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 Apr 13 '13 at 16:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.