Select to view content in your preferred language

Error 210 and 725

3275
4
07-12-2010 09:20 AM
evanpicard
Emerging Contributor
I have a pretty simple (but long winded) model that is supposed to do the following:
input polygon data
project
create centroids of the original
create lines and simplify/smooth for 1 scale
dissolve, create centroids
create lines of the simplified version, and simplify/smooth these

I get the following:

Executing (Polygon To Line): PolygonToLine "C:\LOCAL ARC WORK\boundary.gdb\BoundaryProjected" BoundaryPRJP2L
Start Time: Mon Jul 12 12:51:51 2010

ERROR 000210: Cannot create output BoundaryPRJP2L


Error code: 000210: Cannot create output <value>
Description:  The output cannot be created. Potential reasons could include data locking, path being incorrect, and access rights.
Solution: Confirm the data is not locked by another user or application, and confirm that you have full rights to the workspace being used. Check to make sure the path to the data is correct (check for typos in the folder path). Try creating the output in a new location.
I am the only one using this data, its on my C: drive.
I have full rights.

If I set the output of EVERY process to be "Managed" it works without error, but then it doesn't delete the intermediate data, and I cant find the final results.  My final result should be:

Boundary05M_Points
Boundary05M
Boundary10M
Boundary10M_Points



if anyone wants to see the python export of it, here it is:
 # ---------------------------------------------------------------------------
# generalize.py
# Created on: Mon Jul 12 2010 01:03:19 PM
#   (generated by ArcGIS/ModelBuilder)
# Usage: generalize <Input_Dataset_or_Feature_Class> <Input_Coordinate_System> <Output_Coordinate_System> 
# ---------------------------------------------------------------------------

# Import system modules
import sys, string, os, arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

# Set the necessary product code
gp.SetProduct("ArcInfo")

# Load required toolboxes...
gp.AddToolbox("C:/Documents and Settings/evan.picard/Desktop/evan/Evanstool.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx")

# Script arguments...
Input_Dataset_or_Feature_Class = sys.argv[1]

Input_Coordinate_System = sys.argv[2]

Output_Coordinate_System = sys.argv[3]
if Output_Coordinate_System == '#':
 Output_Coordinate_System = "PROJCS['World_Robinson',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Robinson'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],UNIT['Meter',1.0]]" # provide a default value if unspecified

# Local variables...
BoundaryPRJP2LSimpPR500 = "C:\\LOCAL ARC WORK\\boundary.gdb\\BoundaryPRJP2LSimpPR500"
BoundaryPRJP2LSimpPR500_Pnt = "C:\\LOCAL ARC WORK\\boundary.gdb\\BoundaryPRJP2LSimpPR500_Pnt"
BoundaryPRJP2LSimpPR500B2500 = "C:\\LOCAL ARC WORK\\boundary.gdb\\BoundaryPRJP2LSimpPR500B2500"
BoundaryPRJP2LSimpPR500B2500_Pnt = "C:\\LOCAL ARC WORK\\boundary.gdb\\BoundaryPRJP2LSimpPR500B2500_Pnt"
BoundaryPRJP2LSimpPR500B2500SM_P5k = "C:\\LOCAL ARC WORK\\boundary.gdb\\BoundaryPRJP2LSimpPR500B2500SM_P5k"
BoundaryProjectedP2L = "BoundaryProjectedP2L"
BoundaryPRJP2LSimpPR500B2500SM10k = "BoundaryPRJP2LSimpPR500B2500SM10k"
Boundary05M = "C:\\LOCAL ARC WORK\\boundary.gdb\\Boundary05M"
Boundary10M = "C:\\LOCAL ARC WORK\\boundary.gdb\\Boundary10M"
ProjectedOutput = "C:\\LOCAL ARC WORK\\boundary.gdb\\BoundaryProjected"
Delete_succeeded = "C:\\LOCAL ARC WORK\\boundary.gdb\\BoundaryPRJP2LSimpPR500_Pnt"
Delete_succeeded__2_ = "C:\\LOCAL ARC WORK\\boundary.gdb\\BoundaryPRJP2LSimpPR500B2500_Pnt"
Delete_succeeded__4_ = "BoundaryProjectedP2L"
Output_Feature_Class_Points = "BoundarySourceProjectedSelected_Points"
BoundarySourceProjectedDissolved = "BoundarySourceProjectedDissolved"
Dissolve_Field_s_ = "ADM1_Name;CNTY_Code"
BoundarySourceProjectedDissolvedLine = "BoundarySourceProjectedDissolvedLine"
BoundarySourceProjectedDissolvedLineSimp = "BoundarySourceProjectedDissolvedLineSimp"
BoundarySourceProjectedDissolvedLineSimp_Pnt = "BoundarySourceProjectedDissolvedLineSimp_Pnt"
Delete_succeeded__5_ = "BoundarySourceProjectedDissolvedLineSimp_Pnt"
BoundarySourceProjectedDissolvedLineSimpSimp = "BoundarySourceProjectedDissolvedLineSimpSimp"
BoundarySourceProjectedDissolvedLineSimpSimp_Pnt = "BoundarySourceProjectedDissolvedLineSimpSimp_Pnt"
Delete_succeeded__6_ = "BoundarySourceProjectedDissolvedLineSimpSimp_Pnt"
Boundary05M_Points = "Boundary05M_Points"
bdnoutputpoints = "bdnoutputpoints"
BoundarySourceProjectedSelected = "BoundarySourceProjectedSelected"
Boundary10M_Points = "Boundary10M_Points"

