6755 Commits

Author SHA1 Message Date
Nyall Dawson
ed25a3e2ee [FEATURE][layouts] Add setting for label margin for map items
This setting allows per-map control of how close labels are permitted
to be placed to the map item's edges.

Sizes can be set using mm/inches/pixels/etc, and data defined
label margins are allowed.

Fixes #10314
2018-12-15 11:28:56 +10:00
Nyall Dawson
35855b88e1 [FEATURE][API] Add API to set a margin for labels for layout map items
This controls how close labels are permitted to the edges of the map
item. The labeling engine will then try other candidate positions
in order to avoid placing labels within this margin.
2018-12-15 11:28:56 +10:00
Nyall Dawson
4252aabe00 [FEATURE][API] Add option to specify a custom boundary geometry
in QgsMapSettings to restrict where labels are allowed to be placed
within.

If set, this overrides the default behavior of allowing labels to
be placed anywhere inside the rendered map extent.
2018-12-15 11:28:56 +10:00
Nyall Dawson
1285a01c64 Correctly test processing auth widget with real authentication setup 2018-12-15 08:23:10 +10:00
Nyall Dawson
11ea28a5b3 [FEATURE][processing] Add a new parameter type for authentication config
This adds a new available parameter type for processing algorithms,
QgsProcessingParameterAuthConfig, allowing selection from available
authentication configurations (and creation of new ones).

It allows creation of processing algorithm which can fully take
advantage of QGIS' mature authentication handling, avoiding the
need to use insecure string parameters for users to input
sensitive logon credentials.

QgsProcessingParameterAuthConfig parameters are evaluated using
QgsProcessingAlgorithm.parameterAsString(), which returns the
selected authentication configuration ID.
2018-12-15 08:23:10 +10:00
Nyall Dawson
0ca9777755 [api] Raises ValueError and TypeError exceptions when QgsGeometry.asPoint()
is called on non-single-point geometries

Previously we would just return QgsPointXY(0,0) when geometries of invalid
type were used, but this is dangerous and we are safer to explicitly
raise errors preventing use of asPoint() with incompatible geometry types.
2018-12-15 07:40:33 +10:00
Alessandro Pasotti
d4439b25c0 Fix spatialite exotic query layers (aliased, nested, joined ...)
Fixes #20674 (again)

“It does not matter how slowly you go as long as you do not stop.”
― Confucius
2018-12-14 15:10:01 +01:00
Alessandro Pasotti
b71a668a08 opencl rastercalc fix int input rasters and cast to float
Cast to float all math operations because when the
input is not a float or a double opencl raises
an error regarding which override should pick.

By casting to float we are sure that the right
function will be called.

This patch also fixes the buffer sizes for short (16bit)
and int (32bit) and asserts that siexe of float is 32bit.
2018-12-13 18:36:47 +01:00
Matthias Kuhn
4e38193bf3
Merge pull request #8627 from m-kuhn/represent_class_values
Use represention values for classified renderers [FEATURE]
2018-12-11 16:44:17 +01:00
signedav
607dffd1aa basic tests for json type in gpkg 2018-12-11 13:12:35 +01:00
Matthias Kuhn
ad2a5cb626
Code styling 2018-12-11 10:42:44 +01:00
Matthias Kuhn
1d3e7d46d9
Add test for QgsCategorizedSymbolRenderer::createCategories 2018-12-11 09:48:16 +01:00
Matthias Kuhn
bec04c1e44
Merge pull request #8600 from signedav/fix_gpkg_order
Offline editing to GPKG attribute order. Fixes #20276
2018-12-11 08:55:51 +01:00
nirvn
54f28dfbb9 [afs] Basic parsing capacity for label expressions 2018-12-11 12:54:00 +07:00
Nyall Dawson
7ed4218b00 [needs-docs] Upgrade project level setting for Label as Outlines/text setting to use newer API
And replace labeling engine dialog "Draw text as outlines" checkbox with a combobox
presenting the choice of always rendering as outlines OR text.

