Skip to content
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

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions python/PyQt6/core/auto_additions/qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -5366,6 +5366,38 @@
Qgis.MarkerLinePlacements = lambda flags=0: Qgis.MarkerLinePlacement(flags)
Qgis.MarkerLinePlacements.baseClass = Qgis
MarkerLinePlacements = Qgis # dirty hack since SIP seems to introduce the flags in module
# monkey patching scoped based enum
Qgis.LinearReferencingPlacement.IntervalCartesian2D.__doc__ = "Place labels at regular intervals, using Cartesian distance calculations on a 2D plane"
Qgis.LinearReferencingPlacement.IntervalZ.__doc__ = "Place labels at regular intervals, linearly interpolated using Z values"
Qgis.LinearReferencingPlacement.IntervalM.__doc__ = "Place labels at regular intervals, linearly interpolated using M values"
Qgis.LinearReferencingPlacement.Vertex.__doc__ = "Place labels on every vertex in the line"
Qgis.LinearReferencingPlacement.__doc__ = """Defines how/where the labels should be placed in a linear referencing symbol layer.

.. versionadded:: 3.40

* ``IntervalCartesian2D``: Place labels at regular intervals, using Cartesian distance calculations on a 2D plane
* ``IntervalZ``: Place labels at regular intervals, linearly interpolated using Z values
* ``IntervalM``: Place labels at regular intervals, linearly interpolated using M values
* ``Vertex``: Place labels on every vertex in the line

"""
# --
Qgis.LinearReferencingPlacement.baseClass = Qgis
# monkey patching scoped based enum
Qgis.LinearReferencingLabelSource.CartesianDistance2D.__doc__ = "Distance along line, calculated using Cartesian calculations on a 2D plane."
Qgis.LinearReferencingLabelSource.Z.__doc__ = "Z values"
Qgis.LinearReferencingLabelSource.M.__doc__ = "M values"
Qgis.LinearReferencingLabelSource.__doc__ = """Defines what quantity to use for the labels shown in a linear referencing symbol layer.

.. versionadded:: 3.40

* ``CartesianDistance2D``: Distance along line, calculated using Cartesian calculations on a 2D plane.
* ``Z``: Z values
* ``M``: M values

"""
# --
Qgis.LinearReferencingLabelSource.baseClass = Qgis
QgsGradientFillSymbolLayer.GradientColorType = Qgis.GradientColorSource
# monkey patching scoped based enum
QgsGradientFillSymbolLayer.SimpleTwoColor = Qgis.GradientColorSource.SimpleTwoColor
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The following has been generated automatically from src/core/symbology/qgslinearreferencingsymbollayer.h
QgsLinearReferencingSymbolLayer.create = staticmethod(QgsLinearReferencingSymbolLayer.create)
try:
QgsLinearReferencingSymbolLayer.__group__ = ['symbology']
except NameError:
pass
14 changes: 14 additions & 0 deletions python/PyQt6/core/auto_additions/qgssymbollayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@
QgsSymbolLayer.Property.PropertyLineClipping = QgsSymbolLayer.Property.LineClipping
QgsSymbolLayer.PropertyLineClipping.is_monkey_patched = True
QgsSymbolLayer.PropertyLineClipping.__doc__ = "Line clipping mode \n.. versionadded:: 3.24"
QgsSymbolLayer.SkipMultiples = QgsSymbolLayer.Property.SkipMultiples
QgsSymbolLayer.SkipMultiples.is_monkey_patched = True
QgsSymbolLayer.SkipMultiples.__doc__ = "Skip multiples of \n.. versionadded:: 3.40"
QgsSymbolLayer.ShowMarker = QgsSymbolLayer.Property.ShowMarker
QgsSymbolLayer.ShowMarker.is_monkey_patched = True
QgsSymbolLayer.ShowMarker.__doc__ = "Show markers \n.. versionadded:: 3.40"
QgsSymbolLayer.Property.__doc__ = """Data definable properties.

* ``Size``: Symbol size
Expand Down Expand Up @@ -592,6 +598,14 @@

Available as ``QgsSymbolLayer.PropertyLineClipping`` in older QGIS releases.

* ``SkipMultiples``: Skip multiples of

.. versionadded:: 3.40

* ``ShowMarker``: Show markers

.. versionadded:: 3.40


"""
# --
Expand Down
15 changes: 15 additions & 0 deletions python/PyQt6/core/auto_generated/qgis.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,21 @@ The development version
typedef QFlags<Qgis::MarkerLinePlacement> MarkerLinePlacements;


enum class LinearReferencingPlacement /BaseType=IntFlag/
{
IntervalCartesian2D,
IntervalZ,
IntervalM,
Vertex,
};

enum class LinearReferencingLabelSource /BaseType=IntEnum/
{
CartesianDistance2D,
Z,
M,
};

enum class GradientColorSource /BaseType=IntEnum/
{
SimpleTwoColor,
Expand Down
Loading
Loading