Search code examples
pythond3.jsgisgdal

Running GDAL from the command line on Windows 10 x64


I need help getting gdal set up on my 64-bit Windows 10 machine. I am able to run gdalinfo, but nothing that depends on the python libraries (like gdal_polygonize for example).

Expected results

I want to be able to successfully run something like gdal_polygonize myFile.png -f "GeoJSON" myOutputFile.geojson

What I've tried

I used this installer: gdal-300-1900-x64-core.msi

With these python libraries: GDAL-3.0.4.win-amd64-py3.7.msi (I am using python 3.7)

I added C:\Program Files\GDAL to the end of my PATH, and added the following environment variables:

enter image description here

For some reason, I can't run anything but gdalinfo. Any ideas on where to look or what I might have done wrong? This is the output in git bash, and it is the same in cmd. enter image description here


Solution

  • You need to install the python bindings for GDAL.

    The easiest way is to use the Osgeo4w installer and make sure to check the gdal-python box in the installer.

    You need to use the advanced install option and expand the libs item to find gdal-python.

    enter image description here

    You then pick the same version number as the version of GDAL you are installing.