4869 Commits

Author SHA1 Message Date
Martin Dobias
0a35d43552 Speed up rendering of RGB images
In my simple test case this made map rendering of RGB satellite image tiles
go down by ~50% from ~40ms per tile to ~20ms per tile (in debug version, ahem)
2018-07-09 22:01:11 +02:00
Nyall Dawson
05368e4a89 Rename intersect to intersects for consistency with QgsSpatialIndex 2018-07-07 10:54:47 +10:00
Nyall Dawson
9445095a18 Dox++ 2018-07-07 10:54:47 +10:00
Nyall Dawson
ae4e4cd4bb Return full point container for matches, remove redundant point method 2018-07-07 10:54:47 +10:00
Nyall Dawson
66c17880be Modify kdbush to store feature id alonside point, for optimised storage/retrieval 2018-07-07 10:54:47 +10:00
Nyall Dawson
612c9cb047 Use sets for index results 2018-07-07 10:54:47 +10:00
Nyall Dawson
004dc184ce Expand QgsSpatialIndexKDBush API 2018-07-07 10:54:47 +10:00
Nyall Dawson
5c552dd359 QgsSpatialIndexKDBush is implicitly shared for fast copies 2018-07-07 10:54:47 +10:00
Nyall Dawson
0df1056dd4 [FEATURE] QgsSpatialIndexKDBush
A very fast static spatial index for 2D points based on a flat KD-tree,
using https://github.com/mourner/kdbush.hpp

Compared to QgsSpatialIndex, this index:
 - supports single point features only (no multipoints)
 - is static (features cannot be added or removed from the index after construction)
 - is much faster!
 - supports true "distance based" searches, i.e. return all points within a radius
from a search point
2018-07-07 10:54:47 +10:00
Nyall Dawson
a261a668a0 Fix warning 2018-07-06 02:25:08 +10:00
Nyall Dawson
eb53e3b830 Fix failing feature source conformance tests for QgsVectorLayerSelectedFeatureSource
Fixes #19324
2018-07-06 02:25:08 +10:00
Nyall Dawson
2695e00042 Add a context getter to QgsCoordinateTransform 2018-07-04 13:23:07 +10:00
Matthias Kuhn
7e7faadabf
Merge pull request #7343 from m-kuhn/qgsfunction_handlesnull
Add handlesnull parameter to @qgsfunction
2018-07-02 15:19:06 -05:00
Matthias Kuhn
a1b6a2cb7f Fix docs 2018-07-02 06:16:49 -05:00
Hugo Mercier
b37a215451 Make qgis_sip_uptodate happy 2018-07-02 11:00:43 +02:00
Matthias Kuhn
45fdd0fb31 Add documentation for @qgsfunction 2018-07-01 06:31:26 -05:00
Matthias Kuhn
60730abba7 Add missing import 2018-06-30 09:40:13 -05:00
Matthias Kuhn
773138cf57 Add handlesnull parameter to @qgsfunction
Up to date it was not possible to create a function that handles NULL values with the
@qgsfunction decorator. As soon as any parameter was NULL, the return value would also
be NULL.

Example of a function that returns a value now with a NULL paramter and would have returned NULL before

```
@qgsfunction(args=-1, group='Custom', handlesnull=True)
def mean_value(vals, feature, parent):
    valid_vals = [val for val in vals if val != NULL]
    return sum(valid_vals)/len(valid_vals)
```

[FEATURE]
2018-06-30 09:40:13 -05:00
Martin Dobias
569db8e069
Merge pull request #7045 from PeterPetrik/qgs-quick-position_and_transformer
[feature] [qgsquick] Add PositionKit, PositionMarker and CoordinateTransformer
2018-06-29 09:08:35 +02:00
Martin Dobias
97addfc2cc
Merge pull request #7313 from PeterPetrik/mesh_layer_styling_gui
[mesh] [feature] App widgets for styling mesh layers
2018-06-28 15:17:14 +02:00
Martin Dobias
4c8b801791 Make sure that bool(obj) is True for QGIS API objects
bool(obj) in Python has the following semantics:
1. if the object has __bool__() method, return its value
2. if the object has __len__() method, return its value
3. return True

