Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tiles): support collection-level OGC API tiles (geodata tiles). #223

Merged
merged 15 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
e1f6053
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 16, 2024
d3d52fa
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 19, 2024
1973754
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 20, 2024
9704388
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 22, 2024
ccd2d8b
feat(tiles): support collection-level OGC API tiles (geodata tiles).
rkettelerij Aug 23, 2024
a4d398b
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 23, 2024
7ce3bd8
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 26, 2024
a4479a6
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 26, 2024
54cd0af
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 26, 2024
5647595
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 27, 2024
c3dd68d
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 27, 2024
9f11df8
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 27, 2024
8a30e33
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 27, 2024
dbaa60a
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 27, 2024
f3f1469
feat(tiles): support collection-level OGC API tiles (geodata tiles). …
rkettelerij Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions assets/i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,22 @@ ConformanceText: The conformance describes which OGC standards this API implemen
Collections: Collections
CollectionsText: This API offers one or more collections that divide the dataset in various object types, which can be called separately through for instance <i>features</i> or <i>tiles</i>.
Tiles: Tiles
TilesTextHTML: This entire dataset is available as vector tiles in multiple projections. One or more <a href="styles" aria-label="Go to styles">styles</a> are also available.
TilesTextPlain: This entire dataset is available as vector tiles in multiple projections. One or more styles are also available.
TilesTextHTML: This entire dataset is available as vector tiles in multiple projections.
TilesTextPlain: This entire dataset is available as vector tiles in multiple projections.
WithStylesHTML: One or more <a href="styles" aria-label="Go to styles">styles</a> are also available.
WithStylesPlain: One or more styles are also available.
Styles: Styles
StylesText: One or more official styles as specified by the supplier. Styles are made available in the Mapbox format.
TileMatrixSets: Tile Matrix Sets
TileMatrixSetsText: |-
TileMatrixSetsDatasetText: |-
Description of the Tile Matrix Sets that are made available via this API. Note that all zoom levels
of the tile matrix are described. See the <i>Tile Matrix Set Limits</i> on the <a href="tiles" aria-label="Go to tiles">Tiles</a>
pages to see what zoom levels are supported by this API.
TileMatrixSetsCollectionText: |-
Description of the Tile Matrix Sets that are made available via this API. Note that all zoom levels
of the tile matrix are described. See the <i>Tile Matrix Set Limits</i> on the Tiles pages
(within the <a href="collections" aria-label="Go to collections">collections</a>) to see what zoom levels are supported by this API.


# Conformance page
ConformanceAbstract: Below are references to OGC API conformance classes to which this service conforms. <br/>The status column indicates whether the given specification is deemed an official standard by the OGC.
Expand All @@ -58,19 +65,18 @@ Draft: Draft
NetherlandsRDNewQuadAbstract: |-
The tiles can be requested via the URL template below, where
<small><code>{z}/{y}/{x}</code></small> is a reference to a tile according to the
<a href="tileMatrixSets/NetherlandsRDNewQuad" aria-label="Go to tile matrix set NetherlandsRDNewQuad">NetherlandsRDNewQuad</a> tiling scheme. In some tools it is
also possible to load this through <a href="tiles/NetherlandsRDNewQuad?f=tilejson" aria-label="Go to NetherlandsRDNewQuad as TileJSON">TileJSON</a>.
<a href="tileMatrixSets/NetherlandsRDNewQuad" aria-label="Go to tile matrix set NetherlandsRDNewQuad">NetherlandsRDNewQuad</a> tiling scheme.
In some tools it is also possible to load this through
WebMercatorQuadAbstract: |-
The tiles can be requested via the URL template below, where
<small><code>{z}/{y}/{x}</code></small> is a reference to a tile according to the
<a href="tileMatrixSets/WebMercatorQuad" aria-label="Go to tile matrix set WebMercatorQuad">WebMercatorQuad</a> tiling scheme. In some tools it is
also possible to load this through <a href="tiles/WebMercatorQuad?f=tilejson" aria-label="Go to WebMercatorQuad as TileJSON">TileJSON</a>.
In some tools it is also possible to load this through
EuropeanETRS89_LAEAQuadAbstract: |-
The tiles can be requested via the URL template below, where
<small><code>{z}/{y}/{x}</code></small> is a reference to a tile according to the
<a href="tileMatrixSets/EuropeanETRS89_LAEAQuad" aria-label="Go to tile matrix set EuropeanETRS89_LAEAQuad">EuropeanETRS89_LAEAQuad</a> tiling scheme.
In some tools it is also possible to load this through
<a href="tiles/EuropeanETRS89_LAEAQuad?f=tilejson" aria-label="Go to EuropeanETRS89_LAEAQuad as TileJSON">TileJSON</a>.
AvailableZoomLevels: The tiles are available at the following zoomlevels
ZoomLevel: Zoom level
MinimumValue: Minimum value
Expand All @@ -97,6 +103,8 @@ GoTo: Go to the
ViewIn: View in the
Browse: Browse through the
FeaturesExplanation: GeoJSON is an open and widely accepted format for feature data and the first choice for many (web) applications. However, it formally only supports the WGS84 projection. JSON-FG is an extension of GeoJSON and does offer official support for other projections. Since JSON-FG is a recent development, from a compatibility point of view GeoJSON is also offered in other projections for the time being.
CollectionTilesHTML: This collection is available as vector tiles in one or multiple projections.
CollectionTilesPlain: This collection is available as vector tiles in one or multiple projections.

