Skip to content

Commit

Permalink
14-encodings: Progress on encodings
Browse files Browse the repository at this point in the history
- CoverageJSON, PNG, GeoTIFF and COG
- Initial stand-in files for other encodings
- Fixed mediatype for CoverageJSON
  • Loading branch information
jerstlouis committed Jul 3, 2024
1 parent 7f10cb8 commit 7b0a35c
Show file tree
Hide file tree
Showing 16 changed files with 210 additions and 18 deletions.
32 changes: 21 additions & 11 deletions standard/clause_14_encodings.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ These requirements classes include:

* <<rc_encoding-html,HTML>>
* <<rc_encoding-geotiff,GeoTIFF>>
* <<rc_encoding-cog,COG>>
* <<rc_encoding-netcdf,netCDF>>
* <<rc_encoding-cisjson,CIS JSON>>
* <<rc_encoding-coveragejson,CoverageJSON>>
Expand Down Expand Up @@ -35,10 +36,10 @@ A table of the media types corresponding to each encoding requirements class def
|====
^|*Encoding* ^|*media type*
|HTML |text/html
|GeoTIFF |image/tiff; application=geotiff
|GeoTIFF (including COG) |image/tiff; application=geotiff
|netCDF |application/x-netcdf
|CIS JSON |application/json (TODO: either OGC API will adopt a mechanism for negotiation by profile, or a more specific media type will be registered)
|CoverageJSON |application/prs.coverage+json
|CoverageJSON |application/vnd.cov+json
|LAS |vnd.las
|LASZip |vnd.laszip
|PNG |image/png
Expand Down Expand Up @@ -67,15 +68,24 @@ include::requirements/requirements_class_html.adoc[]

The GeoTIFF requirements class defines support for encoding a coverage response according to the https://docs.ogc.org/is/19-008r4/19-008r4.html[OGC GeoTIFF standard].

// TODO: include::requirements/requirements_class_geotiff.adoc[]
include::requirements/requirements_class_geotiff.adoc[]

[[rc_encoding-cog]]
=== Requirements Class "Cloud Optimized GeoTIFF"

==== Overview

The Cloud Optimized GeoTIFF (COG) requirements class defines support for accessing a coverage response as a https://docs.ogc.org/is/21-026/21-026.html[COG] using HTTP range requests.

include::requirements/requirements_class_cog.adoc[]

=== Requirements Class "netCDF"

==== Overview

The netCDF requirements class defines support for encoding a coverage response according to the https://portal.ogc.org/files/?artifact_id=43732[OGC netCDF standard].

// TODO: include::requirements/requirements_class_netcdf.adoc[]
include::requirements/requirements_class_netcdf.adoc[]

[[rc_encoding-cisjson]]
=== Requirements Class "CIS JSON"
Expand Down Expand Up @@ -134,7 +144,7 @@ include::requirements/requirements_class_cisjson.adoc[]

The CoverageJSON requirements class defines support for encoding a coverage response according to the https://docs.ogc.org/cs/21-069r2/21-069r2.html[OGC CoverageJSON Community Standard].

// TODO: include::requirements/requirements_class_coveragejson.adoc[]
include::requirements/requirements_class_coveragejson.adoc[]

[[rc_encoding-las]]
=== Requirements Class "LAS"
Expand All @@ -145,7 +155,7 @@ The LAS requirements class defines support for encoding a coverage response acco

This requirements class is particularly well suited for distributing point cloud coverages.

// TODO: include::requirements/requirements_class_las.adoc[]
include::requirements/requirements_class_las.adoc[]

[[rc_encoding-laszip]]
=== Requirements Class "LASZip"
Expand All @@ -157,7 +167,7 @@ https://www.cs.unc.edu/~isenburg/lastools/download/laszip.pdf[LASZip] compressio

This requirements class is particularly well suited for distributing point cloud coverages.

// TODO: include::requirements/requirements_class_laszip.adoc[]
include::requirements/requirements_class_laszip.adoc[]

[[rc_encoding-png]]
=== Requirements Class "PNG"
Expand All @@ -170,7 +180,7 @@ Because PNG encoding is limited to an integer data values, this requirements cla
a specific scale factor and offset to be used to quantize coverage values, and allowing the implementation to inform the client of the scale factor and offset
used for that quantization.

// TODO: include::requirements/requirements_class_png.adoc[]
include::requirements/requirements_class_png.adoc[]

[[rc_encoding-jpegxl]]
=== Requirements Class "JPEG XL"
Expand All @@ -181,7 +191,7 @@ The JPEG XL requirements class defines support for encoding a coverage response

// JPEG XL supports a large number of bands, image dimensions, and floating points.

// TODO: include::requirements/requirements_class_jpegxl.adoc[]
include::requirements/requirements_class_jpegxl.adoc[]

