I am sorry of this might sound like a noob question but I cannot find any answer from google.
I used arcpy to do batch processing of Network Analyst - Make Service Area layer of thousand of stores.
Everything went well except now, I am stuck with layer (.lyr) files and I would like to conduct further analysis on the datasets that they contain.
Basically I would have
"SA_Store_001.lyr" (and so on..)
And when I open this inside ArcMap, it has the usual elements of the Service Area Analysis.
including
"Facilities"
"Route Barriers"
"Polygons"
etc.
Suppose, I would like to SelectAttributes by polygons, can you give me a skeleton code for this? The help files on ArcGIS on has SelectLayerByAttribute -- what I want is the Polygons.
Thank you.
Thanks for the answer.
However, this didn't work:
Even the first line doesn't work (because I don't know how to deal with the .lyr file type)
#
inputLayer = 'D:\ARCGIS\FoodSystemsAnalysis\Coverage\Auckland\SMC_SM_Ta9.lyr'
arcpy.MakeFeatureLayer_management(inputLayer, "SMC_Ta9")
#
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000840: The value is not a Feature Layer. Failed to execute (MakeFeatureLayer).
#
I think the MakeFeatureLayer_management takes features as input. I really don't know. Please help.
MakeFeatureLayermethod (with a where clause if necessary). – Roy Jul 2 '12 at 11:29MakeFeatureLayer_managementimports shapefiles to layers. If you already have a layer file, usearcpy.mapping.Layer("path_to_layer_file")to create the layer object. – bananafish Jul 25 '12 at 3:00