$webwork.htmlEncode($page.space.name) : 3 Google Earth customizations
This page last changed on Sep 24, 2007 by jdeolive.
LESSON 3: Google EarthObjective: Section 1: Viewing Data in Google Earth 0) Set Google Earth to OpenGL ModeBefore you begin, you must configure Google Earth to work in OpenGL mode. In Google Earth:
1) Viewing Data in Google EarthThe easiest way to view a layer in Google Earth is via the GeoServer web interface.
Google Earth will now open and render the KML produced by GeoServer. At this point you should see the following: 2) Filtering Data with CQLGeoServer has a powerful capability to limit the data returned based on a query passed in by the user. In this section you will learn how to use the CQL_FILTER paramter of a kml request to limit the amount of data that is returned, and to doe some interesting queries. "CQL" stands for "Common Query Language", and is a useful syntax for specifying queries against a dataset. More information about CQL is available here.
Next you will create a kml request which specifies an cql filter.
3) Custom Placemarks with TemplatesAn extremely powerful GeoServer feature is the ability to customize KML placemark (popup) descriptions. This is achieved with a template. A template is a simple text file which contains a combination of HTML markup, and attribute references. In this section you will learn how to use templates to create placemark descriptions custom to your dataset.
This is the default placemark description that GeoServer produces. Next you will create the template to customize it to this dataset.
In a template, the value of attributes from the dataset are available using a special "variable syntax". For instance, if we want to access the STATE_NAME attribute, we use the expression: {${STATE_NAME.value}}
At this point, your description.ftl template should have the following content: <img src="http://www.netstate.com/states/symb/flags/images/${STATE_ABBR.value?lower_case}_fi.gif" height="100" width="175"/> <br> <br> This is the state of ${STATE_NAME.value} which has a population of ${PERSONS.value}. <br> <br> Check out more information on <a href="http://en.wikipedia.org/wiki/${STATE_NAME.value?replace(" ", "_")}">Wikipedia</a>.
4) Time with TemplatesAnother interesting application of templates in GeoServer is with time. KML placemarks may have an optional "timestamp" attribute. When included in KML Google Earth will render the placemark only when it falls into the range of a specified time period. In this section you will learn how to use a template to specify a temporal attribute of a dataset. First you will set up a dataset which contains temporal information. Using the steps from lesson one:
Next you will add the layer to Google Earth using steps from previous sections.
Next you will create the template which is used to specify the temporal attribute of the dataset. The attribute in question is called RPT_YEAR and is the 4 digit year.
5) Extra CreditDone Early? Here are some additional activities you can try out. Super OverlaysGeoServer supports "Region Based KML", or "Super Overlays", more information here. Specifying a super overlay can be done by appending &superoverlay=true to a KML request. Try it out with some GeoServer layers and see what happens as you zoom in. ScoringKML "Scoring" is a feature which can be used to control how GeoServer returns KML. GeoServer can return KML in vector form or raster form. Returning large volumes of data in vector (placemark) form puts a heavy rendering load on Google Earth and can degrade performance quite drastically. In cases such as these it is useful to have GeoServer turn KML in raster (overlay) form. Read through the information here and play with different values of the KMSCORE parameter and note the results. Advanced PlacemarksContinue with skills learned in Section 3 and play around creating some of your own placemark descriptions. For some inspiration check out some of the examples here.
kmlLink.png (image/png)
kmlLink.png (image/png) open.png (image/png) ge.png (image/png) tx.png (image/png) delege.png (image/png) cql2.png (image/png) cql1.png (image/png) template2.png (image/png) template1.png (image/png) uploadStyle.png (image/png) setStyle.png (image/png) addStyle.png (image/png) newStyle.png (image/png) addShapefile.png (image/png) newShapefile.png (image/png) time4.png (image/png) time3.png (image/png) time2.png (image/png) time1.png (image/png) |
Document generated by Confluence on Jan 16, 2008 23:27 |