3944 Commits

Author SHA1 Message Date
Nyall Dawson
11dc9cca18 Add force_polygon_cw and force_polygon_ccw expression functions
These are recommended for use instead of the existing force_rhr
function, due to the variability in definition of the "right hand
rule" between different software applications. Using an explicit
force_polygon_cw/ccw function removes user confusion when the
results vary between different applications.
2021-11-01 12:10:41 +11:00
Nyall Dawson
0795f726cf [api] Add function to apply a dash pattern vector to a geometry
This returns a new multilinestring geometry which represents the
input geometry with the dash pattern applied to the lines or rings
of the input geometry.

Options are available to set rules for the start/end of the pattern,
e.g. ending on a full dash or gap, or half dash or gap.

Sponsored by North Road, thanks to SLYR
2021-10-30 18:18:03 +11:00
Alessandro Pasotti
5c3915b9ed
Merge pull request #45587 from elpaso/bugfix-gh45582-vector-renderer-localization-issues
Fix multiple localization issues with vector renderers
2021-10-29 15:49:14 +02:00
Nyall Dawson
4a4e0061e1 [feature][symbology] New "Lineburst" line symbol layer type
This adds a new "Lineburst" symbol layer type, which renders
a gradient along the WIDTH of a line (as opposed to the interpolated
line renderer, which renders a gradient along the LENGTH of
a line). It's like the shapeburst fill symbol type, but for lines!

Sponsored by North Road, thanks to SLYR
2021-10-29 05:34:08 +11:00
Nyall Dawson
0667363261 [feature][symbology] New "Raster Line" symbol layer type
This new symbol layer type renders a raster image following
a line feature's shape.

Options are present for:
- picture path (including data defined path)
- line width
- opacity
- line join/cap styles

Sponsored by North Road, thanks to SLYR
2021-10-28 12:13:54 +11:00
Nyall Dawson
b06e136a57 [feature][symbolgy] Expose choice of clipping behaviour for line
pattern fill

This allows users to control how lines in the fill should be
clipped to the polygon shape. Options are:

- Clip During Render Only: existing behaviour, lines are created
covering the whole bounding box of the feature and then clipped
while drawing. Line extremities (beginning and end) will not be
visible
- Clip Lines Before Render: lines are clipped to the exact
shape of the polygon prior to rendering. Line extremities (including
cap styles, start/end marker line objects, etc) will be visible,
and may sometimes extend outside of the polygon (depending
on the line symbol settings)
- No Clipping: no clipping at all is done - line will cover the
whole bounding box of the feature

Sponsored by North Road, thanks to SLYR
2021-10-26 14:30:13 +11:00
Nyall Dawson
088ffe6a46 [symbology] Add support for rendering line pattern fills line-by-line
When exporting to a vector format (e.g. PDF) or when a line subsymbol
has dynamic (data defined properties), automatically switch to
a line-by-line based approach for rendering the fill instead of the
previous raster tiled pattern based approach.

While it's slower to render (not noticable for desktop users, but
likely enough to affect server deployments), this has many benefits:

1. Smaller PDF/SVG output file sizes, since the fills aren't rasterized
2. PDF/SVG files which are easier to modify in external apps for
post production, as each individual line in the pattern can be
modified.
3. Better quality PDF/SVG outputs, since the fill isn't DPI
dependant and looks awesome regardless of how close in you zoom
4. No visible artefacts at certain angles/distances/line symbol
styles

And even more excitingly, it opens the door for a range of
new symbol styles, eg.

- line patterns where the individual lines change color/width/dash/...
- line patterns with marker line symbols on center point/etc
- geometry generator effects per line, e.g. wavy line patterns, hand
drawn line styles, etc

Sponsored by North Road, thanks to SLYR

Fixes #16100
2021-10-25 18:55:07 +11:00
Nyall Dawson
0785488631 Fix geometry generator used in subsymbol of point pattern fill results
in only a single marker being rendered
2021-10-25 13:53:11 +10:00
Nyall Dawson
87094024af [feature][symbology] Add optional rotation angle for point pattern
fill

Allows the fill pattern to be rotated