# Features page
Geometry: geometry
Expand Down
23 changes: 14 additions & 9 deletions assets/i18n/nl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,21 @@ ConformanceText: De conformance beschrijft welke OGC standaarden deze API implem
Collections: Collections
CollectionsText: Deze API biedt één of meerdere collecties waarmee onderscheid gemaakt wordt in verschillende object typen, die bijvoorbeeld als <i>features</i> of <i>tiles</i> separaat aangeroepen kunnen worden.
Tiles: Tiles
TilesTextHTML: Deze dataset wordt beschikbaar gesteld als vector tiles in meerdere projecties. Ook worden er &eacute;&eacute;n of meerdere <a href="styles" aria-label="Ga naar styles">styles</a> beschikbaar gesteld.
TilesTextPlain: Deze dataset wordt beschikbaar gesteld als vector tiles in meerdere projecties. Ook worden er één of meerdere styles beschikbaar gesteld.
TilesTextHTML: Deze dataset wordt beschikbaar gesteld als vector tiles in &eacute;&eacute;n of meerdere projecties.
TilesTextPlain: Deze dataset wordt beschikbaar gesteld als vector tiles in één of meerdere projecties.
WithStylesHTML: Ook worden er <a href="styles" aria-label="Ga naar styles">styles</a> beschikbaar gesteld.
WithStylesPlain: Ook worden er styles beschikbaar gesteld.
Styles: Styles
StylesText: Betreft één of meerdere officiële styles van/door de aanbieder gespecificeerd. Styles worden beschikbaar gesteld in het Mapbox formaat.
TileMatrixSets: Tile Matrix Sets
TileMatrixSetsText: |-
TileMatrixSetsDatasetText: |-
Beschrijving van de Tile Matrix Sets die via deze API worden ontsloten. Merk op dat alle zoomniveaus
van de tile matrix zijn beschreven. Zie de <i>Tile Matrix Set Limits</i> op de <a href="tiles" aria-label="Ga naar tiles">Tiles</a>
pagina's om te zien welke zoomniveaus door deze API worden ondersteund.
TileMatrixSetsCollectionText: |-
Beschrijving van de Tile Matrix Sets die via deze API worden ontsloten. Merk op dat alle zoomniveaus
van de tile matrix zijn beschreven. Zie de <i>Tile Matrix Set Limits</i> op de Tiles pagina's
(binnen de <a href="collections" aria-label="Ga naar collections">collections</a>) om te zien welke zoomniveaus door deze API worden ondersteund.

