Geography Reference
In-Depth Information
Chapter 3 Loading Data into your
Database
The first thing we need to do before we can begin to explore what a GIS can do is load some
data in.
In this chapter, I'm going to load three ESRI shapefiles into Postgres to use with the demos
later on. The first two of these will be point-based files showing the location of cities and
towns in the U.K. The third file will be a polygon file showing the outlines of all the county
and borough boundaries that make up the U.K.
For those of you who are not familiar with U.K. geography, the county boundaries logically
divide the country into administrative regions, similar to the U.S. states or Chinese
provinces.
Creating a Spatial Database
Before we can start to add any data into our system, we first need to create a database for
storing the data. For the samples in this topic, I'm going to create a simple three-table
database rather than an entire GIS model as described earlier.
If you are working on a large enterprise application, I can't stress enough how important
planning and design is in GIS database solutions. In many ways the planning part of this is
substantially more important than the same steps in a normal database. Failures and
alterations further down the line tend to be more pricey and more complex to fix for GIS
solutions than for an average enterprise data solution.
To create the database, we'll be using the database admin tool provided with Postgres,
pgAdmin. To start pgAdmin, click on the pgAdmin III icon on your desktop. If you don't see
the icon, make sure that you installed the management tools when you installed the server.
Once you've installed the app and created an initial connection to your database server, you
can start to create a database in that server connection as shown in the figures that follow.
Please note that for security reasons, I've removed server and table names from many of the
figures showing pgAdmin in this topic, leaving only those that are necessary for your
understanding. In your use of pgAdmin, you'll see a lot more information when going through
the steps I present here.
 
 
Search WWH ::




Custom Search