From 188bc392fd7b21d6e2fd06262c22d64c9101d70f Mon Sep 17 00:00:00 2001 From: Blottiere Paul Date: Tue, 30 Jul 2024 17:41:02 +0200 Subject: [PATCH] Add schema support for histogram processing --- docs/src/SUMMARY.md | 11 +++++++---- docs/src/sandbox/raster/README.md | 1 + docs/src/sandbox/raster/processing.md | 17 +++++++++++++++++ docs/src/sandbox/vector/README.md | 1 + qsa-api/qsa_api/api/processing.py | 3 ++- 5 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 docs/src/sandbox/raster/README.md create mode 100644 docs/src/sandbox/raster/processing.md create mode 100644 docs/src/sandbox/vector/README.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index c8571ef9..55890579 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -18,9 +18,12 @@ - [Sandbox](sandbox/README.md) - [Introspection](sandbox/inspect.md) - [Projects](sandbox/projects.md) - - [Vector layers](sandbox/vector/layers.md) - - [Vector styles](sandbox/vector/styles.md) - - [Raster layers](sandbox/raster/layers.md) - - [Raster styles](sandbox/raster/styles.md) + - [Vector](sandbox/vector/README.md) + - [Layers](sandbox/vector/layers.md) + - [Styles](sandbox/vector/styles.md) + - [Raster](sandbox/raster/README.md) + - [Layers](sandbox/raster/layers.md) + - [Styles](sandbox/raster/styles.md) + - [Processing](sandbox/raster/processing.md) - [Developers](DEVELOPERS.md) - [Funders](FUNDERS.md) diff --git a/docs/src/sandbox/raster/README.md b/docs/src/sandbox/raster/README.md new file mode 100644 index 00000000..be7cb953 --- /dev/null +++ b/docs/src/sandbox/raster/README.md @@ -0,0 +1 @@ +# Raster diff --git a/docs/src/sandbox/raster/processing.md b/docs/src/sandbox/raster/processing.md new file mode 100644 index 00000000..48edd471 --- /dev/null +++ b/docs/src/sandbox/raster/processing.md @@ -0,0 +1,17 @@ +# Sandbox : raster processing + + +### Histogram + +To get an histogram for a specific raster layer: + +```` shell +$ curl "http://localhost:5000/api/processing/raster/histogram/my_project/dem?schema=my_schema" \ + -X POST \ + -H 'Content-Type: application/json' \ + -d '{ + "min": 0, + "count": 100 + }' +true +```` diff --git a/docs/src/sandbox/vector/README.md b/docs/src/sandbox/vector/README.md new file mode 100644 index 00000000..a2303c11 --- /dev/null +++ b/docs/src/sandbox/vector/README.md @@ -0,0 +1 @@ +# Vector diff --git a/qsa-api/qsa_api/api/processing.py b/qsa-api/qsa_api/api/processing.py index 9a0d5fbd..0686052c 100644 --- a/qsa-api/qsa_api/api/processing.py +++ b/qsa-api/qsa_api/api/processing.py @@ -89,7 +89,8 @@ def raster_histogram(project: str, layer: str): if "count" in data: count = data["count"] - proj = QSAProject(project) + psql_schema = request.args.get("schema", default="public") + proj = QSAProject(project, psql_schema) if proj.exists(): layer_infos = proj.layer(layer) if layer_infos: