CNM Website UNM Website My Current Classes E&PS Website Cooking Stuff Environmental Stuff News Sites Reference Materials To reduce spam, please type this email address into your email program

GEOG585: Internet Mapping: Lab 11

The data directory for the GeoServer instance on the class server is:
/usr/local/geoserver/data_dir/data
A directory for all of your class work on GeoServer has been created in this directory.
The class directory is:
/usr/local/geoserver/data_dir/data/class
When adding data to the class GeoServer instance you will only be able to add content
to this directory, as your permissions outside of this directory will not permit you to add
folders or files outside this directory (except in your home directory).

Question 1

1. Create a directory for your lab and assignment work in the class directory defined above.
The Linux 'mkdir' command may be used to create the directory from the command prompt.
You may also use WinSCP to create the directory from your Windows workstation.
(remember some other useful Linux commands: 'cd' to change to a directory, 'ls' to list the
contents of a directory, 'cp' to copy files from one location to another, 'rm' to remove a file
from a directory). Choose a directory name that will be unique to you (i.e. include your
username in the directory). Since everyone in the class will be using the class directory,
using something like 'geog485' WILL NOT work.
1.1.What is the name of the directory that you chose? stephenb
Use the 'ls' command on the class directory, and include the output of the command in your write-up.

Question 2

2. Move the 'Lab08data' directory that you created in your home directory and copied data into
for the last lab into your newly created directory in the class directory. You can use the Linux
'mv' command to do this in a single command, for example (if you are IN your newly
directory, AND you named the data directory for the last lab 'lab10data', AND you created
the 'Lab08data' directory in the highest level of your home directory):
>mv ~/Lab08data .
2.1.After moving your data to your directory, print the directory listing for your newly created
directory and its contents.
As you may have noticed during the last lab assignment, the default filenames provided
by the USGS as part of their packaging of the delivered data are inconvenient at best,
and don't work with some commands at worst. You can mitigate this problem by using
one of two commands. You can rename the files, by using the ?mv' command to "move"
the original file with the old name to a "new" file with a better name. You can also use
the ?ln' command to create a symbolic link (a fancy name for a pointer to the original file
with a different name) that has a better name while leaving the original file in place. For
example (given that you are IN the directory containing the file you want to rename or
link to):
> mv 36033381\\36033381.tif 36033381.tif
or
> ln -s 36033381\\36033381.tif 36033381.tif
Either of these commands would produce a file or file pointer named 36033381.tif that
you can use in GeoServer as a source data file. Here are some format-specific points to
keep in mind when renaming geospatial data:
• When renaming a shapefile, make sure to rename all of the files in the set so that they
all have the same file prefix
• When renaming a GeoTiff
• If the projection information is available from gdalinfo, you can just change the
name of the file ending in .tif
• If there is a .tfw file associated with the file, it is a good idea to change its name as
well
• If there is a .aux file (as would be generated by gdaladdo as you did in the last lab),
you should rename it as well.

Question 3

3. Rename (and in the process add your username as a prefix to each filename) or create
symbolic links for the following data (as represented by the directories that you copied over
to your directory within the class directory) in preparation for adding them to the GeoServer:
example:
kbene@geoserver:~$ cd /usr/local/geoserver/data_dir/data/class/kbene/lab10data
kbene@geoserver:/usr/local/geoserver/data_dir/data/class/kbene/lab10data/36033381$
ln -s 36033381\\36033381.aux kbene_36033381.aux
kbene@geoserver:/usr/local/geoserver/data_dir/data/class/kbene/lab10data/36033381$
ln -s 36033381\\36033381.prj kbene_36033381.prj
kbene@geoserver:/usr/local/geoserver/data_dir/data/class/kbene/lab10data/36033381$
ln -s 36033381\\36033381.tfw kbene_36033381.tfw
kbene@geoserver:/usr/local/geoserver/data_dir/data/class/kbene/lab10data/36033381$
ln -s 36033381\\36033381.tif kbene_36033381.tif
kbene@geoserver:/usr/local/geoserver/data_dir/data/class/kbene/lab10data/36033381$
ln -s 36033381\\meta1.html kbene_meta1.html
kbene@geoserver:/usr/local/geoserver/data_dir/data/class/kbene/lab10data/36033381$
ln -s 36033381\\Metadata.xml kbene_Metadata.xml
kbene@geoserver:/usr/local/geoserver/data_dir/data/class/kbene/lab10data/36033381$
ls
36033381\36033381.aux 36033381\36033381.tfw 36033381\meta1.html
kbene_36033381.aux kbene_36033381.tfw kbene_meta1.html
36033381\36033381.prj 36033381\36033381.tif 36033381\Metadata.xml
kbene_36033381.prj kbene_36033381.tif kbene_Metadata.xml
• 36033381
• 50647444
• 50717270
• 56892286
• 84943361
• 89210636
• 95906696
• 97127531

Done. Having more experience with regular expressions and awk would be handy.

Question 4

4. Log into the Geoserver on the class server (http://129.24.63.138/geoserver/web/) using the
administrative username and password provided for the class server.
4.1.Create a 'workspace' for yourself, again using a name that will be unique to you (your
username would be a good candidate for this).
4.2.Create a new 'store' for each of the 8 datasets listed in 3 above. Assign the new store to
your workspace that you created in 4.1 above. When specifying the the "Connection
Parameters" for pointing to the file, the format is:
file:data/class/<your directory>/lab10data/<directory>/<filename>
for example
file:data/class/kbene/lab10data/36033381/36033381.tif
4.3.Create a new "layer" for each of the 'store's added in 4.2. Here are some things to keep
in mind:
• You may need to designate the SRS for a layer if it can't be read directly from the
dataset. Your specify the 'designated' SRS using the standard EPSG:XXXX format.
• The EPSG code for "GCS_North_American_1983" is EPSG:4269
4.4.Preview each of your added layers, using the "Layer Preview" tool and the "Open
Layers" option to display the data. Include screen grabs of the previews in your write-up.