Skip to content

Commit

Permalink
Add MapExport chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Sep 15, 2024
1 parent 48a406c commit 414a1fe
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions qwc2.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ nav:
- Search: topics/Search.md
- Feature info: topics/FeatureInfo.md
- Printing: topics/Printing.md
- Map export: topics/MapExport.md
- Map info: topics/Mapinfo.md
- Editing: topics/Editing.md
- Snapping: topics/Snapping.md
Expand Down
59 changes: 59 additions & 0 deletions src/topics/MapExport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Map export

The [MapExport](../references/qwc2_plugins.md#mapexport) plugin allows exporting a selected portion of the map to a variety of formats, as supported by the QGIS Server, among which:

* Image formats (`image/png`, `image/jpeg`, `image/geotiff`, ...)
* DXF (`application/dxf`)
* GeoPDF (`application/pdf`)

See the [MapExport plugin reference](../references/qwc2_plugins.md#mapexport) for a list of configuration options.

In particular, the plugin supports specifying different export configurations for each format, i.e.:
```
{
"name": "MapExport",
"cfg": {
"formatConfiguration": {
"application/dxf": [
{"name": "default"},
{
"name": "Geobau",
"extraQuery": "LAYERS=dxfgeobau",
"formatOptions": "MODE:NOSYMBOLOGY"
}
],
"image/png": [
{"name": "default"},
{"name": "With baselayer", "baseLayer": "SWISSIMAGE"}
]
}
}
},
```

For each format, if multiple configurations are defined, a combobox will be displayed to choose an export configuration.

## Export to image formats
For image formats, it may be desired to override the background layer for the exported map. To this end, specify a `baseLayer` in the format configuration to the name of a background `printLayer`.

For GeoTIFF image export to become available, set up the `wms_geotiff_output` [QGIS Server plugin](https://github.com/qwc-services/qwc-qgis-server-plugins):

```yml
qwc-qgis-server:
image: docker.io/sourcepole/qwc-qgis-server:<TAG>
volumes:
- ./volumes/qgis-server-plugins/wms_geotiff_output:/usr/share/qgis/python/plugins/wms_geotiff_output:ro
...
```

# DXF export
To enable the DXF export format, the desired layers are marked as *Published* in the QGIS Project Properties &to; QGIS Server &to; WFS/OAPIF.

You can configure the DXF export by passing supported [`FORMAT_OPTIONS`](https://docs.qgis.org/latest/en/docs/server_manual/services.html#wms-formatoptions) as `formatOptions`, i.e.

"formatOptions": "MODE:NOSYMBOLOGY;NO_MTEXT:1"

# GeoPDF export
GeoPDF export is available since QGIS Server 3.36. As opposed generating a PDF via `GetPrint` (as used by the `Print`-Plugin), the MapExport plugin generates the GeoPDF via `GetMap` and will return just the selected export area as a GeoPDF, without relying on any print layout defined in the QGIS project.

You can configure the GeoPDF export by passing supported `FORMAT_OPTIONS`, look for `PdfFormatOption` in [https://github.com/qgis/QGIS/blob/master/src/server/services/wms/qgswmsparameters.h](https://github.com/qgis/QGIS/blob/master/src/server/services/wms/qgswmsparameters.h).

0 comments on commit 414a1fe

Please sign in to comment.