Defining the data models
We already know which database objects we are going to need to store the uploaded shapefiles:
The
Shapefile
object will represent a single uploaded shapefileEach shapefile will have a number of
Attribute
objects, giving the name, data type, and other information about each attribute within the shapefileEach shapefile will have a number of
Feature
objects which hold the geometry for each of the shapefile's featuresEach feature will have a set of
AttributeValue
objects which hold the value for each of the feature's attributes
Let's look at each of these in more detail and think about exactly what information will need to be stored in each object.
The Shapefile object
When we import a shapefile, there are a few things we need to remember:
The original name of the uploaded file. We will display this in the "list shapefiles" view so that the user can identify the shapefile within this list.
The spatial reference system used by the shapefile. When we import the shapefile, we...