(This will allow us to easily add additional methods in future, e.g. potentially
a "Render as text wherever possible" setting, for defaulting to text objects
whenever it doesn't impact the rendering quality to do so)
2018-12-11 12:28:29 +10:00
Nyall Dawson
ea069ed60e Push text format rendering setting into QgsLayoutExporter 2018-12-11 12:28:29 +10:00
Nyall Dawson
6755cbd6cf Push text format setting to layout render context 2018-12-11 12:28:29 +10:00
Nyall Dawson
1eaf95a866 [api] Move setting to control how text is rendered to QgsRenderContext
The new QgsRenderContext::TextRenderFormat enum controls how text
should be handled during a render operation, e.g. whether to render
text as outlines (paths) or keep it as real text objects.

Deprecate previous arguments in QgsTextRenderer which handled
this same use case.

This allows us to make the setting vary per-render, instead of
having a single global flag controlling the setting. Ultimately
this will allow us to have different behaviour within the
canvas renders vs print layout exports.

Refs #3975
2018-12-11 12:28:29 +10:00
Nyall Dawson
44fbb89450 [API] Throw IndexError on some QgsCurvePolygon methods when invalid
interior ring index is requested
2018-12-11 09:46:22 +10:00
Nyall Dawson
a49bf9f68f Unit tests for item opacity 2018-12-11 09:45:37 +10:00
signedav
8fda2b7df8 use temp copy of points.shp 2018-12-10 17:53:01 +01:00
nirvn
24d4640bc7 [afs] Add halo/buffer support to label creation 2018-12-10 19:07:21 +07:00
nirvn
ffded6f1d8 [afs] Picture marker & picture fill width/height use points as unit type 2018-12-10 16:09:39 +07:00
nirvn
74172fc176 [afs] Fix picture marker ratio calculation 2018-12-10 16:09:39 +07:00
nirvn
22a66ef390 [FEATURE][AFS] Create labels when settings provied by server 2018-12-10 16:09:39 +07:00
Alessandro Pasotti
cf0442dac6
Merge pull request #8630 from elpaso/bugfix-20674-db-manager-sqlite-aliased-queries
sqlite accept aliased queries from db manager
2018-12-10 08:39:44 +01:00
Nathan Woodrow
87d2da13fb
[FEATURE][needs-docs] Add new @alg decorator for nicer python processing scripts. (#8586)
@alg()
@alg.help()
@alg.input()
@alg.output()
2018-12-10 16:35:52 +10:00
nirvn
be8438b28d [afs] Fix wrong hard-coded OBJECTID reference, use the fetch object id name 2018-12-10 10:25:52 +07:00
Alessandro Pasotti
a44b13ba67 Add test cases for aliased spatialite tables
Also update a failing test case since when
we changed the priority in  QgsVectorLayerUtils
CreateFeature.

Test was blacklisted on travis in nov 2017
but here they are anyway.
2018-12-09 19:08:40 +01:00
Peter Petrik
28071728f1 [mesh] use MDAL 0.1.0 API in QGIS. Allows lazy loading of formats and effective transfer of data
introduce MeshDataBlock

use mesh block in rendering

calculate magnitude

use new mesh API

fix bug for memory layer

fix SIP, sip is unable to work with qvector<qgsmeshvertex>

fix tests

implement new MDAL min/max api

improve mesh documentation

fix travis build
2018-12-07 15:54:16 +01:00
Nyall Dawson
733d4ed578 Test masks 2018-12-07 08:08:52 +10:00
Nyall Dawson
048d526542 Add unit tests, standardise method names 2018-12-07 08:08:52 +10:00
Nyall Dawson
a97d335f31 Fix tests, test mask updates 2018-12-07 08:08:52 +10:00
Nyall Dawson
e6ec1ec53e [FEATURE][API] Add iterator for QgsGeometryCollection
Iterates over the geometries in the collection, allowing this type
of code:

  gc = QgsGeometryCollection()
  gc.fromWkt('GeometryCollection( Point(1 2), Point(11 12), LineString(33 34, 44 45))')
  for part in gc:
    print(part.asWkt())
2018-12-07 05:51:27 +10:00
Nyall Dawson
4bba8ae64d [FEATURE][API] Add some nice PyQGIS API for working with geometry collections
- Calling removeGeometry with an invalid index will now raise an IndexError
- Calling collection[0] will return the first geometry in the collection,
collection[1] the second, etc. And negative indices return from the end
of the collection, so collection[-1] returns the last geometry in the collection.
- Geometries can be deleted by calling `del collection[1]` (deletes the
second geometry from the collection). Also supports negative indices
to count from the end of the collection.
2018-12-07 05:51:27 +10:00
nirvn
31b82de5e3 [FEATURE][AFS] Automatically convert ESRI picture fill symbols 2018-12-06 17:47:24 +07:00
Nyall Dawson
b95400806a [FEATURE][processing] Native "split lines by maximum length" algorithm
This algorithm takes an input (multi)line (or curve) layer, and splits
each feature into multiple parts such that no part is longer then
the specified maximum length.

Supports data-defined maximum length property, and edit in place operation.

Credit to @NathanW2 for the inspiration!
2018-12-06 10:01:31 +10:00
Nyall Dawson
19b54ba2f9 Identation 2018-12-06 09:22:50 +10:00
Nyall Dawson
543acff4fe [FEATURE][AFS] Automatically convert ESRI picture marker symbols
and use as default style for remote layers with picture marker symbology
2018-12-06 09:22:50 +10:00
Nyall Dawson
3136885157 Fix QPainter warnings when broken image paths are passed to QgsImageCache 2018-12-06 09:22:50 +10:00
Nyall Dawson
bafda2451b Correctly handle empty paths in QgsImageCache 2018-12-06 09:22:50 +10:00
Nyall Dawson
58219d66f8 Test mask updates 2018-12-06 09:22:50 +10:00
Nyall Dawson
32dc102026 Fix embedding larger files then can fit in a QLineEdit's contents
Fixes #20329
2018-12-06 09:22:50 +10:00
Nyall Dawson
9d28a9699c Add a new widget QgsImageSourceLineEdit, based on QgsSvgSourceLineEdit
Allows images to be set to base64 embedded images, remote urls, etc
when used alongside QgsImageCache
2018-12-06 09:22:50 +10:00
nirvn
c6425338ee [FEATURE] Raster image marker 2018-12-05 15:44:44 +07:00
nirvn
60442980dd Add dox comment, fix travis 2018-12-05 11:14:13 +07:00
nirvn
ad4b876866 Add opacity parameter to image cache 2018-12-05 11:14:13 +07:00
nirvn
ce5636afed Allow passing {width,height}-only size to the image cache 2018-12-05 11:14:13 +07:00
Nyall Dawson
c1df802769 Add method to QgsImageCache to retrieve original image size 2018-12-05 11:14:13 +07:00
Nyall Dawson
84838d1ec6 [FEATURE][API] Add a content cache for raster images
This new class QgsImageCache is the equivalent of QgsSvgCache
but for raster images.

QgsImageCache stores pre-rendered resampled versions of raster
image files, allowing efficient reuse without incurring the
cost of resampling on every render.

Additionally, it offers the other benefits QgsSvgCache has,
such as thread safety, ability to transparently download remote
images, and support for base64 encoded strings.
2018-12-05 11:14:13 +07:00