Vector data
We begin by adding support for vector data. We will be creating three submodules inside our vector
package: data
, loader
, and saver
. To make these accessible from their parent vector package, we need to import it in vector/__init__.py
as follows:
from . import data from . import loader from . import saver
A data interface for vector data
The first thing we want is a data interface that we can conveniently interact with. This data interface will be contained in a module of its own, so create this module now and save it as vector/data.py
.
We start off with a few basic imports, including compatibility functions for Shapely (which we installed in Chapter 1, Preparing to Build Your Own GIS Application) and the spatial indexing abilities of Rtree, a package we will install later. Note that vector data loading and saving, are handled by separate modules that we have not yet created, but since they are accessed through our data interface, we need to import them here:
# import builtins import...