Skip to content

Commit 932a15d

Browse files
author
Jelle Dijkstra
committed
Default extent
1 parent 27634f3 commit 932a15d

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

api/v2beta1/wfs_conversion.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,19 @@ func (src *WFS) ConvertTo(dstRaw conversion.Hub) error {
8484
}
8585
}
8686

87-
if src.Spec.Service.Extent != nil {
88-
service.Bbox = pdoknlv3.Bbox{
87+
if src.Spec.Service.Extent != nil && *src.Spec.Service.Extent != "" {
88+
service.Bbox = &pdoknlv3.Bbox{
8989
DefaultCRS: sharedModel.ExtentToBBox(*src.Spec.Service.Extent),
9090
}
91+
} else {
92+
service.Bbox = &pdoknlv3.Bbox{
93+
DefaultCRS: sharedModel.BBox{
94+
MinX: "-25000",
95+
MaxX: "280000",
96+
MinY: "250000",
97+
MaxY: "860000",
98+
},
99+
}
91100
}
92101

93102
// TODO - where to place the MetadataIdentifier and FeatureTypes[0].SourceMetadataIdentifier if the service is not inspire?
@@ -129,7 +138,6 @@ func convertV2FeatureTypeToV3(src FeatureType) pdoknlv3.FeatureType {
129138
if src.Extent != nil {
130139
featureTypeV3.Bbox = &pdoknlv3.FeatureBbox{
131140
DefaultCRS: sharedModel.ExtentToBBox(*src.Extent),
132-
// TODO do we need Wgs84?
133141
}
134142
}
135143

@@ -225,7 +233,6 @@ func (dst *WFS) ConvertFrom(srcRaw conversion.Hub) error {
225233
Abstract: src.Spec.Service.Abstract,
226234
Keywords: src.Spec.Service.Keywords,
227235
AccessConstraints: src.Spec.Service.AccessConstraints,
228-
Extent: Pointer(src.Spec.Service.Bbox.DefaultCRS.ToExtent()),
229236
DataEPSG: src.Spec.Service.DefaultCrs,
230237
Maxfeatures: src.Spec.Service.CountDefault,
231238
Authority: Authority{
@@ -234,6 +241,12 @@ func (dst *WFS) ConvertFrom(srcRaw conversion.Hub) error {
234241
},
235242
}
236243

244+
if src.Spec.Service.Bbox != nil {
245+
service.Extent = Pointer(src.Spec.Service.Bbox.DefaultCRS.ToExtent())
246+
} else {
247+
service.Extent = Pointer("-25000 250000 280000 860000")
248+
}
249+
237250
if src.Spec.Service.Mapfile != nil {
238251
service.Mapfile = &Mapfile{
239252
ConfigMapKeyRef: src.Spec.Service.Mapfile.ConfigMapKeyRef,

api/v3/wfs_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type Service struct {
9090
AccessConstraints string `json:"accessConstraints"`
9191
DefaultCrs string `json:"defaultCrs"`
9292
OtherCrs []string `json:"otherCrs,omitempty"`
93-
Bbox Bbox `json:"bbox"`
93+
Bbox *Bbox `json:"bbox"`
9494
// CountDefault -> wfs_maxfeatures in mapfile
9595
CountDefault *string `json:"countDefault"`
9696
FeatureTypes []FeatureType `json:"featureTypes"`

api/v3/zz_generated.deepcopy.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ kind: Kustomization
55
images:
66
- name: controller
77
newName: local-registry:5000/wfs-operator
8-
newTag: v3.0.18
8+
newTag: v3.0.25

0 commit comments

Comments
 (0)