Skip to content

Commit

Permalink
Fix layer info with raster layer
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Apr 8, 2024
1 parent 1e24908 commit a4167b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions docs/src/sandbox/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ $ curl "http://localhost:5000/api/projects/my_project/layers" \
-d '{
"crs": 4326,
"datasource":"/data.gpkg|layername=polygons",
"name":"polygons"
"name":"polygons",
"type":"vector"
}'
true
````
Expand All @@ -28,7 +29,8 @@ $ curl "http://localhost:5000/api/projects/my_project/layers" \
-d '{
"crs": 4326,
"datasource":"/data.gpkg|layername=lines",
"name":"lines"
"name":"lines",
"type":"vector"
}'
true
````
Expand Down
5 changes: 4 additions & 1 deletion qsa-api/qsa_api/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ def layer(self, name: str) -> dict:
infos["valid"] = layer.isValid()
infos["name"] = layer.name()
infos["type"] = layer.type().name.lower()
infos["geometry"] = QgsWkbTypes.displayString(layer.wkbType())

if layer.type() == Qgis.LayerType.Vector:
infos["geometry"] = QgsWkbTypes.displayString(layer.wkbType())

infos["source"] = layer.source()
infos["crs"] = layer.crs().authid()
infos["current_style"] = layer.styleManager().currentStyle()
Expand Down

0 comments on commit a4167b0

Please sign in to comment.