How to Outline a Dynamic Shapefile?

3464
10
04-17-2012 05:41 AM
CharlesGant
New Contributor III
Hey folks,

I have a shapefile that I have loaded in arcmap of some counties.  After a piece of python script runs, the counties are shaded to represent some data that was input into the python script.  What I would like to be able to do, is outline these counties instead of shading them.  Also, to clarify, I would like to be able to outline the outer extent only.  I know how to outline each county itself, but what I want is ONE outline for the whole region of selected counties. 

Attached is an image of what I'm looking at.  I want to be able to outline the whole set of red counties, not just each county.  Thoughts?

[ATTACH=CONFIG]13589[/ATTACH]
0 Kudos
10 Replies
JoeFlannery
Occasional Contributor III
Charles:

In your python script, could you add code to output a "dissolved" new featureclass of your selected counties for an "outline" shape that represents all counties being considered?
0 Kudos
CharlesGant
New Contributor III
Charles:

In your python script, could you add code to output a "dissolved" new featureclass of your selected counties for an "outline" shape that represents all counties being considered?


Joe,

Reading up on it now.  Thanks for the Idea!  I'll get back to ya!
0 Kudos
JoeFlannery
Occasional Contributor III
Charles:

Please see this Esri Online Help for the Dissolve tool:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000005n000000

If all your counties of interest have a common attribute in an attribute field, you can "dissolve" on the field/attribute and create a new featureclass.
0 Kudos
CharlesGant
New Contributor III
Charles:

Please see this Esri Online Help for the Dissolve tool:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000005n000000

If all your counties of interest have a common attribute in an attribute field, you can "dissolve" on the field/attribute and create a new featureclass.


Joe,

So I tried it, and it gave me an error.  Let me elaborate a little more on what I have.  I have a shapefile that is joined to a .csv file.  The field 'ZONEGROUP' is the joined field.  When I open the attribute table of the shapefile after the join, I see the field and it joined correctly (obviously, or the counties would not shade).  The field has one of 5 values that are possible.  The integers 1-4, and 'null'.  Could it be the 'null' that is the issue?  If I try to dissolve on just the 'FID' field, it works fine and joins all the counties into one shape.  Again, if I try it on the 'ZONEGROUP' field, it gives me a general error.
0 Kudos
JoeFlannery
Occasional Contributor III
The dissolve tool may not be recognizing the joined field as a legitimate field to perform the task.  Perform the join to csv and then create a new featureclass and then perform the dissolve on that new featureclass.
0 Kudos
CharlesGant
New Contributor III
The dissolve tool may not be recognizing the joined field as a legitimate field to perform the task.  Perform the join to csv and then create a new featureclass and then perform the dissolve on that new featureclass.


Did it within ArcMap and it worked like a charm!  Now I just gotta figure out the code to export one feature class to a new feature class.

Thanks Again Joe!
0 Kudos
JoeFlannery
Occasional Contributor III
Try the Copy Features (Data Management) tool.
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000035000000

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.CopyFeatures_management("InFeature.shp", "C:/output/output.gdb/OutFeature")
0 Kudos
CharlesGant
New Contributor III
Try the Copy Features (Data Management) tool.
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000035000000

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.CopyFeatures_management("InFeature.shp", "C:/output/output.gdb/OutFeature")


Ok.  Well that scripts works just fine but the joined data is not coming through to the new feature shapefile.  I have the file joined within the arcmap document itself, could that be why?  Do I need to do it with python somehow?
0 Kudos
CharlesGant
New Contributor III
Try the Copy Features (Data Management) tool.
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000035000000

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.CopyFeatures_management("InFeature.shp", "C:/output/output.gdb/OutFeature")


Well I figured out the syntax to join, but once again, I'm gettin an error.  Below is the error:

WARNING 000970: The join field ZONE in the join table MEGCWAforHAZARDS is not indexed. To improve performance, we recommend that an index be created for the join field in the join table.
Failed to execute (AddJoin)


I'm trying to join a .csv to a .shp.  Is that a problem?  I tried converting the .csv to .dbf, yet I still get the same error.
0 Kudos