|
1 | 1 | package mapfilegenerator |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "fmt" |
5 | 4 | "strconv" |
6 | 5 | "strings" |
7 | 6 |
|
@@ -145,22 +144,15 @@ func getGeopackagePath(data pdoknlv3.Data) *string { |
145 | 144 | return smoothoperatorutils.Pointer(geopackagePath + "/" + blobName) |
146 | 145 | } |
147 | 146 |
|
148 | | -func MapWMSToMapfileGeneratorInput(wms *pdoknlv3.WMS, _ *smoothoperatorv1.OwnerInfo) (WMSInput, error) { |
| 147 | +func MapWMSToMapfileGeneratorInput(wms *pdoknlv3.WMS, ownerInfo *smoothoperatorv1.OwnerInfo) (WMSInput, error) { |
149 | 148 | service := wms.Spec.Service |
150 | 149 |
|
151 | | - datasetOwner := "" |
152 | | - if service.Layer.Authority != nil { |
153 | | - datasetOwner = service.Layer.Authority.Name |
154 | | - } else { |
155 | | - datasetOwner = wms.ObjectMeta.Labels["dataset-owner"] |
156 | | - } |
157 | | - |
158 | | - datasetName := wms.ObjectMeta.Labels["dataset"] |
159 | | - protocol := "http" |
160 | 150 | authority := wms.GetAuthority() |
161 | 151 | authorityURL := "" |
| 152 | + datasetOwner := "" |
162 | 153 | if authority != nil { |
163 | 154 | authorityURL = authority.URL |
| 155 | + datasetOwner = authority.Name |
164 | 156 | } |
165 | 157 |
|
166 | 158 | box := service.GetBoundingBox() |
@@ -198,8 +190,8 @@ func MapWMSToMapfileGeneratorInput(wms *pdoknlv3.WMS, _ *smoothoperatorv1.OwnerI |
198 | 190 | Abstract: service.Abstract, |
199 | 191 | Keywords: strings.Join(wms.Spec.Service.KeywordsIncludingInspireKeyword(), ","), |
200 | 192 | Extent: extent, |
201 | | - NamespacePrefix: datasetName, |
202 | | - NamespaceURI: fmt.Sprintf("%s://%s.geonovum.nl", protocol, datasetName), |
| 193 | + NamespacePrefix: wms.Spec.Service.Prefix, |
| 194 | + NamespaceURI: mapperutils.GetNamespaceURI(wms.Spec.Service.Prefix, ownerInfo), |
203 | 195 | OnlineResource: pdoknlv3.GetHost(true), |
204 | 196 | Path: "/" + pdoknlv3.GetBaseURLPath(wms), |
205 | 197 | MetadataID: metadataID, |
|
0 commit comments