15 Commits

Author SHA1 Message Date
Alexander Bruy
37725379f2 add missed import 2017-01-09 15:34:42 +02:00
volaya
306764871b [processing] added test for invalid geometry checking 2017-01-09 15:13:47 +02:00
Alexander Bruy
d81533e05a fix failing test 2016-11-12 13:31:46 +02:00
Alexander Bruy
75bd622ccc [processing] restore and fix extraction of OGR layer names 2016-11-12 13:31:45 +02:00
Alexander Bruy
85d1fd720b [processing] cleanup test data 2016-11-12 13:31:44 +02:00
Alexander Bruy
d08c02dbd0 [processing] disable polygonize test, as it is not stable 2016-11-12 13:31:43 +02:00
Alexander Bruy
a6bd9f0207 Revert "Fix extraction of ogr LayerName from multi-layer dataset URIs"
This reverts commit 6c5364186dd8d45ac51e5bd1a72c6a542f032cb1.

As it breaks all OGR geoprocessing algoroithms.
2016-11-12 13:31:42 +02:00
Bas Couwenberg
85818c684c Fix copyright in 2017
Match copyright header with python code.
2016-10-21 23:14:29 +02:00
Sandro Santilli
8843de88c7 Fix ogrLayerName handling of PostgreSQL dataset URIs
Also document "uri" parameter semantic, and add more tests.
See for background
https://lists.osgeo.org/pipermail/qgis-developer/2016-October/045311.html
REF #15698
2016-10-18 11:05:31 +02:00
Sandro Santilli
52a0082ade Fix extraction of ogr LayerName from database dataset URIs
See 6c5364186d (commitcomment-19439676)
Includes testcase.

REF #15698
2016-10-17 11:55:35 +02:00
Sandro Santilli
6c5364186d Fix extraction of ogr LayerName from multi-layer dataset URIs
Adds supports for "layerid" when present.
Drop special handling for "table=" portions found in URI,
making the code more generic.

Includes testcase.

Fixes #15698 - import geodatabase to postgis via processing
2016-10-15 09:13:18 +02:00
Nyall Dawson
6605a2274f [processing] Optimise uniqueValues method
Now it uses the standard QgsVectorLayer.uniqueValues() method
where possible so that provider side optimisations are used

Also add test, and optimise request when using selected
features only
2016-10-12 17:05:15 +10:00
Nyall Dawson
05ea4be7c3 [processing] Fix inefficient values() method
Method was iterating over ever feature in a layer, including
geometries and all attributes for EVERY attribute requested

Add test and refactor so only one optimised iteration (eg no
geometry, only required attributes) is used
2016-10-12 16:56:29 +10:00
Nyall Dawson
bd7d913379 Refine QgsFeature geometry getters/setters
All pointer based methods have been removed.

Now we have only:

  void setGeometry( const QgsGeometry& geom )

and

  QgsGeometry geometry() const

Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing #777, which
has survived for over 9 years!...

Impacts on PyQGIS code:
- no more need for the messy
  g = QgsGeometry( feature.geometry() )
  workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
 using `if f.geometry():`, since QgsFeature::geometry() will
 *always* return an object. Instead, use
 `if not f.geometry().isEmpty():`, or preferably the new method
 `if not f.hasGeometry():`

Fix #777
2016-08-01 16:25:46 +10:00
Nyall Dawson
9e1ddcb54d [processing] Allow modification of feature request when using
vector.features

Allows for optimising the request through subsets of attributes
or no geometry fetching
2016-07-13 12:06:41 +10:00