Docstoc

GeoServer and Google Earth

Document Sample
GeoServer and Google Earth Powered By Docstoc
					                                                              MODULE 6: Google Earth




Module 6
Google Earth
  This module introduces GeoServer support for KML and Google Earth. The reader
  will learn how to view GeoServer data in Google Earth, as well as be exposed to
  some of the more advanced features.


In this module you will:

     Install Google Earth.
     Learn how to view GeoServer data in Google Earth.
     Learn how to filter data viewed in Google Earth.
     Learn how to display a legend in Google Earth.
     Learn how to create a time series with Google Earth.




                                                                                 1
                                                                   MODULE 6: Google Earth



   Section 1: Installing Google Earth
1. Navigate to the workshop software directory.

2. Run the Google Earth installer by double-clicking on the file
   GoogleEarthWin.exe.

3. Walk through the installer accepting all the defaults.




                                                                                      2
MODULE 6: Google Earth




                   3
                                                                   MODULE 6: Google Earth


Section 2: Viewing Data in Google Earth
1. Navigate to the Map Preview page.

2. Export the topp:states layer as KML by clicking the KML link.




3. In the dialog choose Open with Google Earth and click OK.




                                                                                      4
MODULE 6: Google Earth




                   5
                                                               MODULE 6: Google Earth


Section 3: Adding Some Data

1. Add the style storm_track_interval.sld located in the
   workshop data directory using skills learned in previous modules.




                                                                                  6
                                                                 MODULE 6: Google Earth

2. Copy the shapefile storm_track_interval.shp located in the
   workshop data directory to:

   C:\Program Files\GeoServer 1.6.5\data_dir\data\shapefiles

3. Add the shapefile to GeoServer using steps from previous modules.
   Set the default style for the shapefile to the style added in step 1.




                                                                                    7
                                                               MODULE 6: Google Earth


Section 4: Adding a Network Link
1. In Google Earth open the Add menu and select Network Link…




2. Set the Name of the network link to “Storm Track” and set the Link
   to the following url:

   http://localhost:8910/geoserver/wms/reflect?layer
   s=topp:storm_track_interval&format=kml
                                                                 This url makes use of
                                                            the wms reflector, which
                                                            is used to make short
                                                            hand WMS requests.




                                                                                  8
               MODULE 6: Google Earth

3. Click OK.




                                  9
                                                                MODULE 6: Google Earth


Section 4: Filtering Data with CQL
1. Right-click on the Storm Track network link and select Properties.




                                                            Common Query Language
                                                        (CQL) is concise way to
                                                        specify predicates or “filters” in
                                                        a request. In this case it is
                                                        being used to filter based on
                                                        the value of particular attribute.




2. Append the following parameter to the Link url:

   &cql_filter=storm_name eq ‘IVAN’




                                                                                     10
               MODULE 6: Google Earth

3. Click OK.




                                 11
                                                                MODULE 6: Google Earth


Section 5: Adding a Legend
1. Right-click on the Storm Track network link and select Properties.

2. Append the following parameter to the Link url:

   &legend=true




                                                                                  12
               MODULE 6: Google Earth

3. Click OK.




                                 13
                                                               MODULE 6: Google Earth


Section 6: Creating a Time Series

1. Navigate to C:\Program Files\GeoServer 1.6.5\data_dir

2. Create a new file named time.ftl under the directory:

   featureTypes\storm_track_interval_storm_strack_interval

                                                               The file time.ftl is a
                                                           time template. It is a
                                                           special file used to specify
                                                           temporal information in a
                                                           dataset.




                                                                                  14
                                                                MODULE 6: Google Earth

3. Open time.ftl in a text editor and add the following content:

${obs_dateti.value?datetime('yy-MM-dd hh:mm:ss')} ||
         ${obs_dateti.value?datetime('yy-MM-dd hh:mm:ss')}




                                                                    A time template (1)
                                                               specifies the attributes
                                                               which contain temporal
                                                               information, and (2)
                                                               converts them to a
                                                               normalized format.

4. Save time.ftl.

5. In Google Earth right click the Storm Track network link and select
   Refresh.




                                                                                   15
                                                                    MODULE 6: Google Earth

6. Click the Play button located to the right of the time slider at the top
   of the screen.




                                                                                      16

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:16
posted:9/1/2011
language:English
pages:16