# Conformance page
ConformanceAbstract: Hieronder staan verwijzingen naar de OGC API conformiteitsklassen waaraan deze service voldoet. <br/>De statuskolom geeft aan of de betreffende specificatie reeds tot officiële standaard is verklaard door het OGC.
Expand All @@ -59,20 +65,17 @@ NetherlandsRDNewQuadAbstract: |-
De tiles zijn op te vragen via onderstaande URL-template. Daarbij is
<small><code>{z}/{y}/{x}</code></small> een verwijzing naar een
tile volgens het <a href="tileMatrixSets/NetherlandsRDNewQuad" aria-label="Ga naar tile matrix set NetherlandsRDNewQuad">NetherlandsRDNewQuad</a> tiling scheme.
In sommige tools is het ook mogelijk om dit via <a href="tiles/NetherlandsRDNewQuad?f=tilejson" aria-label="Ga naar NetherlandsRDNewQuad als TileJSON">TileJSON</a>
in te laden.
In sommige tools is het ook mogelijk om dit in te laden via
WebMercatorQuadAbstract: |-
De tiles zijn op te vragen via onderstaande URL-template. Daarbij is
<small><code>{z}/{y}/{x}</code></small> een verwijzing naar een
tile volgens het <a href="tileMatrixSets/WebMercatorQuad" aria-label="Ga naar tile matrix set WebMercatorQuad">WebMercatorQuad</a> tiling scheme.
In sommige tools is het ook mogelijk om dit via <a href="tiles/WebMercatorQuad?f=tilejson" aria-label="Ga naar WebMercatorQuad als TileJSON">TileJSON</a>
in te laden.
In sommige tools is het ook mogelijk om dit in te laden via
EuropeanETRS89_LAEAQuadAbstract: |-
De tiles zijn op te vragen via onderstaande URL-template. Daarbij is
<small><code>{z}/{y}/{x}</code></small> een verwijzing naar een
tile volgens het <a href="tileMatrixSets/EuropeanETRS89_LAEAQuad" aria-label="Ga naar tile matrix set EuropeanETRS89_LAEAQuad">EuropeanETRS89_LAEAQuad</a> tiling scheme.
In sommige tools is het ook mogelijk om dit via <a href="tiles/EuropeanETRS89_LAEAQuad?f=tilejson" aria-label="Ga naar EuropeanETRS89_LAEAQuad als TileJSON">TileJSON</a>
in te laden.
In sommige tools is het ook mogelijk om dit in te laden via
AvailableZoomLevels: De tiles zijn beschikbaar op de volgende zoomniveaus
ZoomLevel: Zoomniveau
MinimumValue: Minimale waarde
Expand All @@ -99,6 +102,8 @@ GoTo: Ga naar de
ViewIn: Bekijk in de
Browse: Blader door de
FeaturesExplanation: GeoJSON is een open en breed geaccepteerd formaat voor feature data en voor veel (web)toepassingen de eerste keus. Formeel ondersteunt het echter alleen de WGS84 projectie. JSON-FG is een uitbreiding op GeoJSON en biedt officiële ondersteuning voor andere projecties. Aangezien JSON-FG een recente ontwikkeling is wordt er vanuit compatibiliteit oogpunt vooralsnog ook GeoJSON in andere projecties aangeboden.
CollectionTilesHTML: Deze collectie wordt beschikbaar gesteld als vector tiles in &eacute;&eacute;n of meerdere projecties.
CollectionTilesPlain: Deze collectie wordt beschikbaar gesteld als vector tiles in één of meerdere projecties.

