Original article was published by on AI Magazine
Are you a beginner at Python for Geospatial Processing? Do you find the installation process a wee bit cumbersome? Then you have come to the right place! For experts in the field out there, I hope this will save you from some amount of manual work if you are using Windows 10.
Ok! Let’s get started!
Go to this GitHub repo and download the Python_GDAL_(32/64).bat file, please make sure you save it as a batch file (*.bat).
Right-click on the downloaded file and select “Run as administrator”.
The script will download the setup files and run them one by one, make sure you are connected to the internet. If your connection is too slow or the download server is down by any chance, the script will terminate. In that case, you can simply re-run it.
Once the files are downloaded, the Python installation window will automatically pop up, then you will have to select “Customize installation” as shown in the image below.
Follow the instructions and continue the installation until you reach the Advanced Options window. Reduce the installation path as shown below. This is a mandatory step and the only thing that you need to take care of in the entire process.
Click on the install button and wait for the installation to finish. After successful installation, the GDAL installation window will pop up, don’t change anything, and keep clicking next to finish the installation. When asked, select the Typical installation.
Finally, the installation of the GDAL module for Python will begin, keep everything default, install for all users, and check that the installation is being done for the correct Python instance, as shown in the image below.
If this is the first Python 3.7 installation on the system and there are no conflicting installations, the process will be smooth.
On completion, the installation program will automatically close in 30 seconds. Open command prompt from Start menu and type python37 to launch Python, or search in the Start menu for Python 3.7 IDLE and open it. Type import gdal in the console, and ideally, it should not print anything on the screen. If it throws an error, try uninstalling Python and GDAL from the Add or remove programs option in the Start menu or Control Panel and retry the installation using the (*).bat file. Feel free to write a response to this post if you face any other issues.
That’s it for this post. If you want to get started with machine learning methods for geospatial tasks, such as Landsat multispectral classification, you may find the following posts useful.
Share open knowledge!