Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Geospatial Development By Example with Python

You're reading from   Geospatial Development By Example with Python Build your first interactive map and build location-aware applications using cutting-edge examples in Python

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781785282355
Length 340 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Pablo Carreira Pablo Carreira
Author Profile Icon Pablo Carreira
Pablo Carreira
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Preparing the Work Environment 2. The Geocaching App FREE CHAPTER 3. Combining Multiple Data Sources 4. Improving the App Search Capabilities 5. Making Maps 6. Working with Remote Sensing Images 7. Extract Information from Raster Data 8. Data Miner App 9. Processing Big Images 10. Parallel Processing Index

Opening the file and getting its contents

Now, we will open the downloaded file and prepare it for processing. This is something that we already did in Chapter 1, Preparing the Work Environment, so we will copy our function and improve it so that we can reuse it in this application and the ones to come. Here are the steps that we will perform:

  1. Create a new file named geo_functions.py inside the utils directory.
  2. Open the world_areas.py file from Chapter 1, Preparing the Work Environment, and copy the open_shapefile function. Then, paste it into the created file.
  3. Now, change the name of the function to open_vector_file so that it makes more sense as we will use this function to open many kinds of file. The geocaching file isn't a shapefile—it's a GPX, and to open it, we don't need to change anything. OGR will handle this for us.
  4. Now, to keep the code well documented, change the docstring to reflect the function's capabilities. Change it to something similar to &quot...
You have been reading a chapter from
Geospatial Development By Example with Python
Published in: Jan 2016
Publisher:
ISBN-13: 9781785282355
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image