index.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. .. _cov_json:
  2. CoverageJSON output format
  3. ==========================
  4. `CoverageJSON <https://covjson.org/>`_ is a format for encoding geotemporal coverage data like grids and time series. For example, it can be as output format for a WCS2.0 getCoverage requesting a TimeSeries on a specific coordinate. As per the specification, the format to be specified to get back a cov-json output is *application/prs.coverage+json*.
  5. Installation
  6. ------------
  7. As a community module, the cov-json package needs to be downloaded from the `nightly builds <https://build.geoserver.org/geoserver/>`_,
  8. picking the community folder of the corresponding GeoServer series (e.g. if working on the GeoServer main development branch nightly
  9. builds, pick the zip file form ``main/community-latest``).
  10. To install the module, unpack the zip file contents into GeoServer own ``WEB-INF/lib`` directory and restart GeoServer.
  11. Example: WCS 2.0 - TimeSeries
  12. -----------------------------
  13. Let *test:timeseries* be a sample layer related to a coverage with time dimensions enabled. Suppose we want to get the coverage values for a specific time period on a specific lat/lon coordinate. That will be a slicing on lat/lon coordinate and trimming on time dimension.
  14. A getCoverage request can be posted with a similar content to http://server:port/geoserver/wcs:
  15. .. code-block:: xml
  16. <wcs:GetCoverage service="WCS" version="2.0.1"
  17. xmlns:wcs="http://www.opengis.net/wcs/2.0"
  18. xmlns:gml="http://www.opengis.net/gml/3.2"
  19. xmlns:crs="http://www.opengis.net/spec/WCS_service-extension_crs/1.0"
  20. xmlns:rsub="http://www.opengis.net/spec/wcs_service-extension_range-subsetting/1.0"
  21. xmlns:scal="http://www.opengis.net/spec/WCS_service-extension_scaling/1.0/"
  22. xmlns:wcsgeotiff="http://www.opengis.net/wcs/geotiff/1.0"
  23. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  24. xsi:schemaLocation="http://www.opengis.net/wcs/2.0 http://schemas.opengis.net/wcs/2.0/wcsAll.xsd">
  25. <wcs:CoverageId>test__timeseries</wcs:CoverageId>
  26. <wcs:format>application/prs.coverage+json</wcs:format>
  27. <wcs:DimensionSlice>
  28. <wcs:Dimension>Long</wcs:Dimension>
  29. <wcs:SlicePoint>56</wcs:SlicePoint>
  30. </wcs:DimensionSlice>
  31. <wcs:DimensionSlice>
  32. <wcs:Dimension>Lat</wcs:Dimension>
  33. <wcs:SlicePoint>0</wcs:SlicePoint>
  34. </wcs:DimensionSlice>
  35. <wcs:DimensionTrim>
  36. <wcs:Dimension>Time</wcs:Dimension>
  37. <wcs:TrimLow>2014-01-01T00:00:00.000Z</wcs:TrimLow>
  38. <wcs:TrimHigh>2017-01-01T00:00:00.000Z</wcs:TrimHigh>
  39. </wcs:DimensionTrim>
  40. </wcs:GetCoverage>
  41. The outcome will be something like this:
  42. .. code-block:: json
  43. {
  44. "type": "Coverage",
  45. "domain": {
  46. "type": "Domain",
  47. "domainType": "PointSeries",
  48. "axes": {
  49. "x": {
  50. "values": [
  51. 56.0
  52. ]
  53. },
  54. "y": {
  55. "values": [
  56. 1.0112359550561785
  57. ]
  58. },
  59. "t": {
  60. "values": [
  61. "2014-01-01T00:00:00Z",
  62. "2015-01-01T00:00:00Z",
  63. "2016-01-01T00:00:00Z",
  64. "2017-01-01T00:00:00Z"
  65. ]
  66. }
  67. },
  68. "referencing": [
  69. {
  70. "coordinates": [
  71. "x",
  72. "y"
  73. ],
  74. "system": {
  75. "type": "GeographicCRS",
  76. "id": "http://www.opengis.net/def/crs/EPSG/0/4326"
  77. }
  78. },
  79. {
  80. "coordinates": [
  81. "t"
  82. ],
  83. "system": {
  84. "type": "TemporalRS",
  85. "calendar": "Gregorian"
  86. }
  87. }
  88. ]
  89. },
  90. "parameters": {
  91. "TIMESERIES": {
  92. "type": "Parameter",
  93. "description": {
  94. "en": "timeseries"
  95. },
  96. "observedProperty": {
  97. "label": {
  98. "en": "timeseries"
  99. }
  100. }
  101. }
  102. },
  103. "ranges": {
  104. "TIMESERIES": {
  105. "type": "NdArray",
  106. "dataType": "float",
  107. "axisNames": [
  108. "t",
  109. "y",
  110. "x"
  111. ],
  112. "shape": [
  113. 4,
  114. 1,
  115. 1
  116. ],
  117. "values": [
  118. 25.5,
  119. 24.76,
  120. 26.06,
  121. 23.22
  122. ]
  123. }
  124. }
  125. }
  126. Note the domainType = PointSeries where x,y axes have a single and the t axis has 4 times in the values. Also note the ranges property is reporting 4 values.