Using arcpy to create a layer from business analyst dataset

المشرف العام

Administrator
طاقم الإدارة
I'm trying to automate several of our processes using Python in ArcGIS for Desktop 10.3. At least one of these tasks involves running a query against block group data provided by Business Analyst (BA). My problem is that I can't figure out how to bring the BA data in to do the query. My assumption is that I need to create a layer from the .bds file. Currently, my code looks like:

bg_file = r'C:\ArcGIS\Business Analyst\US_2014\Data\Demographic Data\esri_bg.bds' bg_layer = 'bg_layer' arcpy.MakeFeatureLayer_management(bg_file, bg_layer) When I run this in a script (i.e., outside of ArcMap), I get:

arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset C:\ArcGIS\Business Analyst\US_2014\Data\Demographic Data\esri_bg.bds does not exist or is not supported Failed to execute (MakeFeatureLayer). Meanwhile, inside the python window of ArcMap, if I run:

arcpy.MakeFeatureLayer_management(r'C:\ArcGIS\Business Analyst\US_2014\Data\Demographic Data\esri_bg.bds', 'bg_layer') I get:

Runtime error Traceback (most recent call last): File "", line 1, in File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\management.py", line 6520, in MakeFeatureLayer raise e ExecuteError: ERROR 000229: Cannot open C:\ArcGIS\Business Analyst\US_2014\Data\Demographic Data\esri_bg.bds Failed to execute (MakeFeatureLayer). which is a similar error, but seems slightly different.

Clearly, there's something I don't understand here. I'm able to use the MakeFeatureLayer_management function to create layers from other (non-bds) files. Is there something special about .bds files that prevents me from doing this? If so, what's the preferred method of creating layers from .bds files in arcpy?



أكثر...
 
أعلى