kmlheighttime.rst 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. .. _ge_feature_kml_height_time:
  2. KML Height and Time
  3. ===================
  4. Height
  5. ------
  6. GeoServer by default creates two dimensional overlays in Google Earth. However, GeoServer can output features with
  7. height information (also called "KML extrudes") if desired. This can have the effect of having features "float" above
  8. the ground, or create bar graph style structures in the shape of the features. The height of features can be linked to
  9. an attribute of the data.
  10. Setting the height of features is determined by using a KML Freemarker template. Create a file called ``height.ftl``,
  11. and save it in the same directory as the featuretype in your :ref:`datadir`. For example, to create a height
  12. template for the ``states`` layer, the file should be saved in
  13. ``<data_dir>/workspaces/topp/states_shapefile/states/height.ftl``.
  14. To set the height based on an attribute, the syntax is::
  15. ${ATTRIBUTE.value}
  16. Replace the word ``ATTRIBUTE`` with the name of the height attribute in your data set. For a complete tutorial on
  17. working with the height templates see :ref:`tutorials_heights`.
  18. Time
  19. ----
  20. Google Earth also contains a "time slider", which can allow animations of data, and show changes over time. As with
  21. height, time can be linked to an attribute of the data, as long as the data set has a date/time attribute. Linking this
  22. date/time attribute to the time slider in Google Earth is accomplished by creating a Freemarker template. Create a file
  23. called ``time.ftl``, and save it in the same directory that contains your data's ``info.xml``.
  24. To set the time based on an attribute the syntax is::
  25. ${DATETIME_ATTRIBUTE.value}
  26. Replace the word ``DATETIME_ATTRIBUTE`` with the name of the date/time attribute. When creating KML, GeoServer will
  27. automatically link the data to the time element in Google Earth. If set successfully, the time slider will
  28. automatically appear.
  29. For a full tutorial on using GeoServer with Google Earth's time slider see :ref:`tutorials_time`