@@ -65,15 +65,16 @@ type WMSService struct {
6565 OwnerInfoRef string `json:"ownerInfoRef"`
6666 Fees * string `json:"fees,omitempty"`
6767 // +kubebuilder:default="https://creativecommons.org/publicdomain/zero/1.0/deed.nl"
68- AccessConstraints string `json:"accessConstraints"`
69- MaxSize * int32 `json:"maxSize,omitempty"`
70- Inspire * Inspire `json:"inspire,omitempty"`
71- DataEPSG string `json:"dataEPSG"`
72- Resolution * int32 `json:"resolution,omitempty"`
73- DefResolution * int32 `json:"defResolution,omitempty"`
74- StylingAssets * StylingAssets `json:"stylingAssets,omitempty"`
75- Mapfile * Mapfile `json:"mapfile,omitempty"`
76- Layer Layer `json:"layer"`
68+ AccessConstraints string `json:"accessConstraints"`
69+ MaxSize * int32 `json:"maxSize,omitempty"`
70+ Inspire * Inspire `json:"inspire,omitempty"`
71+ //nolint:tagliatelle
72+ DataEPSG string `json:"dataEPSG"`
73+ Resolution * int32 `json:"resolution,omitempty"`
74+ DefResolution * int32 `json:"defResolution,omitempty"`
75+ StylingAssets * StylingAssets `json:"stylingAssets,omitempty"`
76+ Mapfile * Mapfile `json:"mapfile,omitempty"`
77+ Layer Layer `json:"layer"`
7778}
7879
7980type StylingAssets struct {
@@ -178,7 +179,7 @@ func (wmsService *WMSService) GetBoundingBox() WMSBoundingBox {
178179
179180 allLayers := wmsService .GetAllLayers ()
180181 for _ , layer := range allLayers {
181- if layer . BoundingBoxes != nil && len (layer .BoundingBoxes ) > 0 {
182+ if len (layer .BoundingBoxes ) > 0 {
182183 for _ , bbox := range wmsService .Layer .BoundingBoxes {
183184 if boundingBox == nil {
184185 boundingBox = & bbox
@@ -191,18 +192,17 @@ func (wmsService *WMSService) GetBoundingBox() WMSBoundingBox {
191192
192193 if boundingBox != nil {
193194 return * boundingBox
194- } else {
195- return WMSBoundingBox {
196- CRS : "EPSG:28992" ,
197- BBox : shared_model.BBox {
198- MinX : "-25000" ,
199- MaxX : "280000" ,
200- MinY : "250000" ,
201- MaxY : "860000" ,
202- },
203- }
204195 }
205196
197+ return WMSBoundingBox {
198+ CRS : "EPSG:28992" ,
199+ BBox : shared_model.BBox {
200+ MinX : "-25000" ,
201+ MaxX : "280000" ,
202+ MinY : "250000" ,
203+ MaxY : "860000" ,
204+ },
205+ }
206206}
207207
208208type AnnotatedLayer struct {
@@ -281,11 +281,11 @@ func (layer *Layer) GetParent(candidateLayer *Layer) *Layer {
281281 for _ , childLayer := range * candidateLayer .Layers {
282282 if childLayer .Name == layer .Name {
283283 return candidateLayer
284- } else {
285- parent := layer . GetParent ( & childLayer )
286- if parent != nil {
287- return parent
288- }
284+ }
285+
286+ parent := layer . GetParent ( & childLayer )
287+ if parent != nil {
288+ return parent
289289 }
290290 }
291291 return nil
@@ -447,3 +447,25 @@ func (wms *WMS) ID() string {
447447func (wms * WMS ) URLPath () string {
448448 return wms .Spec .Service .URL
449449}
450+
451+ func (wms * WMS ) GeoPackages () []* Gpkg {
452+ gpkgs := make ([]* Gpkg , 0 )
453+
454+ if wms .Spec .Service .Layer .Layers != nil {
455+ for _ , layer := range * wms .Spec .Service .Layer .Layers {
456+ if layer .Data != nil {
457+ if layer .Data .Gpkg != nil {
458+ gpkgs = append (gpkgs , layer .Data .Gpkg )
459+ }
460+ } else if layer .Layers != nil {
461+ for _ , childLayer := range * layer .Layers {
462+ if childLayer .Data != nil && childLayer .Data .Gpkg != nil {
463+ gpkgs = append (gpkgs , childLayer .Data .Gpkg )
464+ }
465+ }
466+ }
467+ }
468+ }
469+
470+ return gpkgs
471+ }
0 commit comments