Skip to content

Commit

Permalink
fix .pbf
Browse files Browse the repository at this point in the history
PDOK-15415
  • Loading branch information
roelarents committed Jun 8, 2023
1 parent 772bbfd commit 3bff79f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ogc/tiles/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ func (t *Tiles) Tile() http.HandlerFunc {
" Mapbox Vector Tiles (?f=mvt) tiles are supported", http.StatusBadRequest)
return
}
} else {
tileCol = tileCol[:len(tileCol)-4] // remove .pbf extension
}

// ogc spec is (default) z/row/col but tileserver is z/col/row (z/x/y)
Expand Down
19 changes: 17 additions & 2 deletions ogc/tiles/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ func TestTiles_Tile(t *testing.T) {
},
},
{
name: "NetherlandsRDNewQuad/5/10/15.pbf",
name: "NetherlandsRDNewQuad/5/10/15",
fields: fields{
configFile: "ogc/tiles/testdata/config_minimal_tiles.yaml",
url: "http://localhost:8080/tiles/:tileMatrixSetId/:tileMatrix/:tileRow/:tileCol.pbf",
url: "http://localhost:8080/tiles/:tileMatrixSetId/:tileMatrix/:tileRow/:tileCol",
tileMatrixSetID: "NetherlandsRDNewQuad",
tileMatrix: "5",
tileRow: "10",
Expand All @@ -158,6 +158,21 @@ func TestTiles_Tile(t *testing.T) {
statusCode: http.StatusBadRequest,
},
},
{
name: "NetherlandsRDNewQuad/5/10/15.pbf",
fields: fields{
configFile: "ogc/tiles/testdata/config_minimal_tiles.yaml",
url: "http://localhost:8080/tiles/:tileMatrixSetId/:tileMatrix/:tileRow/:tileCol",
tileMatrixSetID: "NetherlandsRDNewQuad",
tileMatrix: "5",
tileRow: "10",
tileCol: "15.pbf",
},
want: want{
body: "/NetherlandsRDNewQuad/5/15/10.pbf",
statusCode: http.StatusOK,
},
},
{
name: "different uriTemplateTiles",
fields: fields{
Expand Down

0 comments on commit 3bff79f

Please sign in to comment.