Can I use the map object's addDataFromPath method to add data from a grib file?

445
1
12-30-2019 11:09 AM
JeffHancock
New Contributor

I have tried, but get a RuntimeError.   Specifically, I am trying this in the python window of ArcGIS pro:

current_project = arcpy.mp.ArcGISProject('CURRENT')

map = current_project.listMaps()[0]

map.addDataFromPath(r'c:\Users\jhancock\Documents\datagrib\epochCal\20191105\EPOCH.2019-11-05T12_00_00.PT03_00.grb2') 

It gives me a RuntimeError.  But if I use that same path in the GUI (Map -> Add Data -> Data From Path), it works fine.

Is the python method addDataFromPath not the same thing?  Should it work?  I've been semi-successful at adding a grib file to a map from the python window using arcpy.MakeRasterLayer_management, but that way seems to lose the time information, which I get if I just drag and drop the file into ArcGIS.

1 Reply
MattHowe
Occasional Contributor

Hi Jeff. I'm experiencing the same thing but when trying to add a feature class in the 'memory' workspace. Still no joy.

0 Kudos