O'Reilly logo

Python Geospatial Development - Second Edition by Erik Westra

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 shapefiles

The process of importing a shapefile involves the following steps:

  1. Displaying a form prompting the user to upload the shapefile's ZIP archive.
  2. Decompressing the ZIP file to extract the uploaded shapefile.
  3. Opening the shapefile and reading the data out of it into the database.
  4. Deleting the temporary files that we have created.

Because of the complexity of this process, we'll use a separate application called shapefileIO to handle the behind-the-scenes logic of importing (and later, exporting) the shapefile's contents. This allows us to implement the user interface for importing shapefiles, without having to worry about these behind-the-scenes details.

Let's start by creating the basic framework for the shapefileIO application. Using ...

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