QGIS Integration with Rasters#

Export GeoServer coverages (raster layers) to QGIS projects and connections.

Overview#

GeoServer publishes rasters via WMS (Web Map Service). The QGIS export commands automatically include raster coverages alongside vector layers.

Generating QGIS Projects with Rasters#

Export Project with Rasters#

Create a QGIS project that includes both vector layers and raster coverages:

1
2
3
4
5
# Export project for a workspace (includes all vector and raster layers)
./geoserver-cli qgis export project -w my_workspace -o analysis.qgs

# Export all-workspaces project
./geoserver-cli qgis export project --all-workspaces -o global.qgs

Generated Project Contents:

  • ✅ Vector layers via WFS (editable)
  • ✅ Raster coverages via WMS (read-only)
  • ✅ Layer styles and rendering options
  • ✅ Coordinate reference systems (CRS)

Generate QGIS Connections#

Export WMS connections for rasters without creating a full project:

1
2
3
4
5
# Export WMS connections (for rasters and WMS layers)
./geoserver-cli qgis export connections -w my_workspace -o wms_connections.xml

# Export to stdout for piping
./geoserver-cli qgis export connections -w my_workspace

Real-World Workflows#

Workflow 1: Analyze Satellite Imagery with Vector Data#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Setup: Create workspace with satellite imagery and administrative boundaries

# 1. Publish satellite imagery (raster)
./geoserver-cli coverage store create satellite_2024 -w analysis \
  --type ImageMosaic \
  --url "file:///data/satellite/" \
  --description "2024 Satellite Imagery"

./geoserver-cli coverage update satellite_2024 -s satellite_2024 -w analysis \
  --enabled true --advertised true

# 2. Configure style for visualization
./geoserver-cli style create satellite_natural_color --sld @natural_color.sld
./geoserver-cli coverage update satellite_2024 -s satellite_2024 -w analysis \
  --default-style satellite_natural_color

# 3. Publish vector boundaries
./geoserver-cli publish postgis --layer admin_boundaries -w analysis --store postgis

# 4. Generate QGIS project
./geoserver-cli qgis export project -w analysis -o satellite_analysis.qgs

# 5. Open in QGIS and analyze
# - Satellite imagery available as background WMS layer
# - Vector boundaries available for drawing annotations
# - Both layers properly styled with configured symbols

Workflow 2: Create Multi-Source Analysis Project#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Setup: Combine DEM, land cover, and infrastructure

# 1. Publish elevation model
./geoserver-cli coverage store create dem -w analysis \
  --type GeoTIFF --url "file:///data/dem.tif"
./geoserver-cli coverage update dem -s dem -w analysis \
  --interpolation bilinear --default-style hillshade \
  --enabled true --advertised true

# 2. Publish land cover raster
./geoserver-cli coverage store create lulc -w analysis \
  --type GeoTIFF --url "file:///data/lulc.tif"
./geoserver-cli coverage update lulc -s lulc -w analysis \
  --interpolation nearest --default-style lulc_colors \
  --enabled true --advertised true

# 3. Publish infrastructure vectors
./geoserver-cli publish postgis --layers roads,power_lines -w analysis

# 4. Export single QGIS project with all layers
./geoserver-cli qgis export project -w analysis -o multi_source.qgs

# Result: QGIS project with:
# - DEM hillshade rendering
# - Land cover color classification
# - Road and power line features
# - All properly styled and ready for analysis

Workflow 3: Distributed Team Access via Connections#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Setup: Make raster and vector data available to team

# 1. Create workspace with both vector and raster data
./geoserver-cli workspace create team_gis

# 2. Publish rasters (available via WMS)
./geoserver-cli coverage store create basemap -w team_gis \
  --type ImageMosaic --url "file:///imagery/"
./geoserver-cli coverage update basemap -s basemap -w team_gis \
  --enabled true --advertised true

# 3. Publish vectors (available via WFS for editing)
./geoserver-cli publish postgis --all -w team_gis

