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

Summary


In this chapter, the challenge was to find a way to combine data from multiple sources. The solution for this is to make code that can take different types of data and transform it into a common type of object.

In order to achieve this, we first created two new Python classes. The first was the Geocache class, which represents a single geocache location and contains its coordinates, a name, and a description. The second was the PointCollection class, which represents a collection of Geocache objects. This class has the ability to import and convert the information from as many files as needed.

This technique that we used is called abstraction; its foundations reside in hiding complex procedures behind objects that can be easily understood by humans.

Finally, we integrated this new layer of abstraction into the application using class inheritance. The GeocachingApp class inherited the PointCollection, and in the end, it could behave similarly to any and both of them at the same time...