+ Reply to Thread
Results 1 to 11 of 11

Thread: How to Outline a Dynamic Shapefile?

  1. #1
    Charles Gant
    Join Date
    Feb 2011
    Posts
    113
    Points
    5
    Answers Provided
    0


    0

    Default How to Outline a Dynamic Shapefile?

    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?

    Click image for larger version

Name:	untitledtest.PNG
Views:	52
Size:	524.0 KB
ID:	13589

  2. #2
    Joe Flannery
    Join Date
    Oct 2009
    Posts
    267
    Points
    45
    Answers Provided
    6


    0

    Default Re: How to Outline a Dynamic Shapefile?

    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 Flannery

  3. #3
    Charles Gant
    Join Date
    Feb 2011
    Posts
    113
    Points
    5
    Answers Provided
    0


    0

    Default Re: How to Outline a Dynamic Shapefile?

    Quote Originally Posted by jrflannery View Post
    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!

  4. #4
    Joe Flannery
    Join Date
    Oct 2009
    Posts
    267
    Points
    45
    Answers Provided
    6


    0

    Default Re: How to Outline a Dynamic Shapefile?

    Charles:

    Please see this Esri Online Help for the Dissolve tool:
    http://help.arcgis.com/en/arcgisdesk...0000005n000000

    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 Flannery

  5. #5
    Charles Gant
    Join Date
    Feb 2011
    Posts
    113
    Points
    5
    Answers Provided
    0


    0

    Default Re: How to Outline a Dynamic Shapefile?

    Quote Originally Posted by jrflannery View Post
    Charles:

    Please see this Esri Online Help for the Dissolve tool:
    http://help.arcgis.com/en/arcgisdesk...0000005n000000

    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.

  6. #6
    Joe Flannery
    Join Date
    Oct 2009
    Posts
    267
    Points
    45
    Answers Provided
    6


    0

    Default Re: How to Outline a Dynamic Shapefile?

    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.
    Joe Flannery

  7. #7
    Charles Gant
    Join Date
    Feb 2011
    Posts
    113
    Points
    5
    Answers Provided
    0


    0

    Default Re: How to Outline a Dynamic Shapefile?

    Quote Originally Posted by jrflannery View Post
    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!

  8. #8
    Joe Flannery
    Join Date
    Oct 2009
    Posts
    267
    Points
    45
    Answers Provided
    6


    0

    Default Re: How to Outline a Dynamic Shapefile?

    Try the Copy Features (Data Management) tool.
    http://help.arcgis.com/en/arcgisdesk...00000035000000

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

  9. #9
    Charles Gant
    Join Date
    Feb 2011
    Posts
    113
    Points
    5
    Answers Provided
    0


    0

    Default Re: How to Outline a Dynamic Shapefile?

    Quote Originally Posted by jrflannery View Post
    Try the Copy Features (Data Management) tool.
    http://help.arcgis.com/en/arcgisdesk...00000035000000

    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?

  10. #10
    Charles Gant
    Join Date
    Feb 2011
    Posts
    113
    Points
    5
    Answers Provided
    0


    0

    Default Re: How to Outline a Dynamic Shapefile?

    Quote Originally Posted by jrflannery View Post
    Try the Copy Features (Data Management) tool.
    http://help.arcgis.com/en/arcgisdesk...00000035000000

    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.

  11. #11
    Charles Gant
    Join Date
    Feb 2011
    Posts
    113
    Points
    5
    Answers Provided
    0


    0

    Default Re: How to Outline a Dynamic Shapefile?

    Joe,

    Nevermind. I got it figured out. Thanks again for all the help sir!

    Charles

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts