O'Reilly logo

Geospatial Development By Example with Python by Pablo Carreira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Importing geocaching data

In the previous chapter, we generalized our import function by adding the capability to import more types of data supported by OGR.

Now, we will improve it again, make it handle some errors, make it compatible with our objects, and add two new capabilities. We will also convert the data in order to produce uniform objects.

To achieve our goals, we will analyze what kind of information is stored in the files that we want to open. We will use OGR to inspect the files and return some information that may help us with the data conversion.

First, let's alter our open_vector_file function, allowing it to handle incorrect paths and filenames, which is a very a common error. Perform the following steps:

  1. Go to the utils folder and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required