Select to view content in your preferred language

Problem writing to file geodatabase other than default.gdb

2382
4
Jump to solution
06-12-2014 10:45 AM
JaniceBaird
Frequent Contributor
I have a script that selects parcels within a boundary and then runs a dissolve on those parcels. I have a file geodatabase that I want to use for the output. If I have my workspace set to my default.gdb, everything works great. When I change my workspace to a different file geodatabase, I get "ExecuteError: ERROR 000210: Cannot create output" and the dissolve fails to execute. When I look into the file geodatabase, the new feature class is created but it is empty.

Are there permissions or environment variables that need to be set so that I can write to a different FGDB?

what am I doing wrong?

Thanks,
Janice.

import sys, os import arcpy from arcpy import env  env.overwriteOutput = True  ### Set the workspace --- env.workspace = r"C:\Users\janiceb\Documents\ArcGIS\Default.gdb" ##env.workspace = r"\\skagit\dept\gis\janiceb\Projects\Health\June_2014\Septic.gdb"  print env.workspace  ## Parcel Layer prodParcelPolys = r"Database Connections\SQLVM3_scgis.sde\Scgis.SDEADM.Parcel_Polys" tempParcels = "Temp_Copy_of_Parcels" tempDOHParcels = "Temp_Copy_of_DOH_Parcels" ## MRA Layer prodMRAPolys = r"Database Connections\SQLVM9_Health.sde\Health.SDEADM.MarineRecoveryAreas" tempMRAs = "Temp_Copy_of_MRAs" ## Final Data to be written to file geodatabase for sharing with DOH finalDOHParcels = "ParcelsInMRA"  # Make a temporary layer from the parcel feature class print("   -> Making temporary copy of the Parcel layer...") arcpy.MakeFeatureLayer_management(prodParcelPolys, tempParcels)  # Make a temporary layer from the MRA feature class print("   -> Making temporary copy of the MRA layer...") arcpy.MakeFeatureLayer_management(prodMRAPolys, tempMRAs)  # Select those parcels with centroid in MRA Polygons arcpy.SelectLayerByLocation_management(tempParcels, "HAVE_THEIR_CENTER_IN", tempMRAs, 5, "NEW_SELECTION") print("FYI :: Number of parcels with centroid in MRA Polygons: {0}".format(str(arcpy.GetCount_management(tempParcels).getOutput(0))))  # Dissolve the parcels in the MRA by PARCELID # This will combine parcels with duplicate parcelid values (ex: parcels divided by a road or river.) # This will give us a feature class of parcels which are located in the MRA print("   -> Dissolving by parcel id...") dissolveFields = ["PARCELID"] arcpy.Dissolve_management(tempParcels, finalDOHParcels, dissolveFields, "", "MULTI_PART", "") Total_Parcels_In_MRA = int(arcpy.GetCount_management(finalDOHParcels).getOutput(0)) print("FYI :: Number of parcels in MRA after Dissolve: {0}".format(str(Total_Parcels_In_MRA)))
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JaniceBaird
Frequent Contributor
So I spoke with a couple of my co-workers who were in today and got the scoop on what is probably giving me issues...

http://support.esri.com/en/knowledgebase/techarticles/detail/41119/?WT.mc_id=EmailCampaign15945

I heard of this long, long, ago! This has to do with creating file geodatabases on a network. I do not see the mentioned Microsoft Hot Fix on the server that I am running the script on but decided to discontinue the struggle and add the extra steps of creating my data locally and then copying it out to the network when I am done.

Anyone have more news on this issue and why is it still an issue? It seems that it has been a known problem for over a year! I am using 10.1.

Thanks,
Janice.

View solution in original post

4 Replies
JamesCrandall
MVP Frequent Contributor
env.workspace = r"\\skagit\dept\gis\janiceb\Projects\Health\June_2014\Septic.gdb"


It can't find this path.  Give it the drive letter (if it is a mapped drive) or the complete UNC path (make sure "\\skagit" is correct).

Suggestion: navigate to this Spetic.gdb in your ArcCatalog tree, then clickin the "Location" box to select the full path.  Right-click and choose "copy".  Then paste it into your code base.

Edit:  Or..  http://support.esri.com/en/knowledgebase/techarticles/detail/41280
0 Kudos
JaniceBaird
Frequent Contributor
James,

\\skagit\dept\gis\janiceb\projects\Health\June_2014\Septic.gdb

this is the location that I go to in Catalog. The script actually creates the new feature class in the geodatabase but dissolve is unable to write to it.

I can use arcpy.ListWorkspaces and see the location and the file geodatabase. I can run the script with the default.gdb but not my septic.gdb.

The link you provided is about Microsoft Security Essentials and I can not find that on my workstation...

thanks for the info
Janice.
0 Kudos
JamesCrandall
MVP Frequent Contributor
Maybe check to make sure correct permissions are set to allow you to write to the directory:

\\skagit\dept\gis\janiceb\Projects\Health\June_2014

Edit: the link also says: "...Other anti-virus programs/applications can also prevent the creation of the feature class".  Perhaps it isn't just related to Microsoft Essentials?  Not sure.
0 Kudos
JaniceBaird
Frequent Contributor
So I spoke with a couple of my co-workers who were in today and got the scoop on what is probably giving me issues...

http://support.esri.com/en/knowledgebase/techarticles/detail/41119/?WT.mc_id=EmailCampaign15945

I heard of this long, long, ago! This has to do with creating file geodatabases on a network. I do not see the mentioned Microsoft Hot Fix on the server that I am running the script on but decided to discontinue the struggle and add the extra steps of creating my data locally and then copying it out to the network when I am done.

Anyone have more news on this issue and why is it still an issue? It seems that it has been a known problem for over a year! I am using 10.1.

Thanks,
Janice.