Sponsored by North Road, thanks to SLYR
2021-10-24 18:00:25 +10:00
Jochen Topf
9329891f6b Make QgsTileMatrix::tileRangeFromExtent() const
Because there is no reason for it not to be.
2021-10-23 22:30:22 +02:00
Nyall Dawson
ec41cb59b4 Don't expose an outline subsymbol for SVG fill symbol layers
This is inconsistent with all other fill types, which don't
have a special outline subsymbol. Users should be creating
outline layers when they want an outline instead.

When reading an SVG fill symbol layer from XML, automatically
upgrade any outline subsymbol which is used by the fill to
be separate symbol layers for the parent fill symbol so
that existing symbols will appear as designed in older QGIS
versions.

Fixes qgis#14103
2021-10-23 23:50:52 +10:00
Nyall Dawson
40279cb996 Set new Qgis::RenderContextFlag::RenderingSubSymbol flag on render contexts
whenever a subsymbol component of a parent symbol is being rendered

This flag allows symbol layers to refine their behaviour based on whether
they are a subsymbol or not.
2021-10-23 20:06:32 +10:00
Nyall Dawson
757c69e1ef [feature][symbology] Add random point offset for point pattern fills
This optional setting allows each point to be randomly shifted up
to the specified maximum distance in the x/y directions. Maximum
offset can be set in mm, points, map units, etc OR "percentage"
(which is percentage of the pattern width/height)

An optional random number seed can be set to avoid patterns
jumping around between map refreshes.

Data defined overrides are also supported.

Sponsored by North Road, thanks to SLYR
2021-10-23 19:05:33 +10:00
nirvn
6a37ee72fa [FEATURE][symbology] Add coordinate reference mode (i.e. pattern alignment) to line pattern and point pattern symbol layer types 2021-10-22 22:45:33 -07:00
Nyall Dawson
b56e86181c [feature][symbology] Add option to control marker clipping for
point pattern fill

A new option exposes the ability to clip markers in the fill by:

- "Clip to shape": default behaviour, same as previous versions. Markers
are clipped so that only the portions inside the polygon are visible
- "Marker centroid within shape": only markers where the center of
the marker falls inside the polygon are drawn, but these markers
won't be clipped to the outside of the polygon
- "Marker Completely Within Shape": only markers which fall
completely within the polygon are shown
- "No clipping": any marker which intersects at all with the polygon
will be completely rendered

The clipping mode can be overridden via a data driven expression if
desired.

Sponsored by North Road, thanks to SLYR

Fixes #37825
2021-10-23 12:58:13 +10:00
Nyall Dawson
7c03c9ec4a Calling QgsGeometry.asPoint on a multipoint with a single point part
should be allowed
2021-10-23 05:18:09 +10:00
Nyall Dawson
430c5b24b0 [api] Add methods to create triangular, square, and sine-like waves
along a geometry's boundaries