# Process: Project (4)...
gp.Project_management(Input_Dataset_or_Feature_Class, ProjectedOutput, Output_Coordinate_System, "", Input_Coordinate_System)

# Process: Polygon To Line...
gp.PolygonToLine_management(ProjectedOutput, BoundaryProjectedP2L)

# Process: Simplify Line...
gp.SimplifyLine_management(BoundaryProjectedP2L, BoundaryPRJP2LSimpPR500, "POINT_REMOVE", "500 Meters", "FLAG_ERRORS", "NO_KEEP", "NO_CHECK")

# Process: Simplify Line (2)...
gp.SimplifyLine_management(BoundaryPRJP2LSimpPR500, BoundaryPRJP2LSimpPR500B2500, "BEND_SIMPLIFY", "2500 Meters", "FLAG_ERRORS", "NO_KEEP", "NO_CHECK")

# Process: Smooth Line...
gp.SmoothLine_management(BoundaryPRJP2LSimpPR500B2500, BoundaryPRJP2LSimpPR500B2500SM_P5k, "PAEK", "5000 Meters", "NO_FIXED", "NO_CHECK")

# Process: Project (2)...
gp.Project_management(BoundaryPRJP2LSimpPR500B2500SM_P5k, Boundary05M, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "", "PROJCS['World_Robinson',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Robinson'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],UNIT['Meter',1.0]]")

# Process: Dissolve...
gp.toolbox = "C:/Documents and Settings/evan.picard/Desktop/evan/Evanstool.tbx";
gp.Dissolve(ProjectedOutput, BoundarySourceProjectedDissolved, Dissolve_Field_s_, "", "SINGLE_PART", "DISSOLVE_LINES")

# Process: Polygon To Line (2)...
gp.PolygonToLine_management(BoundarySourceProjectedDissolved, BoundarySourceProjectedDissolvedLine)

# Process: Simplify Line (3)...
gp.SimplifyLine_management(BoundarySourceProjectedDissolvedLine, BoundarySourceProjectedDissolvedLineSimp, "POINT_REMOVE", "500 Meters", "FLAG_ERRORS", "NO_KEEP", "NO_CHECK")

# Process: Simplify Line (4)...
gp.SimplifyLine_management(BoundarySourceProjectedDissolvedLineSimp, BoundarySourceProjectedDissolvedLineSimpSimp, "BEND_SIMPLIFY", "2500 Meters", "FLAG_ERRORS", "NO_KEEP", "NO_CHECK")

# Process: Smooth Line (2)...
gp.SmoothLine_management(BoundarySourceProjectedDissolvedLineSimpSimp, BoundaryPRJP2LSimpPR500B2500SM10k, "PAEK", "10000 Meters", "FIXED_CLOSED_ENDPOINT", "NO_CHECK")

# Process: Project (3)...
gp.Project_management(BoundaryPRJP2LSimpPR500B2500SM10k, Boundary10M, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "", "PROJCS['World_Robinson',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Robinson'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],UNIT['Meter',1.0]]")