[[rc_encoding-jpeg2000]]
=== Requirements Class "JPEG 2000"
Expand All @@ -193,7 +203,7 @@ support for georeferencing with http://www.opengis.net/doc/IS/GMLJP2/2.1[GMLJP2]

// TODO: .jpf for floating point support, and/or parameters like PNG?

// TODO: include::requirements/requirements_class_jpeg2000.adoc[]
include::requirements/requirements_class_jpeg2000.adoc[]

[[rc_encoding-zarr]]
=== Requirements Class "(Geo)Zarr"
Expand All @@ -203,4 +213,4 @@ support for georeferencing with http://www.opengis.net/doc/IS/GMLJP2/2.1[GMLJP2]
The (Geo)Zarr requirements class defines support for encoding a coverage response according to the https://portal.ogc.org/files/100727[OGC Zarr Community Standard], with
eventual support for https://www.ogc.org/requests/ogc-to-form-geozarr-standards-working-group-public-comment-sought-on-draft-charter/[GeoZarr].

// TODO: include::requirements/requirements_class_zarr.adoc[]
include::requirements/requirements_class_zarr.adoc[]
6 changes: 3 additions & 3 deletions standard/openapi/ogcapi-coverages-1.bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -3436,7 +3436,7 @@
"Coverage": {
"description": "A coverage, including any self-describing information supported by the encoding.",
"content": {
"application/prs.coverage+json": {
"application/vnd.cov+json": {
"schema": {
"type": "string"
}
Expand Down Expand Up @@ -3716,7 +3716,7 @@
{
"href": "http://data.example.org/collections/elevation/coverage.covjson",
"rel": "http://www.opengis.net/def/rel/ogc/1.0/coverage",
"type": "application/prs.coverage+json",
"type": "application/vnd.cov+json",
"title": "Elevation data (as CoverageJSON)"
},
{
Expand Down Expand Up @@ -3788,7 +3788,7 @@
{
"href": "http://data.example.org/collections/elevation/coverage.covjson",
"rel": "http://www.opengis.net/def/rel/ogc/1.0/coverage",
"type": "application/prs.coverage+json",
"type": "application/vnd.cov+json",
"title": "Elevation data (as CoverageJSON)"
},
{
Expand Down
2 changes: 1 addition & 1 deletion standard/openapi/responses/common-geodata/rCollection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ content:
title: Elevation data (as GeoTIFF)
- href: http://data.example.org/collections/elevation/coverage.covjson
rel: http://www.opengis.net/def/rel/ogc/1.0/coverage
type: application/prs.coverage+json
type: application/vnd.cov+json
title: Elevation data (as CoverageJSON)
- href: http://data.example.org/collections/elevation/coverage.cisjson
rel: http://www.opengis.net/def/rel/ogc/1.0/coverage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ content:
title: Elevation data (as GeoTIFF)
- href: http://data.example.org/collections/elevation/coverage.covjson
rel: http://www.opengis.net/def/rel/ogc/1.0/coverage
type: application/prs.coverage+json
type: application/vnd.cov+json
title: Elevation data (as CoverageJSON)
- href: http://data.example.org/collections/elevation/coverage.cisjson
rel: http://www.opengis.net/def/rel/ogc/1.0/coverage
Expand Down
2 changes: 1 addition & 1 deletion standard/openapi/responses/coverages-core/rCoverage.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: A coverage, including any self-describing information supported by the encoding.
content:
application/prs.coverage+json:
application/vnd.cov+json:
schema:
type: string
# SwaggerUI Validation errors? $ref: 'https://schemas.opengis.net/covjson/1.0/coveragejson.json'
Expand Down
38 changes: 38 additions & 0 deletions standard/requirements/requirements_class_cog.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[[rc_cog]]
[cols="1,4",width="90%"]
|===
2+|*Requirements Class*
2+|http://www.opengis.net/spec/ogcapi-coverages-1/1.0/req/cog
|Target type |Web API
|Dependency |http://www.opengis.net/spec/ogcapi-coverages-1/1.0/req/core
|Dependency |https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf
|Dependency |https://docs.ogc.org/is/19-008r4/19-008r4.html
|Dependency |https://docs.ogc.org/is/21-026/21-026.html
|===

// [[GeoTIFF]] OGC 19-008: *OGC GeoTIFF Standard*, Version 1.1, http://docs.opengeospatial.org/is/19-008r4/19-008r4.html
// [[[TIFF_V6,TIFF V6.0]]], Adobe Developers Association: TIFF Specification Revision 6.0. (1992) https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf[https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf]

==== Requirements

[[requirements-class-cog-clause]]

===== Cloud Optimized GeoTIFF access

[[req_cog_http-range]]
[width="90%",cols="2,6a"]
|===
^|*Requirement {counter:req-id}* |*/req/cog/http-range*
^|A |The coverage resource (`/coverage`), as defined in the Core requirement class, SHALL support HTTP range requests as specified in
the https://docs.ogc.org/is/21-026/21-026.html#HTTPRangeSupportRequirements[`/req/http-range` requirement class of COG].
|===

[[req_cog_cloud-optimized]]
[width="90%",cols="2,6a"]
|===
^|*Requirement {counter:req-id}* |*/req/cog/cloud-optimized*
^|A |The coverage resource, as defined in the Core requirement class, SHALL support content negotiation of a https://docs.ogc.org/is/19-008r4/19-008r4.html[GeoTIFF] using the cloud-optimized profile,
(`Accept-Profile:`/`Content-Profile:` http://www.opengis.net/def/profile/geotiff/cloud-optimized`, `Accept:`/`Content-Type:` `image/tiff; application=geotiff` media type).
^|B |The response SHALL be a GeoTIFF document which validates against the GeoTIFF and TIFF standard.
^|C |If the response contains multiple fields, the fields SHALL be encoded as bands ordered following the `x-OGC-property-seq` sequence.
|===
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ with the following characteristics (using an Extended Backus Naur Form (EBNF) fr
^|P |If a upper limit of the subset interval is populated with an asterisk `*`, then the maximum extent of the coverage along that axis SHALL be selected.
^|Q |Multiple subset parameters SHALL be interpreted, as if all dimension subsetting values were provided in a single subset parameter (comma separated)^1^.

|1 Example: subset=Lat(-90:90)&subset=Lon(-180:180)&subset=time("2018-02-12T23:20:52Z")&subset=atm_pressure_hpa(500) is equivalent to subset=Lat(-90:90),Lon(-180:180),time("2018-02-12T23:20:52Z"),atm_pressure_hpa(500)
2+|1 Example: subset=Lat(-90:90)&subset=Lon(-180:180)&subset=time("2018-02-12T23:20:52Z")&subset=atm_pressure_hpa(500) is equivalent to subset=Lat(-90:90),Lon(-180:180),time("2018-02-12T23:20:52Z"),atm_pressure_hpa(500)
2 Note that this is only valid of the spatial dimensions. The ‘additional’ dimensions rely on the names of the extent of the collection.
|===

Expand Down
23 changes: 23 additions & 0 deletions standard/requirements/requirements_class_coveragejson.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[[rc_coveragejson]]
[cols="1,4",width="90%"]
|===
2+|*Requirements Class*
2+|http://www.opengis.net/spec/ogcapi-coverages-1/1.0/req/coveragejson
|Target type |Web API
|Dependency |http://www.opengis.net/spec/ogcapi-coverages-1/1.0/req/core
|Dependency |https://docs.ogc.org/cs/21-069r2/21-069r2.html
|===

==== Requirements

[[requirements-class-coveragejson-clause]]

===== Coverage JSON representation

[[req_coveragejson_coverage]]
[width="90%",cols="2,6a"]
|===
^|*Requirement {counter:req-id}* |*/req/coveragejson/coverage*
^|A |The coverage resource, as defined in the Core requirement class, SHALL support negotiating a https://docs.ogc.org/cs/21-069r2/21-069r2.html[CoverageJSON] response using the `application/vnd.cov+json` media type.
^|B |The response SHALL be a CoverageJSON document which validates against the CoverageJSON community standard.
|===
86 changes: 86 additions & 0 deletions standard/requirements/requirements_class_geotiff.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[[rc_geotiff]]
[cols="1,4",width="90%"]
|===
2+|*Requirements Class*
2+|http://www.opengis.net/spec/ogcapi-coverages-1/1.0/req/geotiff
|Target type |Web API
|Dependency |http://www.opengis.net/spec/ogcapi-coverages-1/1.0/req/core
|Dependency |https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf
|Dependency |https://docs.ogc.org/is/19-008r4/19-008r4.html
|===

// [[GeoTIFF]] OGC 19-008: *OGC GeoTIFF Standard*, Version 1.1, http://docs.opengeospatial.org/is/19-008r4/19-008r4.html
// [[[TIFF_V6,TIFF V6.0]]], Adobe Developers Association: TIFF Specification Revision 6.0. (1992) https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf[https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf]

==== Requirements

[[requirements-class-geotiff-clause]]

===== GeoTIFF representation

[[req_geotiff_coverage]]
[width="90%",cols="2,6a"]
|===
^|*Requirement {counter:req-id}* |*/req/geotiff/coverage*
^|A |The coverage resource, as defined in the Core requirement class, SHALL support negotiating a https://docs.ogc.org/is/19-008r4/19-008r4.html[GeoTIFF] response using the `image/tiff; application=geotiff` media type.
^|B |The response SHALL be a GeoTIFF document which validates against the GeoTIFF and TIFF standard.
^|C |If the response contains multiple fields, the fields SHALL be encoded as bands ordered following the `x-OGC-property-seq` sequence.
|===

===== GeoTIFF parameters

[[rec_geotiff_compression]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/geotiff/compression*
^|A |The coverage resource SHOULD support a `compression` parameter.
^|B |The possible values for the `compression` parameter SHOULD be `none`, `packbits`, `huffman`, `lzw`, `deflate`.
^|C |The GeoTIFF coverage response SHOULD use the compression method specified.
|===

[[rec_geotiff_predictor]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/geotiff/predictor*
^|A |The coverage resource SHOULD support a `predictor` parameter.
^|B |The possible values for the `compression` parameter SHOULD be `none`, `horizontal`, `floating-point`.
^|C |The GeoTIFF coverage response SHOULD use the predictor specified.
|===

[[rec_geotiff_interleave]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/geotiff/interleave*
^|A |The coverage resource SHOULD support a `interleave` parameter.
^|B |The possible values for the `interleave` parameter SHOULD be `pixel` (PlanarConfiguration value 1 for chunky, PLANARCONFIG_CONTIG in libtiff) and `band`
(PlanarConfiguration value 2 for planar configuration, PLANARCONFIG_SEPARATE in libtiff).
^|C |The GeoTIFF coverage response SHOULD use the interleave setting specified (corresponding to the PlanarConfiguration in TIFF terminology).
|===

[[rec_geotiff_tiling]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/geotiff/tiling*
^|A |The coverage resource SHOULD support a boolean `tiling` parameter.
^|B |The GeoTIFF coverage response SHOULD use tiling if `tiling` is true, or strips otherwise.
|===

[[rec_geotiff_tile-height-width]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/geotiff/tile-width-height*
^|A |The coverage resource SHOULD support integer multiple of 16 `tile-width` and `tile-height` parameters when a `tiling` parameter is used.
^|B |The Implementation SHOULD return an error if these parameters are provided without a `tiling` parameter, or if their value is not a multiple of 16 greater than 0.
^|C |The GeoTIFF coverage response SHOULD use these tile width and tile height (TileLength in TIFF terminology).
|===

[[rec_geotiff_overview-count]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/geotiff/overview-count*
^|A |The coverage resource SHOULD support a integer `overview-count`.
^|B |The Implementation SHOULD return an error if this parameter is smaller than 0.
^|C |The GeoTIFF coverage response SHOULD generate progressively smaller overviews based on that requested number of overviews.
|===

NOTE: Clients can use a combination of `tiling`, `tile-width`, `tile-height` and `overview-count` to get a GeoTIFF conforming to the https://docs.ogc.org/is/21-026/21-026.html[OGC Cloud Optimize GeoTIFF] standard.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
35 changes: 35 additions & 0 deletions standard/requirements/requirements_class_png.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[[rc_png]]
[cols="1,4",width="90%"]
|===
2+|*Requirements Class*
2+|http://www.opengis.net/spec/ogcapi-coverages-1/1.0/req/geotiff
|Target type |Web API
|Dependency |http://www.opengis.net/spec/ogcapi-coverages-1/1.0/req/core
|Dependency |https://www.w3.org/TR/png/
|===

==== Requirements

[[requirements-class-png-clause]]

===== PNG representation

[[req_png_coverage]]
[width="90%",cols="2,6a"]
|===
^|*Requirement {counter:req-id}* |*/req/png/coverage*
^|A |The coverage resource, as defined in the Core requirement class, SHALL support negotiating a https://www.w3.org/TR/png/[PNG] response using the `image/png` media type.
^|B |The PNG response SHALL use 16-bit values for fields requiring more than 8-bit to encode accurately.
^|C |The Implementation SHALL return a 400 error for requests for any number of fields other than 1 or 3.
^|D |If the response contains multiple fields, the fields SHALL be encoded as bands ordered following the `x-OGC-property-seq` sequence.
^|E | A `Values-Scale:` response header with a numeric real value SHALL be returned indicating the factor by which values were multiplied before an offset was added to result in the encoded 8-bit or 16-bit PNG unsigned integer values.
^|F | A `Values-Offset:` response header with a numeric real value SHALL be returned indicating the offset which was added after multiplying values by the scale factor to result in the encoded 8-bit or 16-bit PNG unsigned integer values.
|===

[[rec_png_scale_offset]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/png/scale-offset*
^|A |The Implementation SHOULD support a `values-scale` query parameter on coverage resources when requesting a PNG output to indicate the value scale factor, as described in the `Values-Scale:` response header part of the content requirement.
^|B |The Implementation SHOULD support a `values-offset` query parameter on coverage resources when requesting a PNG output to indicate the value offset, as described in the `Values-Offset:` response header part of the content requirement.
|===
Empty file.

0 comments on commit 7b0a35c

Please sign in to comment.