Skip to content

Commit

Permalink
add new properties in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rrequero committed Feb 6, 2024
1 parent 31debad commit 0bb0585
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gfw/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ type DatasetConfiguration struct {
Max float64 `json:"max"`
Scale float64 `json:"scale"`
Offset float64 `json:"offset"`
TileScale float64 `json:"tileScale"`
TileOffset float64 `json:"tileOffset"`
IDProperty string `json:"idProperty"`
ValueProperties []string `json:"valueProperties"`
InsightSources []InsightSources `json:"insightSources,omitempty"`
Expand Down
12 changes: 12 additions & 0 deletions gfw/resource_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,14 @@ func resourceDataset() *schema.Resource {
Type: schema.TypeFloat,
Optional: true,
},
"tile_scale": {
Type: schema.TypeFloat,
Optional: true,
},
"tile_offset": {
Type: schema.TypeFloat,
Optional: true,
},
"id_property": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -635,8 +643,10 @@ func schemaToDatasetConfiguration(schema map[string]interface{}) api.DatasetConf
Longitude: schema["longitude"].(string),
Timestamp: schema["timestamp"].(string),
Offset: schema["offset"].(float64),
TileOffset: schema["tile_offset"].(float64),
IDProperty: schema["id_property"].(string),
Scale: schema["scale"].(float64),
TileScale: schema["tile_scale"].(float64),
Min: schema["min"].(float64),
Max: schema["max"].(float64),
Band: schema["band"].(string),
Expand Down Expand Up @@ -849,7 +859,9 @@ func flattenDatasetConfiguration(config api.DatasetConfiguration) interface{} {
a["min"] = config.Min
a["max"] = config.Max
a["offset"] = config.Offset
a["tile_offset"] = config.TileOffset
a["scale"] = config.Scale
a["tile_scale"] = config.Scale
a["value_properties"] = config.ValueProperties
a["id_property"] = config.IDProperty

Expand Down

0 comments on commit 0bb0585

Please sign in to comment.