# Process: Delete...
gp.toolbox = "C:/Documents and Settings/evan.picard/Desktop/evan/Evanstool.tbx";
gp.Delete(BoundaryPRJP2LSimpPR500_Pnt, "")

# Process: Delete (2)...
gp.toolbox = "C:/Documents and Settings/evan.picard/Desktop/evan/Evanstool.tbx";
gp.Delete(BoundaryPRJP2LSimpPR500B2500_Pnt, "")

# Process: Delete (4)...
gp.toolbox = "C:/Documents and Settings/evan.picard/Desktop/evan/Evanstool.tbx";
gp.Delete(BoundaryProjectedP2L, "")

# Process: Delete (5)...
gp.toolbox = "C:/Documents and Settings/evan.picard/Desktop/evan/Evanstool.tbx";
gp.Delete(BoundarySourceProjectedDissolvedLineSimp_Pnt, "")

# Process: Delete (6)...
gp.toolbox = "C:/Documents and Settings/evan.picard/Desktop/evan/Evanstool.tbx";
gp.Delete(BoundarySourceProjectedDissolvedLineSimpSimp_Pnt, "")

# Process: Select...
gp.Select_analysis(ProjectedOutput, BoundarySourceProjectedSelected, "")

# Process: Feature To Point...
gp.FeatureToPoint_management(BoundarySourceProjectedSelected, Output_Feature_Class_Points, "INSIDE")

# Process: Project...
gp.Project_management(Output_Feature_Class_Points, Boundary05M_Points, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "", "")

# Process: Feature To Point (2)...
gp.FeatureToPoint_management(BoundarySourceProjectedDissolved, bdnoutputpoints, "INSIDE")

# Process: Project (5)...
gp.Project_management(bdnoutputpoints, Boundary10M_Points, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "", "")


 
0 Kudos
4 Replies
SimonWillis
Emerging Contributor
I don't see gp.workspace.
if you use that, you don't need to use long paths and maybe that solves your lock and output problems?
maybe
gp.workspace = "C:\\LOCAL ARC WORK\\boundary.gdb"
so
BoundaryPRJP2LSimpPR500 = "BoundaryPRJP2LSimpPR500"
BoundaryPRJP2LSimpPR500_Pnt = "BoundaryPRJP2LSimpPR500_Pnt"
etc

Also, some tips:
I am definitely not a fan of using spaces in my filenames and paths - I don't think ESRI is either.  I always use try & except blocks to catch errors and lots of print statement. It helps me keep track of what's going on. What happens if the data already exists? I don't see
gp.overwriteoutput = 1
or maybe you don't want that. The except block would catch it and other errors! and stepping through your code would help while toggling between arccatalog and python to check your data output.

import traceback #add this up top with the other modules

try:
#your code here

except:
    # Get the traceback object
    #
    tb = sys.exc_info()[2]
    # tbinfo contains the failure�??s line number and the line�??s code
    tbinfo = traceback.format_tb(tb)[0]


    print tbinfo # provides where the error occurred
    print sys.exc_type # provides the type of error
    print sys.exc_value # provides the error message

    
    # Concatenate information together concerning the error into a message string
    #
    pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1])
    msgs = "Geoprocessing ERRORS:\n" + gp.GetMessages(2) + "\n"

    # Return python error messages for use in script tool or Python Window
    #
    gp.AddError(pymsg)
    gp.AddError(msgs)

    # Print Python error messages for use in Python / Python Window
    #
    print pymsg + "\n"
    print msgs
0 Kudos
evanpicard
Emerging Contributor
Thank you.
I am now using the %workspace% and %scratchworkspace% variables, but now it won't delete the intermediate data.  Help!
http://forums.arcgis.com/threads/8149-intermediate-data
0 Kudos
SimonWillis
Emerging Contributor
Since you have a lot going on in your script, it's hard to say where the problem lies. Do you have lock files present? After adding try/except, does your code give a specific error message or does it end fine? maybe an easy work around would be to create an in-memory layer instead of creating/deleting feature classes? ->make Feature Layer.  It's probably in data management tools.
0 Kudos
evanpicard
Emerging Contributor
There are no lock files present.
It ends clean as a whistle.
what is try/except?
I removed the "intermediate data" from everything and added a "delete."
it works.
0 Kudos