7968 Commits

Author SHA1 Message Date
Nyall Dawson
eb59842f31 C++ API for generating random points inside geometry
Adds an optimised c++ method for generating random points inside
a polygon geometry, using a tessellation based approach to
avoid the inefficiencies of the brute force filtered-random-points-within-extent
approach.
2019-10-05 12:13:14 +10:00
Alessandro Pasotti
0b1b37c37b
Merge pull request #32108 from elpaso/bugfix-gh32089-db-manager-force-to-single-part
Fix layer exporter force to single-part
2019-10-04 16:17:49 +02:00
Alessandro Pasotti
f743a4c242
Merge pull request #32106 from elpaso/bugfix-gh32065-server-json-content-type
Server fix #32065 geojson content type accept
2019-10-04 16:17:12 +02:00
Nyall Dawson
d0ed374662 Add QgsProject flag to avoid loading print layouts when reading a project file
Speeds up project read time when these aren't needed, and also potentially
avoids issues caused by non-thread-safety in layouts (since some items rely
on classes which can only be used in the main thread e.g. QWebPage)
2019-10-04 05:10:45 +10:00
Alessandro Pasotti
2fee844ad0 Fix layer exporter force to single-part
Try to respect the option and fails if is there
any real MULTI geometry in the input layer.

Fixes #32089
2019-10-03 18:41:37 +02:00
Denis Rouzaud
97435d38ee
Merge pull request #32095 from 3nids/from_init_python_url_v2
allow to use remote content for init code file path in attribute form
2019-10-03 17:48:12 +02:00
Denis Rouzaud
411d9957b1 disable test
it is segfaulting on Travis no idea why
2019-10-03 13:40:15 +02:00
Alessandro Pasotti
4a94a9054c Added test reference file 2019-10-03 11:47:07 +02:00
Alessandro Pasotti
8a7ba51b3b Server WFS3 be nice too with geojson content types
Fixes #32065 for WFS3
2019-10-03 10:40:43 +02:00
Alessandro Pasotti
57dda33571 Server be nice and accept geojson mime type variants
Fixes #32065
2019-10-03 10:38:15 +02:00
Denis Rouzaud
8c198a9f46 run lambda if macros are allowed
not only when asking

also show a warning when message bar exists
2019-10-03 10:20:10 +02:00
Denis Rouzaud
812308fc93
download immediately 2019-10-03 07:32:46 +02:00
Nyall Dawson
e7e41e1cb9 Add stable api for setting/retrieving project custom scales
Previously this was all done through raw project key manipulation,
but there's a use case for exposing this nicely for use by plugins.
2019-10-03 14:15:19 +10:00
lbartoletti
c1421455b8 fix dox and tests 2019-10-03 13:33:46 +10:00
lbartoletti
2e529e1bd9 deprecate addTopologicalPoints methods with QgsPointXY
deprecate other methods
2019-10-03 13:33:46 +10:00
Etienne Trimaille
d61fab7783 implement date() and time() in QgsDateTimeEdit to handle NULL values 2019-10-03 13:17:04 +10:00
David Signer
ff26ad1cfb testing focus and null representations for QgsSpinbox as well (not only QgsDoubleSpinBox) 2019-10-03 13:15:33 +10:00
David Signer
2633dc239a remove setNullValues on lineEdit because this should be set over the setSpecialValue 2019-10-03 13:15:33 +10:00
David Signer
fcdc8c704c check widget if it's null instead of redundant text if contained text is the null representer 2019-10-03 13:15:33 +10:00
Denis Rouzaud
f03e1c88bd add missing import 2019-10-02 21:17:37 +02:00
Denis Rouzaud
e03b8abc1a fix test 2019-10-02 15:53:15 +02:00
Denis Rouzaud
c03e309948 add test for Python init form function 2019-10-02 15:53:14 +02:00
Nyall Dawson
9b07075fae Add a switch to QgsTessellator to avoid z handling and fallback to a
purely 2d tesselation