So for objects in QGIS API that implement __len__() method, we were getting
unexpected behavior - for example, "if layer: ..." would evaluate as False
in case the layer was empty, while the usual expectation is that any reference
to an object that is not None should evaluate to True.
2018-06-28 11:04:50 +02:00
Peter Petrik
7bfcaf4db9 remove need for factory for system of measurement 2018-06-28 10:41:13 +02:00
Nyall Dawson
73eb7628d8 Style 2018-06-28 11:26:53 +10:00
Juergen E. Fischer
d0e94728d8 fix build with sip 4.18.1 (eg. ubuntu artful) 2018-06-27 23:30:04 +02:00
Matthias Kuhn
d7b85c69f8
Merge pull request #7016 from m-kuhn/featureSourceEmpty
QgsFeatureSource::empty() method
2018-06-26 13:01:08 +02:00
Peter Petrik
aeea184890 [mesh] [feature] App widgets for styling mesh layers
- Adding datasets to mesh layer from properties panel
- Information and source panel in properties panel
- Selection of active dataset (properties or styling panel)
- Styling of contours/scalars (properties or styling panel)
- Styling of mesh frame (properties or styling panel)
- Styling of vector arrows (properties or styling panel)
2018-06-26 08:50:19 +02:00
Peter Petrik
caed3a91d9 choose system of measurement for scalebar or position 2018-06-25 13:47:58 +02:00
Matthias Kuhn
1b15e68f64
Add minimal smartness for QgsProcessingFeatureSource::hasFeatures 2018-06-22 14:41:42 +02:00
Matthias Kuhn
2718317e85
Merge pull request #7298 from nyalldawson/layout
[layouts] Save last used export folder in project
2018-06-22 14:35:37 +02:00
Matthias Kuhn
c780d607cc
Merge pull request #7105 from PeterPetrik/quick-3-identity
[qgsquick] [feature] Identify and highlight
2018-06-22 14:34:08 +02:00
Matthias Kuhn
638fc0ceff
Merge pull request #7245 from rouault/gpkg_transactions
[OGR provider] [FEATURE] Add support for transactions on GPKG databases
2018-06-22 14:33:01 +02:00
Nyall Dawson
635f8ad7ca Add QgsFileUtils::findClosestExistingPath to find the closest
existing folder match for a path

E.g. if \a path is "/home/user/projects/2018/P4343"
and "/home/user/projects" exists but no "2018" subfolder
exists, then the function will return "/home/user/projects".

(Suprisingly no existing Qt method for this!)
2018-06-22 10:45:00 +10:00
Etienne Trimaille
6eeaca5570 return the default style first in the list 2018-06-22 09:23:47 +10:00
Martin Dobias
4c84cfa29a Fix a memory leak in classify() + add missing annotations/docstrings
A pseudo color renderer was getting created in classify() but never deleted.

Spotted by @PeterPetrik

As a bonus switched a for loop from mixed constBegin()/end() usage to range for.
2018-06-22 05:48:46 +10:00
Denis Rouzaud
ad00020366 QgsSettings.enumValue cast to enum 2018-06-21 05:29:16 -08:00
Denis Rouzaud
01681aba89 fix missing import 2018-06-21 05:29:16 -08:00
Denis Rouzaud
7dfec1fde0 [pyqgis] add misssing QgsSettings.setEnumValue
also fix sections in enumValue and flagValue
2018-06-21 05:29:16 -08:00
Nyall Dawson
981c6686c0 Dox++ 2018-06-21 18:22:55 +10:00
Nyall Dawson
2ed547219a Add globs to information returned by QgsVectorFileWriter.supportedFiltersAndFormats 2018-06-21 18:22:55 +10:00
Denis Rouzaud
f749c521a9 use Q_ENUM for QgsLocator::Priority 2018-06-20 11:21:25 -08:00
Nyall Dawson
77d22849d9 Fix calculation of relation aggregate in virtual field with same name as related field 2018-06-20 15:23:55 +10:00
Denis Rouzaud
ff1988f11d Python __repr__ test output 2018-06-19 13:55:53 -04:00
Denis Rouzaud
763dfd2998 use SIP to define Python __repr__ rather than injections
because it's a bit more clever!
2018-06-19 07:58:26 -04:00
Denis Rouzaud
cc3e29bcc2 add __repr__ for more geometry classes and add test 2018-06-19 07:02:17 -04:00
Denis Rouzaud
ac4f508c13 create Python __repr__ methods for QgsPoint and QgsPointXY 2018-06-19 07:02:17 -04:00
Nyall Dawson
4059c9b71d Move some more common geometry methods to headers to allow compiler inlining 2018-06-19 13:16:02 +10:00
Nyall Dawson
077ecedfc5 Unit tests for QgsMessageLog 2018-06-19 06:23:58 +10:00
Nyall Dawson
949853a0e0 Add API for temporarily suppressing user notifications for
message log critical/warning messages

These messages are still logged, but the log indicator is not
modified to flag their appearance.

This allows certain error messages to be logged (e.g. on startup)
which cannot be fixed by users/developers (e.g. those caused
by upstream Qt issues, 3rd party Python libraries, etc) but
without flagging them.

Currently, we get so many of these warnings on startup that the
log indicator loses all impact, and newly introduced, VALID
errors go unnoticed/ignored.
2018-06-19 06:23:58 +10:00
Nyall Dawson
00f0583325 Fix doc test 2018-06-18 23:14:45 +10:00
Nyall Dawson
68b38b2daf Add a signal when a project is cleared 2018-06-18 23:14:45 +10:00