also includes variations on these which allow for randomized
triangle/square/sine-like waves, with amplitude and wavelength
randomly generated using a specified range
2021-10-23 05:17:07 +10:00
Nyall Dawson
6453d5f35a Condense duplicate enums 2021-10-23 05:16:41 +10:00
Nyall Dawson
999213f97e Complete documentation for QgsPointPatternFillSymbolLayer 2021-10-23 05:16:41 +10:00
Nyall Dawson
fc0d1869bc Promote some symbol layer enums to enum classes, move to Qgis 2021-10-23 05:16:41 +10:00
Alessandro Pasotti
6a22e1ff4e Handle lists and address PR review comments. 2021-10-22 16:17:13 +02:00
Alessandro Pasotti
51be34ee5d Fix multiple localization issues with vector renderers
Fix #45582
2021-10-22 16:17:13 +02:00
Juergen E. Fischer
c6008b7ee1 fix MSVC build: reverts fee62e4, dff05dd and e3a77b9484c effectivly
reverting 3fb0f66 (followup #45348)

Using --no-public-is-protected (default on Windows) also works on Linux
and fixes #45331 too
2021-10-21 23:03:48 +02:00
nirvn
7cc5533f7d [api] Provide a mean to know whether QgsVectorLayerUtils' guessFriendlyIdentifierField function picked a friendly identifier 2021-10-18 22:07:37 -07:00
Sandro Santilli
27ae2c9516 Avoid re-preparing geos geometry from QgsVectorLayerFeatureIterator
Does so by exposing a referenceGeometryEngine method to
QgsFeatureRequest and copying the engine rather than creating
a new one on each iteration.
2021-10-18 15:26:33 +02:00
Etienne Trimaille
4284beb004 Add API in expression to set help string on a variable 2021-10-16 06:36:15 +10:00
Vincent Cloarec
697f2bc474
Improve robustness of mesh editing (#45497)
* renaming and typo

* QgsMeshEditor:checkConsistency returns error

* change approach for remove vertex filling hole on boundary

* split QgsMeshEditor::removeVertex (with/without filling holes)

* check edited mesh before saving

* send start/save editing message to message bar
2021-10-15 08:43:51 -04:00
Nyall Dawson
57fda412fa Further fixes to ensure geometry generator symbol icons are correctly
generated
2021-10-12 17:40:37 +10:00
nirvn
ce49784823 All public now 2021-10-12 16:34:05 +10:00
nirvn
ef84e48a09 Run sipify_all.sh 2021-10-12 16:34:05 +10:00
Denis Rouzaud
ec16736306 run sipify 2021-10-12 16:34:05 +10:00
Nyall Dawson
e8bb89855d Update tests 2021-10-12 14:54:26 +10:00
Nyall Dawson
e733b517b3 Split QgsVertexId out to own file, promote type to enum class 2021-10-12 14:54:26 +10:00
Alessandro Pasotti
8cc230d8a0 Add action info to the form d&d panel 2021-10-12 05:31:33 +10:00
Vincent Cloarec
a840cbf98c
fix aggregate functions with mesh virtual dataset group (#45446) 2021-10-11 08:28:11 -04:00
Loïc Bartoletti
18a782f1fb
Merge pull request #45272 from lbartoletti/geometryvalidator_curve_support
[FIX] GeometryValidator init curve support
2021-10-11 12:11:08 +02:00
Vincent Cloarec
d16cced882
fix time handling of mesh layer when gap of reference time (#45456)
fix time handling of mesh layer when gap of reference time
2021-10-11 11:31:08 +02:00
Nyall Dawson
1f73983725 Expose some useful API from QgsLegendPatchShape 2021-10-11 12:03:13 +10:00
Vincent Cloarec
56b9d808ff
add missing text for mesh editing undo/redo 2021-10-10 13:43:59 -04:00
vcloarec
99a832ef1e fix null temporal properties 2021-10-05 22:45:47 -04:00
Nyall Dawson
b48d7dcc9f Don't reset mesh layer styling when changing data source for layer
This breaks fixing mesh layer paths when restoring projects with
broken mesh layers -- fixing the path causes the existing style
to be lost.

Fixes #45391
2021-10-05 22:45:47 -04:00
Nyall Dawson
b54001c358 Copy output image format and output size to QgsRenderContext
These QgsMapSettings properties are useful to rendering operations
to use when they need to create temporary QImages during the
rendering
2021-10-02 07:16:40 +10:00
Loïc Bartoletti
6c76bb1219 sipify 2021-10-01 09:53:06 +02:00
vcloarec
812bbf9e96 other approach 2021-10-01 09:53:05 +02:00
Loïc Bartoletti
efb082b520 sipify 2021-10-01 09:53:05 +02:00
Juergen E. Fischer
f76af64fba msvc build fixes 2021-09-29 23:49:33 +02:00
Juergen E. Fischer
b843556719 fix msvc build 2021-09-28 21:40:49 +02:00
Even Rouault
08ad87f123
Merge pull request #45262 from nyalldawson/provider
Always pass on transform context to providers, even minimal ones
2021-09-28 21:20:53 +02:00
mhugent
de5ab2948f
Merge pull request #45037 from mhugent/mvt_expressions_interpolate
Mvt expressions interpolate
2021-09-28 10:49:35 +02:00
Nyall Dawson
bbd8a5c902 Add option not to overwrite existing property in
QgsAuxiliaryLayer::createProperty(*)

Instead, if a property already exists it will be upgraded to
an expression based property of the form:

    coalesce("new aux field", 'existing' || 'property' || 'expression')

(i.e. allow per-feature value overrides from the auxiliary field,
but by default fallback to the existing property definition)

Refs #44475
2021-09-28 13:25:54 +10:00