# 4. Generate connections for team distribution
./geoserver-cli qgis export connections -w team_gis -o team_connections.xml

# 5. Team members:
# - Import connections into QGIS
# - Configure QGIS Auth Manager (settings/security)
# - Access rasters via WMS (background layers)
# - Edit vector data via WFS

Layer Rendering and Styling#

Raster Display in QGIS#

Rasters appear as WMS layers in the QGIS project:

PropertyValueNotes
TypeRaster (WMS)Read-only, single image
FormatPNG/JPEGDepends on WMS configuration
TransparencySupportedQGIS handles alpha channel
CRSFrom coverageAutomatically reprojected
ExtentFrom native boundsCovers full raster extent

Styling Applied#

When you export a project with --default-style configured:

1
2
3
4
# Example: Create hillshade style and apply
./geoserver-cli style create dem_hillshade --sld @hillshade.sld
./geoserver-cli coverage update dem -s dem_store -w analysis \
  --default-style dem_hillshade

The exported QGIS project will display the raster with that style applied.

Best Practices#

1. Configure Appropriate Interpolation#

Set interpolation before exporting to QGIS:

1
2
3
4
5
6
7
# Continuous rasters: use bilinear or bicubic
./geoserver-cli coverage update elevation -s dem -w gis \
  --interpolation bilinear

# Discrete rasters: use nearest
./geoserver-cli coverage update landuse -s lulc -w gis \
  --interpolation nearest

2. Use Descriptive Names#

Clear naming helps team members understand layers:

1
2
3
4
5
6
7
8
9
# Good: specific and descriptive
dem_utm30_2024_hiresolution
satellite_rgb_ortho_2024
landcover_corine_2020

# Bad: vague
data
raster1
imagery

3. Enable/Advertise Before Exporting#

Ensure rasters are visible:

1
2
./geoserver-cli coverage update my_raster -s store -w ws \
  --enabled true --advertised true

Only advertised layers appear in QGIS project and WMS GetCapabilities.

4. Test with Small Subset First#

When working with large datasets:

1
2
3
4
5
# Test export with one small workspace first
./geoserver-cli qgis export project -w test -o test.qgs

# If successful, export full workspace
./geoserver-cli qgis export project -w production -o production.qgs

5. Document Layer Information#

Include metadata for team reference:

1
2
3
4
# Set titles and descriptions
./geoserver-cli coverage update raster_name -s store -w ws \
  --title "Descriptive Title for Display" \
  --abstract "Detailed information about this raster data"

Troubleshooting#

Rasters Not Appearing in QGIS Project#

Check:

1
2
3
4
5
6
7
8
# Verify coverage exists and is enabled
./geoserver-cli coverage list -s store -w workspace
./geoserver-cli coverage update raster_name -s store -w workspace

# Check if advertised (appears in WMS GetCapabilities)
# If not advertised, QGIS may not see it
./geoserver-cli coverage update raster_name -s store -w workspace \
  --advertised true

WMS Layers Appear But Don’t Render#

Check:

1
2
3
4
5
# Verify layer can be accessed via WMS
curl "http://geoserver/geoserver/workspace/wms?service=WMS&version=1.1.1&request=GetCapabilities"

# Verify interpolation is set
./geoserver-cli coverage metadata raster_name -s store -w workspace

QGIS Project File Too Large#

Solutions:

1
2
3
4
5
# Export only specific workspace instead of all-workspaces
./geoserver-cli qgis export project -w specific_workspace -o output.qgs

# Export connections only (no full project)
./geoserver-cli qgis export connections -w workspace -o connections.xml

Integration Summary#

FeatureRastersVectors
Export to QGIS✅ WMS layers✅ WFS layers
Styling✅ SLD in WMS✅ SLD in WFS
Editing❌ Read-only✅ Full edit
Query✅ WMS GetFeatureInfo✅ WFS GetFeature
FormatPNG/JPEG/GeoTIFFGeoJSON/GML

See Also#