Using GDAL utilities within ArcGIS python scripting

12700
14
03-09-2012 10:03 PM
MichaelStead
Regular Contributor
I have GDAL installed with the python bindings. Does anyone know how I use this to build some tools in ArcGIS? I didn't check before the GDAL install, but I can import gdal in the python command line window now.
Tags (2)
14 Replies
Luke_Pinner
MVP Regular Contributor

Hi Curtis Price,

Yes and no and sort of. 

I keep a separate Conda env for GDAL stuff and (conda create -n some_new_env -c conda-forge python=3.5 gdal) and keep my ArcGIS Pro env pristine (well pristine so far... )

I had some trouble with the old version of conda that ships with ArcGIS Pro 1.3 as it wouldn't run the GDAL pre and post activation batch files (that set and restore some environment vars). So I upgraded conda, broke ArcGIS Pro completely and had to reinstall... I then ended up installing a separate updated conda to muck around with and leaving ArcGIS Pro completely alone.

curtvprice
MVP Esteemed Contributor

Oh too bad. Sure would be nice to have a function we can use to set those environments (and set them back). This would allow you to directly access gdal tools from within ArcGIS script tools. That's what I really want. We geonet-istas should definitely share such an animal if we come up with it. Steve Lynch‌ could you pass this idea around the smoke (well,maybe chai-steam) -filled room in Redlands? Being able to easily run gdal tools would a great option for certain raster operations that are slower or aren't easily done in arcpy-raster land. This may be just an implementation issue - just show us how to do it - no work on your part beyond that.

DanPatterson_Retired
MVP Emeritus

while people are sniffing around, is there any word on whether python 3.5.x and the matching conda package is going to ship with PRO 1.4? or is that too far off in the distance (aka next years Dev or UC)

0 Kudos
DavidWynne
Esri Contributor

Hi Dan,

Very likely that Pro 1.4 ships with Python 3.5.

-Dave

MattWilkie3
Occasional Contributor II
0 Kudos