-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Add "Linear Referencing" symbol layer type #58484
Conversation
@nyalldawson A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
c7de691
to
26ab9b9
Compare
6341775
to
972b7cf
Compare
res->mMarkerSymbol.reset( mMarkerSymbol ? mMarkerSymbol->clone() : nullptr ); | ||
if ( mNumericFormat ) | ||
res->mNumericFormat.reset( mNumericFormat->clone() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Purely cosmetic: why not using the same style for mNumericFormat here? I.e.
res->mMarkerSymbol.reset( mMarkerSymbol ? mMarkerSymbol->clone() : nullptr ); | |
if ( mNumericFormat ) | |
res->mNumericFormat.reset( mNumericFormat->clone() ); | |
res->mMarkerSymbol.reset( mMarkerSymbol ? mMarkerSymbol->clone() : nullptr ); | |
res->mNumericFormat.reset( mNumericFormat ? mNumericFormat->clone() : nullptr ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cos the marker symbol is optional, whereas we expected that the numeric format should always be set. I'm playing things extra careful with the if ( mNumericFormat )
check, but if somehow that happens then at least we won't overwrite the default format created for the cloned copy...
This new symbol layer type allows placing text labels at regular intervals along a line (or at positions corresponding to existing vertices). Positions can be calculated using Cartesian distances, or interpolated from z/m values. Functionality includes: - Labels can be placed using fixed cartesian 2d distances, at regular linearly interpolated spacing calculated using the Z or M values in geometries, or at existing vertices - Labels can show either the running total distance, or the linearly interpolated Z/M value - Uses text rendered to draw labels, so the full range of functionality is available for the labels (including buffers, shadows, etc) - Uses the QGIS numeric format classes to format numbers as strings, so users have full range of customisation options for eg decimal places - An optional "skip multiples of" setting. If set, then labels which are a multiple of this value will be skipped over. This allows construction of complex referencing labels, eg where a symbol has two linear referencing symbol layers, one set to label every 100m in a small font, skipping multiples of 1000, and a second set to label every 1000m in a big bold font - Labels are rendered using an angle calculated by averaging the linestring, so sharp tiny jaggies don't result in unslightly label rotation - Optionally, markers can be placed at referenced points in the line string, using a full QGIS marker symbol (this allows eg showing a cross-hatch at the labeled point, for a "ruler" style line) - Data defined control over the placement intervals, skip multiples setting, marker visibility and average angle calculation length Notes: - When using the distance-based placement or labels, the distances are calculated using 2D only, Cartesian calculations based on the original layer CRS. This could potentially be extended in future to expose options for 3D Cartesian distances, or ellipsoidal distance calculations. Sponsored by the Swiss QGIS User Group
972b7cf
to
f7930bd
Compare
Thanks @nirvn, all addressed! |
@nyalldawson |
This new symbol layer type allows placing text labels at regular intervals along a line (or at positions corresponding to existing vertices). Positions can be calculated using Cartesian distances, or interpolated from z/m values.
Functionality includes:
Notes:
Sponsored by the Swiss QGIS User Group