15 Commits

Author SHA1 Message Date
Nyall Dawson
e437812a68 Return an invalid iterator if a transform exception occurs
when projecting filter rects from destination crs
2017-06-09 08:57:00 +10:00
Nyall Dawson
7d847bf34a Rename transform methods for clarity 2017-06-09 08:41:46 +10:00
Nyall Dawson
a98923507e Allow specifying a destination CRS in QgsFeatureRequest
If set, all geometries will be reprojected from their original
coordinate reference system to the destination CRS while
iterating over features.

If a CRS has been set as the destination CRS, then the filterRect
parameter should be specified in the same CRS as this destination
CRS.

Additionally, a callback function can be specified on the request
to be called if a transform exception is encountered while
iterating over features.

This is designed to make it easier for scripts and plugins to
correctly reproject layers in an efficient and robust way, instead
of having to implement lots of repeated code themselves and
potentially missing some of the important considerations which
come with reprojecting geometries & bounding boxes.

Now, if a script wants the features from a layer in a specific
CRS, they can call:

    crs = QgsCoordinateReferenceSystem('epsg:4326')
    request = QgsFeatureRequest().setDestinationCrs(crs)
    for f in layer.getFeatures(reqeuest):
        print('geometry in 4326 is {}.format(f.geometry().exportToWkt()))
2017-06-08 19:20:07 +10:00
Denis Rouzaud
a14ad32b67 sipify QgsVectorLayerFeatureIterator 2017-05-23 15:02:55 +02:00
arnaud.morvan@camptocamp.com
04a9264e86 Sipify core.QgsFeatureIterator 2017-05-03 19:11:16 +02:00
Denis Rouzaud
85f3b81b55 remove double spaces in sip files
fix indentation
2017-05-03 08:02:14 +02:00
Denis Rouzaud
93971d5ed3 [sip] align pointer and reference in blacklisted files
this will facilitate sip diff checking
2017-05-01 17:49:43 +02:00
Nyall Dawson
92a18087b3 Add safeguard tests to ensure no regressions in expression compilation
(ie check that expressions are successfully compiled where expected)

Add compilation support for "NOT..." type expressions
2016-04-15 07:52:02 +10:00
Juergen E. Fischer
c4c131ef75 sip sync 2014-05-27 23:32:42 +02:00
Juergen E. Fischer
74e7314c36 update sip bindings II 2014-01-27 09:22:53 +01:00
Juergen E. Fischer
d4e369414b update sip bindings 2014-01-26 18:36:29 +01:00
Matthias Kuhn
0c90f32007 QgsFeatureRequest: New filters FilterExpression and FilterFids 2013-09-18 18:57:52 +01:00
Matthias Kuhn
d1768b85fc [SIP] Change all occurences of convert[From|To]Instance to convert[From|To]Type
Removal of these deprecated calls is expected to improve stability
2013-08-13 12:35:49 +02:00
Juergen E. Fischer
99f998aa30 - add missing sip bindings
- port widgets_tree.py to QtXml and update customization.xml (fixes #5752 and  #8054)
2013-06-22 19:41:34 +02:00
Martin Dobias
e110855e6c [API] added QgsFeatureIterator, changed QgsVectorProvider API
Vector data provider now has getFeatures() method to access features.
select(), nextFeature(), featureAtId(), rewind() were removed resp. moved to provider's feature iterator implementations.

Providers that currently do not implement the new API were disabled.
2012-10-08 17:47:51 +02:00