I have built a geoprocessing tool using arcpy modules in python. Screenshot shown below:
In this tool I am creating Service Area Polygons and selecting census boundaries within those Service Area Polygons to extract the demographic data. The part where I am creating the service area polygon and copying them to output is shown below:
#PART 3: CREATING SERVICE AREA POLYGON USING DRIVING DISTANCE AS COST FACTOR AND INTERSECTING WITH CENSUS LAYER AND CREATING OUTPUT
Service_Area = "Service Area"
# Process: Make Service Area Layer
arcpy.na.MakeServiceAreaLayer(road_network, Service_Area, "Length", "", distance)
# Process: Add Facility to the Network
arcpy.na.AddLocations(Service_Area, "Facilities", "facility", "", "")
# Process: Solve the Network
arcpy.na.Solve(Service_Area)
# Copy Polygons to Service Area output
arcpy.CopyFeatures_management(Service_Area, service_area_output)
# Process: Create a new Feature layer - Census layer
arcpy.MakeFeatureLayer_management(cen_blk,"blocks_lyr")
# Process: Create a new Feature layer - Census layer
arcpy.MakeFeatureLayer_management(service_area_output,"service_area_output")
# Process: Select Layer By Location...
arcpy.SelectLayerByLocation_management("blocks_lyr", "HAVE_THEIR_CENTER_IN", "service_area_output")
if census_output=="#" or census_output=="":
census_output==None
else:
# Process: Copy the intersected census layer to output FC and add it into current workspace
arcpy.CopyFeatures_management("blocks_lyr", census_output)
gp.AddMessage (" ")
I cannot seem copy the service area polygon to a feature class. I am getting a following error message.
Is CopyFeature not the right method to copy the service area polygons?