Carrying on the work describe in the previous post, attention turned to the loading of the California county boundaries. Part 7 of Lesson 7 of the Geog 585 course notes discussed the ‘installation of data’, but the steps were presented a little out of order, and/or they may have changed a little with the advent of GeoServer 2.0. After a little experimentation, the steps below were determined to be those required to get from a base installation of GeoServer running on an AWS Linux image, to one which is ready to serve the California county information.
The first step was to start a new instance was from ami-2e5fba47. The EBS volume – called data001 – created during the previous session was re-mounted on the new instance. However, some of the benefit of storing the JDK and GeoServer downloads on the persistent EBS volume was lost because GeoServer 2.0 had just gone to stable status since the initial installation. The new version was downloaded and moved up to the EBS volume to replace 1.7.7. Installation of the JDK and GeoServer were installed using precisely the same steps as last time ‘round.
The next thing was to create a data directory external to the GeoServer application directory hierarchy. This was done to ensure upgrades to the GeoServer software can be accomplished without overwriting the data. It was determined the best place for this data directory was also on the EBS volume noted above. A further decision was made to create a directory within it called geoserver – that is, a GeoServer-oriented directory which is version agnostic. The new data_dir was created by copying the native version to data001/geoserver, making the path to the new data directory data001/geoserver/data_dir. Telling GeoServer about the location of the new data directory was surprisingly simple; the variable GEOSERVER_DATA_DIR was set with the path to the new data directory, the variable exported, and then GeoServer was restarted. Finally, the shapefiles which included the California counties, air basins and air districts were unzipped from ARB_basins_districts_counties.zip, and then moved to data001/geoserver/data_dir/data/shapefiles.
The first GeoServer configuration change (all of which were completed using the Web Administration Interface) was to create a new GeoServer Workspace. Workspaces are described as “[a]nalogous to a namespace, a workspace is a container which is used to organize other items.” It may have been possible to use an existing Workspace, but the decision was made create a new one, called intellog, which would be used contain all the layers created as part of this training exercise. What’s less clear is the precise role of the URI supplied when creating the workspace, so Intellog’s home page was used for this purpose, at least for now.
The next step was to create a Store, which was associated with the workspace created above and given the name californiaCounties. The Store connects the logical entity being stored – the county information, in this case – with its physical location on the server.
The final configuration step was to create a Layer, which as the GeoServer documentation says “represents each feature that needs to be shown on the map. All layers have a source of data, called a Store.” When the Layer was created – named arb_california_counties_aligned_03 in this case — there were a dizzying array of options, but these were simply left at their default values for the most part. Virtually all of the options will require some additional research to fully understand.
To test the configuration, Layer Preview was selected, followed by the OpenLayers option. Voilà! The California map comes up, as shown at the top. For good measure, the KML version was also tried out — see the second illustration, above. There are many more details to be worked out, but this was the bare bones Hello World-type exercise to get a shapefile installed and working on a GeoServer instance. As always, takes way longer to describe than to actually do.
Thanks for reading, and feel free to provide comments and/or questions below. Until then…”keep those cards and letters coming in folks!”
Code Shavings There are three commands you are required to enter when utilizing an EBS volume. You do not want to issue the first one if the EBS volume contains something you want to retain! (Please don’t ask me how I figured that out.) ♦ The most visible difference between the 1.7.X and 2.0 is the administration interface. It’s quite a bit cleaner and more functional. Apparently, it’s based on the Wicket framework, which seems to make the latter worthy of some investigation.