transformation.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. .. _css_transform:
  2. Rendering transformations in CSS
  3. ================================
  4. .. highlight:: scss
  5. Starting with GeoServer 2.10 the CSS modules supports rendering transformations via the
  6. ``transform`` property.
  7. The property is a function call with a special key/value pair syntax, using the following template::
  8. transformationName(key1:value1,key2:v21 v22 ... v2M,...,keyN:vN)
  9. The values can be simple ones, or can be a space separated list. The parameter representing the
  10. input layer can be omitted, the engine will automatically recognize input parameters of type feature collection
  11. or grid coverage.
  12. The transformation function is subject to cascading like all other properties, but cascading acts
  13. at the whole z-level, so if multiple transformations are needed, they need to be associated with
  14. two different z-levels.
  15. This is an example of a CSS style extracting contour lines from a DEM, and also showing the single values
  16. when a suitable zoom level is reached::
  17. /* @title Levels */
  18. * {
  19. transform: ras:Contour(levels: 1100 1200 1300 1400 1500 1600 1700);
  20. z-index: 0;
  21. stroke: gray;
  22. label: [numberFormat('#', value)];
  23. font-size: 12;
  24. font-fill: black;
  25. font-weight: bold;
  26. halo-color: white;
  27. halo-radius: 2;
  28. label-follow-line: true;
  29. label-repeat: 200;
  30. label-max-angle-delta: 45;
  31. label-priority: 2000;
  32. }
  33. /* @title Values */
  34. [@sd < 12000] {
  35. transform: ras:RasterAsPointCollection(scale: 0.5);
  36. z-index: 1;
  37. label: [GRAY_INDEX];
  38. label-anchor: 0.5 0.5;
  39. font-family: Arial;
  40. font-fill: black;
  41. font-size: 6;
  42. label-priority: 1000;
  43. }
  44. .. figure:: images/transformation.png
  45. :align: center
  46. *The two transformations in action against a DEM layer*