Installation of Gdal and Python on Windows

Source: Internet
Author: User

GDAL is a useful command line tool to process spatial data, if you haven ' t heard of the tool before some It can do is:

    • Create contours from a DEM
    • Create a TMS tile structure
    • Rasterize vector into a raster file
    • Build a quick mosaic from a set of images

Each of the above functions was Python scripts which can be run from the command-line once GDAL is successfully installed.

This tutorial covers what to install GDAL on a Windows PC, if you is interested in getting GDAL running on a Mac please go Here (http://sandbox.idre.ucla.edu/?p=779).

Step 1:install Python

Python is necessary for GDAL, and if you already has a installation of Python then skip to step 4 below.

1. Feel free to download the latest 2.7x version of Python (rather than the 3.x Python version).

The Python version used for this tutorial can is downloaded here:

Https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi

2. Install python with the default options and directories.

3. After installation, go-to-python–> IDLE (python GUI) to find-out-what version of Python is using:

4. Make a note of the number of the shows the version of your Python in the top right, as highlighted below:

Note:MSC v.1500 may differ if is using a different Python installation, if it does then the make a note of the That Nu Mber. Note, if you installed the 64-bit version of Python, for the rest of the tutorial please remove the (x86) from the paths.< /c0>Step 2:install GDAL

1. Head over to Tamas Szekeres ' Windows binaries and download the appropriate GDAL Binary.

For this tutorial, we is using the MSC v.1500 on a 32-bit system, the picture below illustrates how to match the version With your own Python version. The blue highlight is where you should look for either 64-bit or 32-bit systems, and the green shows the release-1500 numb Er which should match the number from IDLE in step 4 above.

2. Clicking the link would take the list of binaries (installers) to download.

3. Locate the "core" installer, which has the very most of the components for GDAL.

4. After downloading your version, the install GDAL with the standard settings.

5. Next, return to the list of GDAL binaries and install the Python bindings for your version of Python, this can either B E 2.7, 3.1, or 3.2.

Recall that we had installed Python 2.7 Earlier, so we had to locate this version, as seen below:

6. Download the Python bindings and install them.

Step 3:adding Path Variables:

We need to tell Windows system where the GDAL installations is located, so we need to add some system variables.

1. Right click on "Computer" on the desktop and go to "Properties":

2. Click on the Advanced System Properties

3. Select environment Variables.

4. Under the System variables pane, find the ' Path ' variable, then click on Edit.

5. Go to the end of the box and copy and paste the following:

; C:Program Files (x86) GDAL

Note:for 64-bit GDAL Installations you would simply remove the (x86) under Program Files.

6. In the same System variables pane, click on "New" and then add the following in the dialogue box:

Variable Name: gdal_data

Variable value: c:program Files (x86) Gdalgdal-data

7. Click "OK"

8. ADD One more new variable by clicking "New ..."

Add the following in the dialogue box:

Variable Name: gdal_driver_path

Variable value: c:program Files (x86) Gdalgdalplugins

Click "OK"

Step 4:testing the GDAL install

1. Open the Windows command line, by going to the Start Menu, Run->type in cmd and press Enter.

2. Type in

Gdalinfo--version

3. Press Enter.

4. If you get the following result, then congratulations your GDAL installation worked smoothly!

Installation of Gdal and Python on Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.