# Features page
Geometry: geometrie
Expand Down
12 changes: 12 additions & 0 deletions cmd/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ func Test_newRouter(t *testing.T) {
apiCall: "http://localhost:8180/collections?f=json",
wantBody: "internal/ogc/features/testdata/expected_multiple_feature_tables_single_geopackage.json",
},
{
name: "Serve top-level OGC API Tiles",
configFile: "internal/ogc/tiles/testdata/config_tiles_toplevel_and_collectionlevel.yaml",
apiCall: "http://localhost:8180/tiles?f=json",
wantBody: "internal/ogc/tiles/testdata/expected_top_level_tiles.json",
},
{
name: "Serve collection-level OGC API Tiles",
configFile: "internal/ogc/tiles/testdata/config_tiles_toplevel_and_collectionlevel.yaml",
apiCall: "http://localhost:8180/collections/example2/tiles?f=json",
wantBody: "internal/ogc/tiles/testdata/expected_collection_level_tiles.json",
},
{
name: "Check conformance of OGC API Processes",
configFile: "internal/engine/testdata/config_processes.yaml",
Expand Down
79 changes: 66 additions & 13 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"path/filepath"
"slices"
"sort"
"strconv"
"strings"

Expand Down Expand Up @@ -423,7 +424,9 @@ func (gv *CollectionEntry3dGeoVolumes) HasDTM() bool {

// +kubebuilder:object:generate=true
type CollectionEntryTiles struct {
// placeholder

// Tiles specific to this collection. Called 'geodata tiles' in OGC spec.
GeoDataTiles Tiles `yaml:",inline" json:",inline" validate:"required"`
}

// +kubebuilder:object:generate=true
Expand Down Expand Up @@ -560,24 +563,58 @@ const (

// +kubebuilder:object:generate=true
type OgcAPITiles struct {
// Reference to the server (or object storage) hosting the tiles
TileServer URL `yaml:"tileServer" json:"tileServer" validate:"required"`

// Could be 'vector' and/or 'raster' to indicate the types of tiles offered
Types []TilesType `yaml:"types" json:"types" validate:"required"`

// Specifies in what projections (SRS/CRS) the tiles are offered
SupportedSrs []SupportedSrs `yaml:"supportedSrs" json:"supportedSrs" validate:"required,dive"`

// Optional template to the vector tiles on the tileserver. Defaults to {tms}/{z}/{x}/{y}.pbf.
// Tiles for the entire dataset, these are hosted at the root of the API (/tiles endpoint).
// +optional
URITemplateTiles *string `yaml:"uriTemplateTiles,omitempty" json:"uriTemplateTiles,omitempty"`
DatasetTiles *Tiles `yaml:",inline" json:",inline" validate:"required_without_all=Collections"`

// The collections to offer as tiles. When no collection is specified the tiles are hosted at the root of the API (/tiles endpoint).
// Tiles per collection. When no collections are specified tiles should be hosted at the root of the API (/tiles endpoint).
// +optional
Collections GeoSpatialCollections `yaml:"collections,omitempty" json:"collections,omitempty"`
}

func (o *OgcAPITiles) HasType(t TilesType) bool {
if o.DatasetTiles != nil && slices.Contains(o.DatasetTiles.Types, t) {
return true
}
for _, coll := range o.Collections {
if coll.Tiles != nil && slices.Contains(coll.Tiles.GeoDataTiles.Types, t) {
return true
}
}
return false
}

func (o *OgcAPITiles) HasProjection(srs string) bool {
for _, projection := range o.GetProjections() {
if projection.Srs == srs {
return true
}
}
return false
}

func (o *OgcAPITiles) GetProjections() []SupportedSrs {
supportedSrsSet := map[SupportedSrs]struct{}{}
if o.DatasetTiles != nil {
for _, supportedSrs := range o.DatasetTiles.SupportedSrs {
supportedSrsSet[supportedSrs] = struct{}{}
}
}
for _, coll := range o.Collections {
if coll.Tiles == nil {
continue
}
for _, supportedSrs := range coll.Tiles.GeoDataTiles.SupportedSrs {
supportedSrsSet[supportedSrs] = struct{}{}
}
}
result := util.Keys(supportedSrsSet)
sort.Slice(result, func(i, j int) bool {
return len(result[i].Srs) > len(result[j].Srs)
})
return result
}

// +kubebuilder:object:generate=true
type OgcAPIStyles struct {
// ID of the style to use a default
Expand Down Expand Up @@ -901,6 +938,22 @@ type PropertyFilter struct {
DeriveAllowedValuesFromDatasource *bool `yaml:"deriveAllowedValuesFromDatasource,omitempty" json:"deriveAllowedValuesFromDatasource,omitempty" default:"false"`
}

// +kubebuilder:object:generate=true
type Tiles struct {
// Reference to the server (or object storage) hosting the tiles
TileServer URL `yaml:"tileServer" json:"tileServer" validate:"required"`

// Could be 'vector' and/or 'raster' to indicate the types of tiles offered
Types []TilesType `yaml:"types" json:"types" validate:"required"`

// Specifies in what projections (SRS/CRS) the tiles are offered
SupportedSrs []SupportedSrs `yaml:"supportedSrs" json:"supportedSrs" validate:"required,dive"`

// Optional template to the vector tiles on the tileserver. Defaults to {tms}/{z}/{x}/{y}.pbf.
// +optional
URITemplateTiles *string `yaml:"uriTemplateTiles,omitempty" json:"uriTemplateTiles,omitempty"`
}

// +kubebuilder:object:generate=true
type SupportedSrs struct {
// Projection (SRS/CRS) used
Expand Down
Loading
Loading