geoclimate icon indicating copy to clipboard operation
geoclimate copied to clipboard

[feature] ability to pass layer and optional filter as parameters ?

Open simogeo opened this issue 3 years ago • 1 comments

Hi all, I'm starting playing with geoclimate and having some ideas to make its use clearer, more flexible and generic for end-user. You probably thought about it already ... and have made some choices. Anyway, this is my point.

I've re-structured the json config file and as you will see I have specified the workflow inside the config file itself to centralize configuration options.

A commune could be seen as a restrictive area. Why not using another object, such as a user defined polygon as input ? We could pass a layer as parameter to define the wanted area, as follow - handling several vector format :

{
  "workflow": "bdtopo_v2.2",
  "input": {
    "data-path": "/home/mydirectory/Geoclimate/BD_TOPO_v2/",
    "target": {
      "layer": "my-perimeter.shp|geojson|...."
    }
  }
}

We could pass 2 optional parameters to filter on attributes, see filter-field and filter-value. In that case, to get the same result as on wiki page :

{
  "workflow": "bdtopo_v2.2",
  "input": {
    "data-path": "/home/mydirectory/Geoclimate/BD_TOPO_v2/",
    "target": {
      "layer": "COMMUNE.SHP",
      "filter-field": "INSEE_CODE",
      "filter-value": [
        "12174"
      ]
    }
  }
}

Another example using EPCI as a default object ... (but it could be anything) :

{
  "workflow": "bdtopo_v2.2",
  "input": {
    "data-path": "/home/mydirectory/Geoclimate/BD_TOPO_v2/",
    "target": {
      "layer": "EPCI.SHP",
      "filter-field": "CODE_EPCI",
      "filter-value": [
        "XXXXXXXX"
      ]
    }
  }
}

Using this syntax, It will also probably be possible to fetch a diversity of objects from OSM. From this example : https://www.openstreetmap.org/relation/1354569

{
  "workflow": "osm",
  "input": {
    "target": {
      "layer": "boundary",
      "filter-field": "ref:FR:SIREN",
      "filter-value": [
        "245600440"
      ]
    }
  }
}

Based on bbox again :

{
  "workflow": "osm",
  "input": {
    "target": {
      "bbox": [46.257330,4.870033,46.269970,4.905224]
    }
  }
}

These are just ideas, and I'm not able to assess all consequences ! Feel free to implement, or not ;-))

simogeo avatar Feb 22 '22 11:02 simogeo

We propose to use a customized script to do this.

ebocher avatar Jan 08 '24 13:01 ebocher