boku-ilen / landscapelab

Geodata-driven Landscape Visualization built with Godot and Geodot
https://landscapelab.boku.ac.at/
Other
39 stars 12 forks source link

Relocate the Configuration from `.gpkg` to a LandscapeLab specific format `.ll` #303

Closed MathiasBaumgartinger closed 1 year ago

MathiasBaumgartinger commented 1 year ago

After careful consideration, we came to the conclusion that the configuration inside the geopackage is a limitation and frustrating to work with. Furthermore, it feels inconsistent when loading geolayers from multiple gpkgs and only one has the configuration in it. This will also ease the further development (e.g. saving a configuration).

The file will be ended with .ll and represent a json format. An exemplary terrain configuration could look like the following:

{
    LayerCompositions: {
        Terrain: {
            type: "RealisticTerrain",
            height: "path/to/gpgk:layer_name",
            ortho: "path/to/gpgk:layer_name""
        }
    }
}
kb173 commented 1 year ago

Full basic config for a GeoPackage:

{
    "LayerCompositions": {
        "Terrain": {
            "type": "RealisticTerrain",
            "dhm": "./LL_Wolkersdorf.gpkg:dhm",
            "ortho": "./LL_Wolkersdorf.gpkg:ortho",
            "ndom": "./LL_Wolkersdorf.gpkg:ndom",
            "landuse": "./LL_Wolkersdorf.gpkg:landuse"
        },
        "Buildings": {
            "type": "Buildings",
            "polygons": "./LL_Wolkersdorf.gpkg:buildings",
            "dhm": "./LL_Wolkersdorf.gpkg:dhm",
            "height_attribute_name": "ndom_mean",
            "height_stdev_attribute_name": "ndom_stdev",
            "slope_attribute_name": "slope_mean",
            "red_attribute_name": "r_median",
            "green_attribute_name": "g_median",
            "blue_attribute_name": "b_median"
        },
        "Vegetation": {
            "type": "Vegetation",
            "dhm": "./LL_Wolkersdorf.gpkg:dhm",
            "landuse": "./LL_Wolkersdorf.gpkg:landuse"
        },
        "Power Lines": {
            "type": "ConnectedObject",
            "dhm": "./LL_Wolkersdorf.gpkg:dhm",
            "lines": "./LL_Wolkersdorf.gpkg:power_lines",
            "selector_attribute_name": "power",
            "fallback_connector": "res://Objects/Power/LowVoltagePowerPole.tscn",
            "fallback_connection": "res://Objects/Connection/MetalSteelCableSmall.tscn",
            "connectors": {
                "minor_line": "res://Objects/Power/LowVoltagePowerPole.tscn",
                "line": "res://Objects/Power/HighVoltagePowerLine.tscn"
            },
            "connections": {
                "minor_line": "res://Objects/Connection/MetalSteelCableSmall.tscn",
                "line": "res://Objects/Connection/MetalSteelCableBig.tscn"
            }
        }
    },
    "Scenarios": {
        "Basic": {
            "layers": [
                "Terrain",
                "Buildings",
                "Vegetation",
                "Power Lines"
            ]
        }
    }
}
kb173 commented 1 year ago

Will be adapted like this for better readability and easier automated loading:

...
        "Terrain": {
            "type": "REALISTIC_TERRAIN",
            "layers": {
                "height_layer": "./LL_joglland.gpkg:dhm",
                "texture_layer": "./LL_joglland.gpkg:ortho",
                "surface_height_layer": "./LL_joglland.gpkg:ndom",
                "landuse_layer": "./LL_joglland.gpkg:landuse"
            }
        },
        "Buildings": {
            "type": "POLYGON",
            "layers": {
                "polygons": "./LL_joglland.gpkg:buildings",
                "dhm": "./LL_joglland.gpkg:dhm"
            },
            "attributes": {
                "height_attribute_name": "ndom_mean",
                "height_stdev_attribute_name": "ndom_stdev",
                "slope_attribute_name": "slope_mean",
                "red_attribute_name": "r_median",
                "green_attribute_name": "g_median",
                "blue_attribute_name": "b_median"
            }
        },
...