gdal/org Python Acquisition and installation __python

Source: Internet
Author: User
The GDAL (Geospatial Data Abstraction Library) is an open source raster spatial data reading/conversion repository. There is also a series of command-line tools for data conversion and processing.

The ORG project is a branch of gdal that functions like gdal, but it provides support for vector data. That is, you can use the Org library to read and process vector data such as shapefile (if you want to show shapefile, you need to use other tools).

Here is a description of how the Gdal and Python bindings are installed.
1, Gdal\ogr python version of the acquisition


Binary Package Linux: Fedora: You can search gdal directly in the Software Center for installation; OpenSUSE: You need to add an address to YaST's software source http://download.opensuse.org/ repositories/application:/geo/A version of the software source, note that you must select the corresponding version, directly add the previous address is not OK (I made the mistake). Ubuntu: There's a team that maintains the Gdal for Ubuntu executable package, can add their PPA to the system to download their software, but it feels like they're not going to be able to update the binaries. The PPA address is: Ppa:ubuntugis/ppa.

In other Linux distributions, the Gdal binary package installation may not be as simple as previously said, if you want to know more information, you can refer to http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries. Windows:  

Someone updates the Gdal binary package for Windows maintenance and daily. Includes gdal/ogr full binary package, and Gdal Java, C #, and Python interfaces. Note that the Gdal Python interface should first install the Gdal core and then install the Python extension. The address is: http://www.gisinternals.com/sdk/(English). Tip:
Since everyone has contacted the Gdal, should have a certain level of English, so here is a brief introduction, did not give each step of the detailed steps.   Linux binary package, only Java and Python interface optional, there is no C # interface package (although Linux under the Mono). Mac has not tested ... Source code compilation

Gdal's source code here: Http://trac.osgeo.org/gdal/wiki/DownloadSource Windows

Windows compiler Gdal, you can refer to the Li Ming-lu Teacher's article: http://blog.csdn.net/liminlu0314/article/details/6945452. If you encounter any problems, you can ask him, he is very friendly. If he has no reply, you can also leave a message in this article, I will try to reply.   Linux Linux is simple to compile itself, just install the appropriate tools, and then enter:

% CD gdal%
./configure
%
/% su
Password: ********
# make install
# Exit
A friend who uses Linux should be able to read it. If you want to compile Java or Python extensions. Need to download the corresponding dependencies, such as Ant, Swig and so on.

Tip: Self-compiling is not recommended under Windows, and if you need to support a specific format and language interface, compiling yourself requires installing many software and setting environment variables or modifying makefile. This is a nightmare for a friend who only wants to use and study. For example, if you want to use a Java interface that supports HDF, then you need to download Gdal's source code, swig binaries, Ant, JDK (assuming it already has), and HDF4/5 at compile time. and modify the environment variable or gdal makefile. It is then compiled using the VS compiler or MinGW. This is certainly painful, so it is recommended that you use the binary package described above unless you have to. Under Linux, it's simpler to compile and add dependencies yourself. MinGW compile the problem, as above, the author did not try to complete the compilation, so just try to compile the basic Gdal package with MinGW, this is not difficult, but due to lack of practicality. So it doesn't seem to make sense at the moment. Under Linux, if you are installing Gdal from the Software Center, you need to install a devel package. Windows, when downloading the aforementioned binaries, you need to download the Lib package in the directory if you need to develop C + +. For example, if you want to download the 32-bit GDAL1.9.1 and develop C + +, you will need to download release-1600-gdal-1-9-mapserver-6-0-libs.zip in addition to downloading Gdal-19-1600-core.msi, The latter contains Gdal header files and libraries. 2, Gdal\ogr of the Python version of the installation

Linux, it is easy to install the Gdal binary package and use it.   Here's a second way to install Gdal binary packages under Windows. First of all, I'm here with the 32-bit Win7 and plan to use the C + + compiler in VS2010, so I chose the MSVC2010 (Win32)-stable in the gdal Windows binary package download address, and the reader chooses according to his or her own configuration.

Click the link in the next column of this option, as follows:


At this time, into a machine and compiler configuration under the different software packages download, readers can download according to their own needs. Here I choose the Libs package, the core package, and the Python2.7 extension for the next, as follows:

The core is installed first, where the default installation is used, which means that Gdal will be installed in the C:\Program Files\gdal directory. Sets the new environment variable named Gdal_data, the value is C:\Program files\gdal\gata-data, and adds C:\Program Files\gdal to the path of the environment variable, note that Try to add this directory to the starting position in the PATH environment variable to avoid other problems (important.) )。 Double-click to install the Python Interface Pack. Test use.

In this way, the Gdal Python interface is complete, and the imperfect parts of this article will be improved.


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.