From 5b12a1ffcd4584bb33ac1532ba00962ccbca5456 Mon Sep 17 00:00:00 2001 From: robbert Date: Thu, 20 Aug 2026 10:27:31 +0200 Subject: [PATCH 1/5] filter voor laag voor getfeature request --- api/v3/wms_types.go | 6 ++++++ config/crd/bases/pdok.nl_wms.yaml | 19 +++++++++++++++++++ .../controller/mapfilegenerator/mapper.go | 2 ++ internal/controller/mapfilegenerator/types.go | 2 ++ 4 files changed, 29 insertions(+) diff --git a/api/v3/wms_types.go b/api/v3/wms_types.go index a6024ab..4b368b3 100644 --- a/api/v3/wms_types.go +++ b/api/v3/wms_types.go @@ -244,6 +244,12 @@ type Layer struct { // +kubebuilder:validation:Pattern:=`^[1-9][0-9]*(.[0-9]+)?$` MaxScaleDenominator *string `json:"maxscaledenominator,omitempty"` + //The column where the data needs te get filtered + FilterColumn *string `json:"filterColumn,omitempty"` + + //The value where the data needs to get filtered + FilterValue *string `json:"filterValue,omitempty"` + // List of styles used by the layer // +kubebuilder:validation:MinItems:=1 Styles []Style `json:"styles,omitempty"` diff --git a/config/crd/bases/pdok.nl_wms.yaml b/config/crd/bases/pdok.nl_wms.yaml index 0fa86d8..b644c9e 100644 --- a/config/crd/bases/pdok.nl_wms.yaml +++ b/config/crd/bases/pdok.nl_wms.yaml @@ -1350,6 +1350,12 @@ spec: description: The minimum scale at which this layer functions pattern: ^[0-9]+(.[0-9]+)?$ type: string + filterColumn: + description: The maximum scale at which this layer functions + type: string + filterValue: + description: The minimum scale at which this layer functions + type: string name: description: Name of the layer, required for layers on the 2nd or 3rd level minLength: 1 @@ -1427,6 +1433,13 @@ spec: description: The minimum scale at which this layer functions pattern: ^[0-9]+(.[0-9]+)?$ type: string + + filterColumn: + description: The maximum scale at which this layer functions + type: string + filterValue: + description: The minimum scale at which this layer functions + type: string name: description: Name of the layer, required for layers on the 2nd or 3rd level minLength: 1 @@ -1506,6 +1519,12 @@ spec: description: The minimum scale at which this layer functions pattern: ^[0-9]+(.[0-9]+)?$ type: string + filterColumn: + description: The maximum scale at which this layer functions + type: string + filterValue: + description: The minimum scale at which this layer functions + type: string name: description: Name of the layer, required for layers on the 2nd or 3rd level minLength: 1 diff --git a/internal/controller/mapfilegenerator/mapper.go b/internal/controller/mapfilegenerator/mapper.go index c2efde9..199cd43 100644 --- a/internal/controller/mapfilegenerator/mapper.go +++ b/internal/controller/mapfilegenerator/mapper.go @@ -291,6 +291,8 @@ func getWMSLayer(serviceLayer pdoknlv3.Layer, serviceExtent string, wms *pdoknlv Postgis: nil, MinScale: serviceLayer.MinScaleDenominator, MaxScale: serviceLayer.MaxScaleDenominator, + FilterColumn: serviceLayer.FilterColumn, + FilterValue: serviceLayer.FilterValue, LabelNoClip: serviceLayer.LabelNoClip, }, GroupName: groupName, diff --git a/internal/controller/mapfilegenerator/types.go b/internal/controller/mapfilegenerator/types.go index 084cb4a..ccc02e0 100644 --- a/internal/controller/mapfilegenerator/types.go +++ b/internal/controller/mapfilegenerator/types.go @@ -66,6 +66,8 @@ type BaseLayer struct { Postgis *bool `json:"postgis,omitempty"` MinScale *string `json:"minscale,omitempty"` MaxScale *string `json:"maxscale,omitempty"` + FilterColumn *string `json:"filter_column,omitempty"` + FilterValue *string `json:"filter_value,omitempty"` TifPath *string `json:"tif_path,omitempty"` Resample *string `json:"resample,omitempty"` OversampleRatio *string `json:"oversample_ratio,omitempty"` From bba379638e05101306e935e89417e1f63dc3fc0e Mon Sep 17 00:00:00 2001 From: robbert Date: Thu, 20 Aug 2026 13:04:57 +0200 Subject: [PATCH 2/5] added tests and run make file --- api/v3/zz_generated.deepcopy.go | 10 +++++ config/crd/bases/pdok.nl_wms.yaml | 37 +++++++++---------- .../test_data/expected/wms_group.json | 4 +- .../test_data/input/wms_group.yaml | 4 +- internal/controller/mapfilegenerator/types.go | 4 +- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/api/v3/zz_generated.deepcopy.go b/api/v3/zz_generated.deepcopy.go index 0f1ccdd..f6738ae 100644 --- a/api/v3/zz_generated.deepcopy.go +++ b/api/v3/zz_generated.deepcopy.go @@ -626,6 +626,16 @@ func (in *Layer) DeepCopyInto(out *Layer) { *out = new(string) **out = **in } + if in.FilterColumn != nil { + in, out := &in.FilterColumn, &out.FilterColumn + *out = new(string) + **out = **in + } + if in.FilterValue != nil { + in, out := &in.FilterValue, &out.FilterValue + *out = new(string) + **out = **in + } if in.Styles != nil { in, out := &in.Styles, &out.Styles *out = make([]Style, len(*in)) diff --git a/config/crd/bases/pdok.nl_wms.yaml b/config/crd/bases/pdok.nl_wms.yaml index b644c9e..563ae9d 100644 --- a/config/crd/bases/pdok.nl_wms.yaml +++ b/config/crd/bases/pdok.nl_wms.yaml @@ -911,6 +911,12 @@ spec: x-kubernetes-validations: - message: metadataUrl should have exactly 1 of csw or custom rule: (has(self.csw) || has(self.custom)) && !(has(self.csw) && has(self.custom)) + filterColumn: + description: The column where the data needs te get filtered + type: string + filterValue: + description: The value where the data needs to get filtered + type: string keywords: description: Keywords of the layer, required if the layer is visible items: @@ -1120,6 +1126,12 @@ spec: x-kubernetes-validations: - message: metadataUrl should have exactly 1 of csw or custom rule: (has(self.csw) || has(self.custom)) && !(has(self.csw) && has(self.custom)) + filterColumn: + description: The column where the data needs te get filtered + type: string + filterValue: + description: The value where the data needs to get filtered + type: string keywords: description: Keywords of the layer, required if the layer is visible items: @@ -1332,6 +1344,12 @@ spec: x-kubernetes-validations: - message: metadataUrl should have exactly 1 of csw or custom rule: (has(self.csw) || has(self.custom)) && !(has(self.csw) && has(self.custom)) + filterColumn: + description: The column where the data needs te get filtered + type: string + filterValue: + description: The value where the data needs to get filtered + type: string keywords: description: Keywords of the layer, required if the layer is visible items: @@ -1350,12 +1368,6 @@ spec: description: The minimum scale at which this layer functions pattern: ^[0-9]+(.[0-9]+)?$ type: string - filterColumn: - description: The maximum scale at which this layer functions - type: string - filterValue: - description: The minimum scale at which this layer functions - type: string name: description: Name of the layer, required for layers on the 2nd or 3rd level minLength: 1 @@ -1433,13 +1445,6 @@ spec: description: The minimum scale at which this layer functions pattern: ^[0-9]+(.[0-9]+)?$ type: string - - filterColumn: - description: The maximum scale at which this layer functions - type: string - filterValue: - description: The minimum scale at which this layer functions - type: string name: description: Name of the layer, required for layers on the 2nd or 3rd level minLength: 1 @@ -1519,12 +1524,6 @@ spec: description: The minimum scale at which this layer functions pattern: ^[0-9]+(.[0-9]+)?$ type: string - filterColumn: - description: The maximum scale at which this layer functions - type: string - filterValue: - description: The minimum scale at which this layer functions - type: string name: description: Name of the layer, required for layers on the 2nd or 3rd level minLength: 1 diff --git a/internal/controller/mapfilegenerator/test_data/expected/wms_group.json b/internal/controller/mapfilegenerator/test_data/expected/wms_group.json index 57a00d4..98aff93 100644 --- a/internal/controller/mapfilegenerator/test_data/expected/wms_group.json +++ b/internal/controller/mapfilegenerator/test_data/expected/wms_group.json @@ -86,7 +86,9 @@ "keywords": "Hydroobject,Waterbody,Watercourse,River,Stream,Lake,Reservoir", "layer_extent": "-59188.44333693248 304984.64144318487 308126.88473339565 858328.516489961", "maxscale": "50000", - "minscale": "1", + "minscale": "2", + "filtercolumn": "gml_id", + "filtervalue": "1", "name": "HY.PhysicalWaters.Waterbodies", "styles": [ { diff --git a/internal/controller/mapfilegenerator/test_data/input/wms_group.yaml b/internal/controller/mapfilegenerator/test_data/input/wms_group.yaml index 20e2937..6987909 100644 --- a/internal/controller/mapfilegenerator/test_data/input/wms_group.yaml +++ b/internal/controller/mapfilegenerator/test_data/input/wms_group.yaml @@ -171,7 +171,9 @@ spec: - Lake - Reservoir maxscaledenominator: "50000" - minscaledenominator: "1" + minscaledenominator: "2" + filterColumn: "gml_id" + filterValue: "1" name: HY.PhysicalWaters.Waterbodies styles: - name: HY.PhysicalWaters.Waterbodies.Default diff --git a/internal/controller/mapfilegenerator/types.go b/internal/controller/mapfilegenerator/types.go index ccc02e0..18e9c30 100644 --- a/internal/controller/mapfilegenerator/types.go +++ b/internal/controller/mapfilegenerator/types.go @@ -66,8 +66,8 @@ type BaseLayer struct { Postgis *bool `json:"postgis,omitempty"` MinScale *string `json:"minscale,omitempty"` MaxScale *string `json:"maxscale,omitempty"` - FilterColumn *string `json:"filter_column,omitempty"` - FilterValue *string `json:"filter_value,omitempty"` + FilterColumn *string `json:"filtercolumn,omitempty"` + FilterValue *string `json:"filtervalue,omitempty"` TifPath *string `json:"tif_path,omitempty"` Resample *string `json:"resample,omitempty"` OversampleRatio *string `json:"oversample_ratio,omitempty"` From 4e9af51a8d72bdcf02b6fba5d4034f4f888c216a Mon Sep 17 00:00:00 2001 From: robbert Date: Thu, 20 Aug 2026 13:09:19 +0200 Subject: [PATCH 3/5] fix linting --- api/v3/wms_types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v3/wms_types.go b/api/v3/wms_types.go index 4b368b3..c0fb8be 100644 --- a/api/v3/wms_types.go +++ b/api/v3/wms_types.go @@ -244,10 +244,10 @@ type Layer struct { // +kubebuilder:validation:Pattern:=`^[1-9][0-9]*(.[0-9]+)?$` MaxScaleDenominator *string `json:"maxscaledenominator,omitempty"` - //The column where the data needs te get filtered + // The column where the data needs te get filtered FilterColumn *string `json:"filterColumn,omitempty"` - //The value where the data needs to get filtered + // The value where the data needs to get filtered FilterValue *string `json:"filterValue,omitempty"` // List of styles used by the layer From e191194fd956f7866c447e9e1a08fd903acfbc6e Mon Sep 17 00:00:00 2001 From: robbert Date: Mon, 24 Aug 2026 08:47:25 +0200 Subject: [PATCH 4/5] git comments --- api/v3/wms_types.go | 2 +- config/crd/bases/pdok.nl_wms.yaml | 6 +++--- internal/controller/mapfilegenerator/types.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/v3/wms_types.go b/api/v3/wms_types.go index c0fb8be..3b19f20 100644 --- a/api/v3/wms_types.go +++ b/api/v3/wms_types.go @@ -244,7 +244,7 @@ type Layer struct { // +kubebuilder:validation:Pattern:=`^[1-9][0-9]*(.[0-9]+)?$` MaxScaleDenominator *string `json:"maxscaledenominator,omitempty"` - // The column where the data needs te get filtered + // The column where the data needs to get filtered FilterColumn *string `json:"filterColumn,omitempty"` // The value where the data needs to get filtered diff --git a/config/crd/bases/pdok.nl_wms.yaml b/config/crd/bases/pdok.nl_wms.yaml index 563ae9d..2d08b00 100644 --- a/config/crd/bases/pdok.nl_wms.yaml +++ b/config/crd/bases/pdok.nl_wms.yaml @@ -912,7 +912,7 @@ spec: - message: metadataUrl should have exactly 1 of csw or custom rule: (has(self.csw) || has(self.custom)) && !(has(self.csw) && has(self.custom)) filterColumn: - description: The column where the data needs te get filtered + description: The column where the data needs to get filtered type: string filterValue: description: The value where the data needs to get filtered @@ -1127,7 +1127,7 @@ spec: - message: metadataUrl should have exactly 1 of csw or custom rule: (has(self.csw) || has(self.custom)) && !(has(self.csw) && has(self.custom)) filterColumn: - description: The column where the data needs te get filtered + description: The column where the data needs to get filtered type: string filterValue: description: The value where the data needs to get filtered @@ -1345,7 +1345,7 @@ spec: - message: metadataUrl should have exactly 1 of csw or custom rule: (has(self.csw) || has(self.custom)) && !(has(self.csw) && has(self.custom)) filterColumn: - description: The column where the data needs te get filtered + description: The column where the data needs to get filtered type: string filterValue: description: The value where the data needs to get filtered diff --git a/internal/controller/mapfilegenerator/types.go b/internal/controller/mapfilegenerator/types.go index 18e9c30..ccc02e0 100644 --- a/internal/controller/mapfilegenerator/types.go +++ b/internal/controller/mapfilegenerator/types.go @@ -66,8 +66,8 @@ type BaseLayer struct { Postgis *bool `json:"postgis,omitempty"` MinScale *string `json:"minscale,omitempty"` MaxScale *string `json:"maxscale,omitempty"` - FilterColumn *string `json:"filtercolumn,omitempty"` - FilterValue *string `json:"filtervalue,omitempty"` + FilterColumn *string `json:"filter_column,omitempty"` + FilterValue *string `json:"filter_value,omitempty"` TifPath *string `json:"tif_path,omitempty"` Resample *string `json:"resample,omitempty"` OversampleRatio *string `json:"oversample_ratio,omitempty"` From 6a9b1329629016bbfda165c082b15167e2978164 Mon Sep 17 00:00:00 2001 From: robbert Date: Mon, 24 Aug 2026 08:53:43 +0200 Subject: [PATCH 5/5] fix test --- .../mapfilegenerator/test_data/input/wms_group.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controller/mapfilegenerator/test_data/input/wms_group.yaml b/internal/controller/mapfilegenerator/test_data/input/wms_group.yaml index 6987909..df69805 100644 --- a/internal/controller/mapfilegenerator/test_data/input/wms_group.yaml +++ b/internal/controller/mapfilegenerator/test_data/input/wms_group.yaml @@ -172,8 +172,8 @@ spec: - Reservoir maxscaledenominator: "50000" minscaledenominator: "2" - filterColumn: "gml_id" - filterValue: "1" + filter_column: "gml_id" + filter_value: "1" name: HY.PhysicalWaters.Waterbodies styles: - name: HY.PhysicalWaters.Waterbodies.Default