Skip to content

Add contour line label provider for raster layers - #2

Closed
Geojim wants to merge 6 commits into
masterfrom
claude/qgis-issue-53415-ROnBY
Closed

Add contour line label provider for raster layers#2
Geojim wants to merge 6 commits into
masterfrom
claude/qgis-issue-53415-ROnBY

Conversation

@Geojim

@Geojim Geojim commented Feb 27, 2026

Copy link
Copy Markdown
Owner

Introduces QgsRasterContourLabelProvider and QgsRasterLayerContourLabeling, enabling labels placed along contour lines generated on-the-fly from raster DEM data via GDAL's contour generation API.

Key changes:

  • New QgsRasterContourLabelProvider generates contour geometries in map CRS and registers them as line features with the PAL labeling engine
  • New QgsRasterLayerContourLabeling configuration class with contour interval, index interval, downscale factor, and label-index-only settings
  • QgsRasterLayerLabelProvider changed from final to extensible (protected members, virtual generateLabels, override instead of final)
  • Factory dispatch in createFromElement handles "contour" type

https://claude.ai/code/session_01TaS7A3X8CXBYqJzq2EMLak

Description

[Replace this with some text explaining the rationale and details about this pull request]

AI tool usage

  • AI tool(s) (Copilot, Claude, or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated. Failure to be honest might result in banning.

Introduces QgsRasterContourLabelProvider and QgsRasterLayerContourLabeling,
enabling labels placed along contour lines generated on-the-fly from raster
DEM data via GDAL's contour generation API.

Key changes:
- New QgsRasterContourLabelProvider generates contour geometries in map CRS
  and registers them as line features with the PAL labeling engine
- New QgsRasterLayerContourLabeling configuration class with contour interval,
  index interval, downscale factor, and label-index-only settings
- QgsRasterLayerLabelProvider changed from final to extensible (protected
  members, virtual generateLabels, override instead of final)
- Factory dispatch in createFromElement handles "contour" type

https://claude.ai/code/session_01TaS7A3X8CXBYqJzq2EMLak
McGuiness and others added 3 commits February 28, 2026 19:23
Generate SIP bindings for QgsRasterLayerContourLabeling and update
the base class ConvertToSubClassCode for the "contour" type. Add
Python tests covering properties, clone, XML round-trip, scale
visibility, and layer serialization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds QgsRasterContourLabelSettingsWidget with controls for band,
contour interval, index interval, downscale, number format, and
index-only labeling. Integrates as a third option ("Label with
Contour Lines") in the raster layer Labels tab.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the Chore label Feb 28, 2026
McGuiness and others added 2 commits February 28, 2026 22:14
Add %Include in core_auto.sip and create auto_additions file so the
Python bindings compile and the prepare_sip pre-commit hook passes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Band, contour interval, index interval, and downscale are already
configured in the Symbology tab via QgsRasterContourRenderer. The label
provider now reads these values directly from the renderer at render
time, keeping the two tabs in sync and avoiding confusing duplication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Geojim Geojim closed this Feb 28, 2026
@Geojim
Geojim deleted the claude/qgis-issue-53415-ROnBY branch February 28, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants