Skip to content

Commit 7fbe2a3

Browse files
author
Léon van der Kaap
committed
Added oversample ratio to tiff layer
1 parent a5478ca commit 7fbe2a3

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

api/v3/shared_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ type TIF struct {
251251
// +kubebuilder:default=NEAREST
252252
Resample string `json:"resample,omitempty"`
253253

254+
// Controls the smoothing of the image on a certain point. Bigger value gives a smoother/better picture but
255+
// results in slower web responses, optional
256+
// +kubebuilder:validation:Pattern="^-?[0-9]+([.][0-9]*)?$"
257+
// +kubebuilder:default=2.5
258+
OversampleRatio string `json:"oversample_ratio,omitempty"`
259+
254260
// Sets the color index to treat as transparent for raster layers, optional, hex or rgb
255261
// +kubebuilder:validation:Pattern=`(#[0-9A-F]{6}([0-9A-F]{2})?)|([0-9]{1,3}\s[0-9]{1,3}\s[0-9]{1,3})`
256262
Offsite *string `json:"offsite,omitempty"`

internal/controller/mapfilegenerator/types.go

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,23 @@ type WMSInput struct {
5353

5454
//nolint:tagliatelle
5555
type BaseLayer struct {
56-
Name string `json:"name"`
57-
Title string `json:"title"`
58-
Abstract string `json:"abstract"`
59-
Keywords string `json:"keywords"`
60-
Extent string `json:"layer_extent"`
61-
MetadataID string `json:"dataset_metadata_id"`
62-
Columns []Column `json:"columns,omitempty"`
63-
GeometryType *string `json:"geometry_type,omitempty"`
64-
GeopackagePath *string `json:"gpkg_path,omitempty"`
65-
TableName *string `json:"tablename,omitempty"`
66-
Postgis *bool `json:"postgis,omitempty"`
67-
MinScale *string `json:"minscale,omitempty"`
68-
MaxScale *string `json:"maxscale,omitempty"`
69-
TifPath *string `json:"tif_path,omitempty"`
70-
Resample *string `json:"resample,omitempty"`
71-
LabelNoClip bool `json:"label_no_clip,omitempty"`
56+
Name string `json:"name"`
57+
Title string `json:"title"`
58+
Abstract string `json:"abstract"`
59+
Keywords string `json:"keywords"`
60+
Extent string `json:"layer_extent"`
61+
MetadataID string `json:"dataset_metadata_id"`
62+
Columns []Column `json:"columns,omitempty"`
63+
GeometryType *string `json:"geometry_type,omitempty"`
64+
GeopackagePath *string `json:"gpkg_path,omitempty"`
65+
TableName *string `json:"tablename,omitempty"`
66+
Postgis *bool `json:"postgis,omitempty"`
67+
MinScale *string `json:"minscale,omitempty"`
68+
MaxScale *string `json:"maxscale,omitempty"`
69+
TifPath *string `json:"tif_path,omitempty"`
70+
Resample *string `json:"resample,omitempty"`
71+
OversampleRatio *string `json:"oversample_ratio,omitempty"`
72+
LabelNoClip bool `json:"label_no_clip,omitempty"`
7273
}
7374

7475
type WFSLayer struct {
@@ -124,6 +125,7 @@ func SetDataFields[O pdoknlv3.WMSWFS](obj O, wmsLayer *WMSLayer, data pdoknlv3.D
124125
wmsLayer.BaseLayer.TifPath = smoothoperatorutils.Pointer(path.Join("/vsiaz", reReplace.ReplaceAllString(tif.BlobKey, "")))
125126
}
126127
wmsLayer.BaseLayer.Resample = &tif.Resample
128+
wmsLayer.BaseLayer.OversampleRatio = &tif.OversampleRatio
127129
wmsLayer.Offsite = smoothoperatorutils.PointerVal(tif.Offsite, "")
128130
wmsLayer.GetFeatureInfoIncludesClass = &tif.GetFeatureInfoIncludesClass
129131
case data.Postgis != nil:

0 commit comments

Comments
 (0)