Clip tool adds an extra ".shp" to the output filename, triggering error message

3495
4
Jump to solution
06-19-2016 05:34 PM
EllenDoudna
New Contributor II

Hello,

I'm using ArcGIS Desktop 10.3.  My workspace parameters are set correctly, to the geodatabase with all the other feature class files.  When I run the Clip tool, it adds an extra ".shp" to the output filename, and then gives me the error that the output name contains invalid characters (the period).

I've tried deleting the .shp in the name before running.  I've tried running the tool in Arcpy, with the same result.

The data I'm clipping is from a state agency, gis shapefile made publicly available.

Any ideas what to try next?

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

send the shapefile to a folder where it is intended to reside, otherwise use a gdb featureclass

View solution in original post

4 Replies
DanPatterson_Retired
MVP Emeritus

send the shapefile to a folder where it is intended to reside, otherwise use a gdb featureclass

RebeccaStrauch__GISP
MVP Emeritus

I don't have 10.3.0 to test, but checked it with 10.3.1 and it worked as expected.  Are you using the clip_analysis tool? Clip—Help | ArcGIS for Desktop

Python snippet

# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script
# The following inputs are layers or table views: "GMU", "ClipPoly"
arcpy.Clip_analysis(in_features="GMU", clip_features="ClipPoly", out_feature_class="C:/_temp/clippedGMU.shp", cluster_tolerance="")

Some things to check:

  • Are you maybe trying to put the .shp file into a .gdb instead of just a folder?
    If trying to make a featureclass in the .gdb, it will not be a shape file and should not have the extension.  As Dan mentioned, that might be a better choice.
  • Make sure to keep the output name short, no spaces or special characters.  Underlines should be ok.
  • the "Clip Features" needs to be a polygon
  • It help is the "Clip Features" is in the same projection as the features you plan to clip.  If a proper projection is assigned to both, it may work, but since shape files need a .prj file, and sometime they are not the newer standard names, that can cause issues (although that would not be why you get .shp.shp)

Check those things out and see if that fixes it.  If you are still getting a double .shp, give a snapshot of the command window and hoe you have it filled out.  Although I tested in 10.3.1, I had 10.3.0 for quite a while and don't remember any issues, just fyi.

JayantaPoddar
MVP Esteemed Contributor

Make sure you set the SCRATCH WORKSPACE to the geodatabase in the Environment settings as well.



Think Location
0 Kudos
EllenDoudna
New Contributor II

Thank you all for responding,

It was a folder issue--I was trying to put the .shp file into a .gdb instead of just a folder.  I fixed that, and it worked fine.

Ellen

0 Kudos