Optimises tessellation when only a 2d tessellation is required by
skipping unnecessary/unwanted calculations
2019-10-02 21:37:52 +10:00
Nyall Dawson
8ee1c20bb2 [tesselator] Allow internal scaling of coordinates by input coordinate
bounds to avoid numerical instability with close coordinates (e.g. calculating
tesselation of geometries in geographic CRS)
2019-10-02 21:37:52 +10:00
nirvn
e37efdf89e [symbology] Fix clipped rotated marker when rendering using cache
(fixes #32059)
2019-10-01 16:41:23 +07:00
Nyall Dawson
3a6cc5c2ca Add method to return weighted point inside triangle 2019-10-01 04:05:13 +10:00
Nyall Dawson
975eedc146 Add method to calculate the area of a triangle 2019-10-01 04:05:13 +10:00
Nyall Dawson
e5e3fe473e [processing] Ensure all objects used by the model are correctly imported
Fixes #32004
2019-10-01 04:04:45 +10:00
Alessandro Pasotti
860d0201ef
Merge pull request #32026 from elpaso/rastercalculator-multiple-bugs-and-new-operators
[needs-docs] Fix multiple raster calc issues (+ new operators)
2019-09-27 19:18:20 +02:00
Alessandro Pasotti
33fe400abf
Update tests/src/analysis/testqgsrastercalculator.cpp
Co-Authored-By: Nyall Dawson <nyall.dawson@gmail.com>
2019-09-27 08:56:07 +02:00
Nyall Dawson
45e847ef69 [layouts][needs-docs] Move page background setting to a per-page option
The UI for this setting was sitting under the page properties panel,
which led users to believe it was a per-page setting (rather than
applying to ALL pages in the layout).

Instead, move this property to sit within individual layout item pages
so that the behavior matches what the UI suggests.

Fixes #25695
2019-09-27 15:17:36 +10:00
Alessandro Pasotti
d730c97f46 Fix multiple raster calc issues
Fixes #32023 Raster calculator change sign does not work when OpenCL is on
Fixes #32025 QGIS Raster Calculator outputs nodata only rasters

Bonus: three new operators with full test coverage
- ABS
- MIN
- MAX
2019-09-26 18:26:25 +02:00
Nyall Dawson
72efc1edde Fix loss of font setting when editing conditional format 2019-09-26 12:41:04 +10:00
Nyall Dawson
a8d145a80a Use a proper panel widget for conditional formatting configuration widget
Fixes a number of UI issues, including poor hi-dpi compatibility.
2019-09-26 12:41:04 +10:00
Nyall Dawson
651c507180 [processing] Extend api for retrieving a layer in a compatible format
A few releases ago a bug fix was implemented which forced conversions
of multi-layer sources. This was a valid bug fix, but the consequence
was that any algorithm using this api with a source file containing
multiple layers (e.g. gpkg) performed a complete copy of the target
layer to a new file, severely impacting performance.

This commit adds new API to retrieve a compatible layer path in the
case when an algorithm CAN correctly handle specific target layer names.
In this case, the forced copy of the source layer is avoided when
using multi-layer inputs like geopackage.
2019-09-26 09:27:46 +10:00
Nyall Dawson
c15c727189 Fix conditional style compression incorrect considers invalid
styles as valid objects

Results in invalid conditional style settings being returned
for a feature in some circumstances
2019-09-25 16:55:33 +10:00
Nyall Dawson
bc82cffd85 Use invalid colors, not transparent colors, to indict not set colors
in QgsConditionalStyle

Otherwise we can't differentiate a "not set" value from a "set but
transparent" value. And this use case is exactly why invalid QColor
states exist.
2019-09-25 16:55:33 +10:00
Nyall Dawson
b1ee295a95 Make QgsConditionalLayerStyles a QObject
and add a "changed" signal to it, so that we can tell when the
layer's conditional styles change
2019-09-25 16:55:33 +10:00
Nyall Dawson
d43834e999 Add equality operator for QgsConditionalStyle 2019-09-25 16:55:33 +10:00
Nyall Dawson
5fa81fb8f2 Add a __repr__ method for QgsConditionalStyle 2019-09-25 16:55:33 +10:00
Matthias Kuhn
96dd42b150
Merge pull request #30972 from qgis/3nids-patch-1
Fix virtual fields that use functions requiring all attributes
2019-09-25 08:25:01 +02:00
Nyall Dawson
b4550dc4c0 [layouts] Fix incorrect alignment of items when the align or distribute
tools are used with items with a non-top-left reference point

Fixes #31900
2019-09-25 04:31:36 +10:00
Nyall Dawson
6e2c7311bb Add Python __repr__ for QgsLayoutPoint, QgsLayoutSize, QgsLayoutMeasurement 2019-09-25 04:31:36 +10:00
Denis Rouzaud
f21e03c5ef
Merge pull request #31963 from 3nids/fix_bool_attrtable
fix false boolean not shown as so in attribute table
2019-09-24 14:31:45 +02:00
Denis Rouzaud
3ee9cd7186 fix test 2019-09-24 13:09:22 +02:00
Denis Rouzaud
44727291d4 display value rather than NULL 2019-09-24 09:13:21 +02:00
Nyall Dawson
b9e223d802 Add methods to QgsProcessingContext to return the preferred vector and raster formats
These methods return a file extension to use when creating vector/raster outputs (e.g. "tif"). Generally,
it is preferable to use the extension associated with a particular parameter, which can be retrieved through
QgsProcessingDestinationParameter::defaultFileExtension(). However, in some cases, a specific parameter
may not be available to call this method on (e.g. for an algorithm which has only an output folder parameter
and which creates multiple output layers in that folder). In this case, the format returned by this
function should be used when creating these outputs.

It is the algorithm's responsibility to check whether the returned format is acceptable for the algorithm,
and to provide an appropriate fallback when the returned format is not usable.
2019-09-24 16:50:22 +10:00
Nyall Dawson
cfcf580b61 [processing][needs-docs] Resurrect setting for default raster/vector
output format

This setting is still used and required in some circumstances, e.g.
it is used as the default selection in outputs file pickers when
the previously used format is not valid.
2019-09-24 16:50:22 +10:00
Nyall Dawson
d4ce50c2b1 [processing] Add API support for algorithm aliases
Allows us to freely move algorithms between providers without
breaking existing scripts
2019-09-24 16:48:39 +10:00
Denis Rouzaud
4c0c6c9d88 add test for QgsCheckBoxFieldFormatter 2019-09-24 08:22:27 +02:00