Book Image

Geospatial Development By Example with Python

By : Pablo Carreira
5 (1)
Book Image

Geospatial Development By Example with Python

5 (1)
By: Pablo Carreira

Overview of this book

From Python programming good practices to the advanced use of analysis packages, this book teaches you how to write applications that will perform complex geoprocessing tasks that can be replicated and reused. Much more than simple scripts, you will write functions to import data, create Python classes that represent your features, and learn how to combine and filter them. With pluggable mechanisms, you will learn how to visualize data and the results of analysis in beautiful maps that can be batch-generated and embedded into documents or web pages. Finally, you will learn how to consume and process an enormous amount of data very efficiently by using advanced tools and modern computers’ parallel processing capabilities.
Table of Contents (17 chapters)
Geospatial Development By Example with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing packages and required software


In this topic, we will go through the installation process of every package used in the book.

OpenCV

OpenCV is an optimized C/C++ library intended for video and image processing with hundreds of functions ranging from simple image resizing to object recognition, face detection, and so on. OpenCV is a big library, and we will use its capabilities of reading, transforming, and writing images. It's a good choice because its development is active, and it has a large user community and very good documentation.

Windows

Here is the installation procedure for Windows:

  1. Go to http://www.lfd.uci.edu/~gohlke/pythonlibs/.

  2. Press Ctrl + F to open the search dialog of your browser and then search for OpenCV.

  3. You will find a list of files; choose opencv_python‑2.4.11‑cp27‑none‑win32.whl or any OpenCV version that contains cp27 and win32. This means that this is the 32-bit version for Python 2.7.

  4. Save the downloaded file to a known location.

  5. Open Windows Command Prompt and run the following command:

    c:\Python27\scripts\pip install path_to_the_file_you_downloaded.whl
    
  6. You should see an output telling you that the installation was successful, as follows:

    Processing c:\downloads\opencv_python-2.4.12-cp27-none-win32.whl
    Installing collected packages: opencv-python
    Successfully installed opencv-python-2.4.12
    

    Tip

    You can drag and drop a file into the command prompt to enter its full path.

Ubuntu Linux

Here is the installation process for Ubuntu Linux:

  1. Open a new terminal with Ctrl + T.

  2. Then, enter the following command:

    sudo apt-get install python-opencv