Contributor(s): Ron Bentley
When you want to add a GIS data set to the THL Interactive GIS Map, the first thing to do is the following set of steps.
This is (roughly) the process Ron Bentley used to import the Bellezza archaeological sites in Dec., 2009; it is taken from Ron's comment to JIRA THLTOOLS-857.
shp2pgsql -s 4326 bellezza.shp bellezza > bellezza.sql
psql -h sds2.itc.virginia.edu -U postgres -f bellezza.sql -d thdl_places_production
psql -h sds2.itc.virginia.edu -U postgres -d thdl_places_production
-c "GRANT ALL ON bellezza TO rubyuser"
At this point there is a table in PostGIS on SDS2 with one field for each column in the SHP file database. The geometry column is called "the_geom" by default.
Also see additional information from the specific case of importing SHP files for Dbus monasteries
There are other options for importing the SHP file that might be easier for the GUI-centric. A reasonably recent installation of Quantum GIS comes with the SPIT plugin, the Shapefile to PostGIS Import Tool, which can accomplish the same thing.
This process has to be repeated for each instance of GeoServer. Alternatively, you could copy catalog.xml, featureTypes/ and styles/ from the geoserver/data directory on SDS7 to another server and reload GeoServer from the Tomcat manager.
This is the most time consuming part of the process, especially if we're trying to re-create the look of an existing map. GeoServer uses Styled Layer Descriptors or SLDs to govern how data looks when it's presented. The Open Geospatial Consortium promulgates the standards, which include the current SLD specification and the
description of filter encoding that is an essential component for what we do. However, the Geoserver documentation has a
far gentler introduction to styling that includes some useful recipes.
I personally tend to take an existing SLD and edit it by hand to match the current data. (The SLD is an XML document.) However, uDig is one tool that can help. It's open-source, administered by the same company that administers PostGIS, and it works very much like ArcGIS or Quantum GIS. The benefit of uDig is that it saves its layer descriptions as SLDs; it can be a fast way to mock up an SLD. It can also connect directly to a PostGIS database. (The down-side is it runs on Java and can be slow and cumbersome.)
Assuming one has prepared an SLD for the new feature type, post it on GeoServer this way:
Again, these changes have to be applied to all instances of GeoServer.