Skip to content

Commit 9432f55

Browse files
author
Jelle Dijkstra
committed
Diff fixes
1 parent f7acb15 commit 9432f55

File tree

3 files changed

+67
-63
lines changed

3 files changed

+67
-63
lines changed

internal/controller/capabilitiesgenerator/mapper.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,11 @@ func createCRSFromEpsgString(epsgString string) (*wfs200.CRS, error) {
194194
return nil, fmt.Errorf("could not determine EPSG code from EPSG string %s", epsgCodeString)
195195
}
196196

197+
epsgUrn := "urn:ogc:def:crs:EPSG:"
198+
197199
return &wfs200.CRS{
198-
Code: epsgCode,
200+
Namespace: epsgUrn,
201+
Code: epsgCode,
199202
}, nil
200203
}
201204

internal/controller/mapfilegenerator/mapper.go

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,20 @@ func MapWFSToMapfileGeneratorInput(wfs *pdoknlv3.WFS, ownerInfo *smoothoperatorv
4343

4444
input := WFSInput{
4545
BaseServiceInput: BaseServiceInput{
46-
Title: mapperutils.EscapeQuotes(wfs.Spec.Service.Title),
47-
Abstract: mapperutils.EscapeQuotes(wfs.Spec.Service.Abstract),
48-
Keywords: strings.Join(wfs.Spec.Service.KeywordsIncludingInspireKeyword(), ","),
49-
OnlineResource: wfs.URL().Scheme + "://" + wfs.URL().Host,
50-
Path: wfs.URL().Path,
51-
MetadataID: metadataID,
52-
Extent: extent,
53-
NamespacePrefix: wfs.Spec.Service.Prefix,
54-
NamespaceURI: mapperutils.GetNamespaceURI(wfs.Spec.Service.Prefix, ownerInfo),
55-
AutomaticCasing: wfs.Options().AutomaticCasing,
56-
DataEPSG: wfs.Spec.Service.DefaultCrs,
57-
EPSGList: append([]string{wfs.Spec.Service.DefaultCrs}, wfs.Spec.Service.OtherCrs...),
58-
DebugLevel: mapserverDebugLevel,
46+
Title: mapperutils.EscapeQuotes(wfs.Spec.Service.Title),
47+
Abstract: mapperutils.EscapeQuotes(wfs.Spec.Service.Abstract),
48+
Keywords: strings.Join(wfs.Spec.Service.KeywordsIncludingInspireKeyword(), ","),
49+
OnlineResource: wfs.URL().Scheme + "://" + wfs.URL().Host,
50+
Path: wfs.URL().Path,
51+
MetadataID: metadataID,
52+
Extent: extent,
53+
NamespacePrefix: wfs.Spec.Service.Prefix,
54+
NamespaceURI: mapperutils.GetNamespaceURI(wfs.Spec.Service.Prefix, ownerInfo),
55+
AutomaticCasing: wfs.Options().AutomaticCasing,
56+
DataEPSG: wfs.Spec.Service.DefaultCrs,
57+
EPSGList: append([]string{wfs.Spec.Service.DefaultCrs}, wfs.Spec.Service.OtherCrs...),
58+
DebugLevel: mapserverDebugLevel,
59+
AccessConstraints: wfs.Spec.Service.AccessConstraints.String(),
5960
},
6061
MaxFeatures: strconv.Itoa(smoothoperatorutils.PointerVal(wfs.Spec.Service.CountDefault, defaultMaxFeatures)),
6162
Layers: getWFSLayers(wfs.Spec.Service),
@@ -169,29 +170,29 @@ func MapWMSToMapfileGeneratorInput(wms *pdoknlv3.WMS, ownerInfo *smoothoperatorv
169170

170171
result := WMSInput{
171172
BaseServiceInput: BaseServiceInput{
172-
Title: service.Title,
173-
Abstract: service.Abstract,
174-
Keywords: strings.Join(wms.Spec.Service.KeywordsIncludingInspireKeyword(), ","),
175-
Extent: extent,
176-
NamespacePrefix: wms.Spec.Service.Prefix,
177-
NamespaceURI: mapperutils.GetNamespaceURI(wms.Spec.Service.Prefix, ownerInfo),
178-
OnlineResource: wms.URL().Scheme + "://" + wms.URL().Host,
179-
Path: wms.URL().Path,
180-
MetadataID: metadataID,
181-
DatasetOwner: &datasetOwner,
182-
AuthorityURL: &authorityURL,
183-
AutomaticCasing: wms.Options().AutomaticCasing,
184-
DataEPSG: service.DataEPSG,
173+
Title: service.Title,
174+
Abstract: service.Abstract,
175+
Keywords: strings.Join(wms.Spec.Service.KeywordsIncludingInspireKeyword(), ","),
176+
Extent: extent,
177+
NamespacePrefix: wms.Spec.Service.Prefix,
178+
NamespaceURI: mapperutils.GetNamespaceURI(wms.Spec.Service.Prefix, ownerInfo),
179+
OnlineResource: wms.URL().Scheme + "://" + wms.URL().Host,
180+
Path: wms.URL().Path,
181+
MetadataID: metadataID,
182+
DatasetOwner: &datasetOwner,
183+
AuthorityURL: &authorityURL,
184+
AutomaticCasing: wms.Options().AutomaticCasing,
185+
DataEPSG: service.DataEPSG,
186+
AccessConstraints: service.AccessConstraints.String(),
185187
},
186-
AccessConstraints: service.AccessConstraints.String(),
187-
Layers: []WMSLayer{},
188-
GroupLayers: []GroupLayer{},
189-
Symbols: getSymbols(wms),
190-
Fonts: fonts,
191-
OutputFormatJpg: "jpg",
192-
OutputFormatPng: "png",
193-
Templates: constants.HTMLTemplatesPath,
194-
MaxSize: maxSize,
188+
Layers: []WMSLayer{},
189+
GroupLayers: []GroupLayer{},
190+
Symbols: getSymbols(wms),
191+
Fonts: fonts,
192+
OutputFormatJpg: "jpg",
193+
OutputFormatPng: "png",
194+
Templates: constants.HTMLTemplatesPath,
195+
MaxSize: maxSize,
195196
}
196197

197198
if wms.Spec.Service.Layer.Name != nil {

internal/controller/mapfilegenerator/types.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@ import (
1010

1111
//nolint:tagliatelle
1212
type BaseServiceInput struct {
13-
Title string `json:"service_title"`
14-
Abstract string `json:"service_abstract"`
15-
Keywords string `json:"service_keywords"`
16-
Extent string `json:"service_extent"`
17-
NamespacePrefix string `json:"service_namespace_prefix"`
18-
NamespaceURI string `json:"service_namespace_uri"`
19-
OnlineResource string `json:"service_onlineresource"`
20-
Path string `json:"service_path"`
21-
MetadataID string `json:"service_metadata_id"`
22-
DatasetOwner *string `json:"dataset_owner,omitempty"`
23-
AuthorityURL *string `json:"authority_url,omitempty"`
24-
AutomaticCasing bool `json:"automatic_casing"`
25-
DataEPSG string `json:"data_epsg"`
26-
EPSGList []string `json:"epsg_list"`
27-
DebugLevel int `json:"service_debug_level,omitempty"`
13+
Title string `json:"service_title"`
14+
Abstract string `json:"service_abstract"`
15+
Keywords string `json:"service_keywords"`
16+
Extent string `json:"service_extent"`
17+
NamespacePrefix string `json:"service_namespace_prefix"`
18+
NamespaceURI string `json:"service_namespace_uri"`
19+
OnlineResource string `json:"service_onlineresource"`
20+
Path string `json:"service_path"`
21+
MetadataID string `json:"service_metadata_id"`
22+
DatasetOwner *string `json:"dataset_owner,omitempty"`
23+
AuthorityURL *string `json:"authority_url,omitempty"`
24+
AutomaticCasing bool `json:"automatic_casing"`
25+
DataEPSG string `json:"data_epsg"`
26+
EPSGList []string `json:"epsg_list"`
27+
DebugLevel int `json:"service_debug_level,omitempty"`
28+
AccessConstraints string `json:"service_accessconstraints"`
2829
}
2930

3031
//nolint:tagliatelle
@@ -37,18 +38,17 @@ type WFSInput struct {
3738
//nolint:tagliatelle
3839
type WMSInput struct {
3940
BaseServiceInput
40-
AccessConstraints string `json:"service_accessconstraints"`
41-
Layers []WMSLayer `json:"layers"`
42-
GroupLayers []GroupLayer `json:"group_layers"`
43-
Symbols []string `json:"symbols"`
44-
Fonts *string `json:"fonts,omitempty"`
45-
Templates string `json:"templates,omitempty"`
46-
OutputFormatJpg string `json:"outputformat_jpg"`
47-
OutputFormatPng string `json:"outputformat_png8"`
48-
MaxSize string `json:"maxSize"`
49-
TopLevelName string `json:"top_level_name,omitempty"`
50-
Resolution string `json:"resolution,omitempty"`
51-
DefResolution string `json:"defresolution,omitempty"`
41+
Layers []WMSLayer `json:"layers"`
42+
GroupLayers []GroupLayer `json:"group_layers"`
43+
Symbols []string `json:"symbols"`
44+
Fonts *string `json:"fonts,omitempty"`
45+
Templates string `json:"templates,omitempty"`
46+
OutputFormatJpg string `json:"outputformat_jpg"`
47+
OutputFormatPng string `json:"outputformat_png8"`
48+
MaxSize string `json:"maxSize"`
49+
TopLevelName string `json:"top_level_name,omitempty"`
50+
Resolution string `json:"resolution,omitempty"`
51+
DefResolution string `json:"defresolution,omitempty"`
5252
}
5353

5454
//nolint:tagliatelle

0 commit comments

Comments
 (0)