Introduction to the OpenGeo Suite
Loading data into PostGIS¶
This section focuses on the basic task of loading shapefiles into our database using the graphical PostGIS shapefile loading tool, pgShapeloader. PostGIS is supported by a wide variety of libraries and applications, and provides many other options for loading data in a variety of formats.
From the Start Menu, click the pgShapeloader link found in OpenGeo Suite ‣ pgShapeloader.
Click View connection details and enter the following:
When finished, click OK to test the connection.
Next, click Add File and navigate to the data directory in the workshop package. Select the following files:
Next, click to edit each entry’s SRID column, and change every entry to 4326 (from 0).
Finally, click the Import button to launch the import process.
When all of the files are loaded, go back to pgAdmin and click the Refresh button to update the tree view. You should see your three new tables show up in the Tables section of the tree.
Bonus: Visualizing PostGIS data¶
Geometries in PostGIS look a little something like this...
SELECT geom FROM countries ORDER BY geom DESC;
This binary code isn’t readable by humans! So we need help in order to allow us to visualize our PostGIS data. Unfortunately, there is no utility inside PostGIS or pgAdmin themselves to display data. Fortunately, though, there are many other applications that can connect to a PostGIS database, and display and edit data in a more appealing manner.
Installing a fresh GIS client on your workstations is a bit beyond the scope of this workshop, but if you do have something handy you can load this data. We recommend QGIS for desktop-based data viewing.
If you have a client capable of connecting to PostGIS, go ahead and give it a quick try. Recall the connection parameters from earlier:
|Server Host||localhost 5432|
Boundless provides commercial open source software for internet mapping and geospatial application development. We are dedicated to the growth and support of open source software.
This work is licensed under a Creative Non Commercial-Commons Attribution-Share Alike 3.0 United States License. Feel free to use this material, but we ask that you please retain the Boundless branding, logos and style.