334 Commits

Author SHA1 Message Date
Nyall Dawson
82f4a82c66 [FEATURE][processing] New algorithm for offsetting lines 2016-08-11 08:38:43 +10:00
Juergen E. Fischer
39c4409c6a remove deprecated stuff from QgsVectorLayer and editor widgets 2016-08-10 12:12:28 +02:00
Nyall Dawson
d5516fa7e3 Merge pull request #3371 from nyalldawson/processing
[processing] New algs + a fix
2016-08-10 19:22:12 +10:00
Nyall Dawson
7da8110536 Remove deprecated methods from QgsExpression
Now all evaluate/prepare/etc methods must be called using QgsExpressionContexts

Also remove most remaining traces of special variables. This brings some
user facing changes, such that existing expressions may need to be
updated if they used these old special variables (eg $scale,
$feature). These changes are noted in doc/qgis3_user_changes.dox
so that we can include them in the release notes.
2016-08-10 17:55:06 +10:00
Nyall Dawson
142de7cb08 [FEATURE][processing] Point on surface algorithm 2016-08-10 16:57:38 +10:00
Nyall Dawson
ab022451a5 [FEATURE][processing] New algorithm for geometry boundary 2016-08-10 16:32:31 +10:00
Nyall Dawson
bd8db5d156 [FEATURE][processing] New algorithm for calculating feature bounding boxes 2016-08-10 15:41:44 +10:00
Alexander Bruy
885cc82c3c [processing] more clean in QGIS algs 2016-08-05 16:48:59 +03:00
Alexander Bruy
acdde31b3d [processing] more cleanups (follow up 06c4b07222) 2016-08-05 15:05:36 +03:00
Nyall Dawson
c1649ebef4 [processing] pendingFields() -> fields()
Does the same thing, but pendingFields() is ugly
2016-08-05 06:31:07 +10:00
Nyall Dawson
06c4b07222 [processing] Use layer crs/fields instead of provider crs/fields
Since the layer has more complete knowledge of the crs (ie, when
provider could not determine crs and user has selected it from
the list), and also better knowledge of layer fields (virtual
fields, joined fields) we should use these rather than the
provider methods.
2016-08-05 06:28:49 +10:00
Matthias Kuhn
bb79d13e82 Remove deprecated Qgis::WKBType and API cleanup (#3325)
* Remove deprecated Qgis::WKBType and API cleanup

Renames QgsWKBTypes to QgsWkbTypes

Replaces usage of the enums:

* Qgis::WKBType with QgsWkbTypes::Type
* Qgis::GeometryType with QgsWkbTypes::GeometryType

Their values should be forward compatible (a fact that was already
explited up to now by casting between the types)

Renames some SSLxxx to SslXxx and URIxxx to UriXxx

* Fix build warnings and simplify type handling

* Add a fixer to rewrite imports

* The forgotten rebase conflictThe forgotten rebase conflicts

* QgsDataSourcURI > QgsDataSourceUri

* QgsWKBTypes > QgsWkbTypes

* Qgis.WKBGeom > QgsWkbTypes.Geom

* Further python fixes

* Guess what... Qgis::wkbDimensions != QgsWkbTypes::wkbDimensions

* Fix tests

* Python 3 updates

* [travis] pull request caching cannot be disabled

so at least use it in r/w mode

* Fix python3 print in plugins
2016-08-04 09:10:08 +02:00
Nyall Dawson
d1aa03a09b Better clip for very separate features 2016-08-03 13:41:22 +10:00
Nyall Dawson
71ebdb8f69 [FEATURE] Optimise processing clip algorithm
Before the algorithm was written to optimise clipping a few
features against thousands of mask features. The revised algorithm
is optimised for clipping thousands of input features against
a few mask features.

Given that this second operation is much more likely, it makes
sense to optimise for this use case.

I've also applied some other optimisations like taking advantage
of spatial indexes on the providers, using prepared geometries
and also only applying an intersection operation if the geometry
isn't wholly contained by the mask geometry.

Benchmarks:

clipping roads layer with 1 million lines against 2 polygons

before: 5 mins 30 seconds
after: 10 seconds

clipping address layer with 5 million points against 2 polygons

before: 50 minutes
after: 30 seconds
2016-08-03 13:15:03 +10:00
Nyall Dawson
60147e8147 Remove use of constGeometry 2016-08-02 13:50:59 +10:00
Nyall Dawson
bb54b4f41a [FEATURE] Make processing dissolve algorithm accept multiple fields
This allows you to dissolve based on more than one field value
2016-08-02 11:54:02 +10:00
Nyall Dawson
0455b6600d [processing] Fix multipart to singlepart handling of null geometry 2016-08-02 11:53:11 +10:00
Nyall Dawson
ccfd4c36be [processing] Add test for dissolve using field values 2016-08-02 11:52:37 +10:00
Nyall Dawson
30fcaed634 [FEATURE][processing] New algorithm for merging connected lines
This algorithm joins all connected parts of MultiLineString
geometries into single LineString geometries.

If any parts of the input MultiLineString geometries are not
connected, the resultant geometry will be a MultiLineString
containing any lines which could be merged and any non-connected
line parts.
2016-08-02 11:51:44 +10:00
Nyall Dawson
b7ca001c9c Add __nonzero__ and __bool__ methods to QgsGeometry 2016-08-02 08:39:58 +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
Alexander Bruy
2fbb617d61 [processing] also fix case without dissolving 2016-07-22 15:43:04 +03:00
Alexander Bruy
9976c30c9a [processing] fix buffer tool 2016-07-22 15:37:16 +03:00
Nyall Dawson
1a2231f10c Rename QGis class to Qgis, for capitalisation consistency 2016-07-21 22:01:38 +10:00
Matthias Kuhn
143cfab104 [processing] Difference: don't ignore invalid geometries by default
Fix #9297
2016-07-04 00:43:36 +02:00
Alexander Bruy
1b60b088a2 [processing] support more field types 2016-06-27 14:18:31 +03:00
Alexander Bruy
87fea73647 [processing] add support for longlong fields in spatial join alg (fix #15072) 2016-06-24 15:10:49 +03:00
Alexander Bruy
e0c9733f64 [processing] speedup Hub distance algorithm (fix #15012) 2016-06-21 16:56:21 +03:00
Alexander Bruy
aa9fe9ecd0 Merge pull request #3118 from arnaud-morvan/processing_gdal_postgis_credentials
[processing] support postgis service parameter and credentials input
2016-06-14 15:19:03 +03:00
Alexander Bruy
0553f7b33b [processing] allow 2.5D geometries (fix #14929) 2016-06-13 11:44:08 +03:00
Alexander Bruy
48949d642f [processing] improve error message text (refs #14929) 2016-06-10 15:30:03 +03:00
nirvn
14342ce65a [processing] fix missing quotes to field name in refactor fields 2016-06-05 09:32:51 +07:00
arnaud.morvan@camptocamp.com
8ddae27130 [Processing] Support authentication with postgis 2016-06-03 17:09:31 +02:00
Nyall Dawson
3a005cda36 Indentation 2016-06-02 08:50:27 +10:00
Alexander Bruy
57b16187e6 [processing] move spatialite and postgis utils into tools package 2016-06-01 14:15:46 +03:00
Alexander Bruy
cc7eb27a27 [processing] drop WebView dependency (follow up 38f6ace4c0) 2016-05-27 20:38:51 +03:00
volaya
f4ca847660 [processing] do not exit loop in intersect if there are errors
fixes #14908
2016-05-27 11:27:24 +02:00
Alexander Bruy
33977d16dd [processing] add option to force singlepart geometry type to postgis import (fix #14889) 2016-05-27 11:25:22 +03:00
Alexander Bruy
d783635a40 [processing] homogenize spatial index name with DB Manager (fix #14899) 2016-05-26 16:13:46 +03:00
Alexander Bruy
322da8b2cf Merge pull request #3105 from volaya/processing_cleanup
[processing] cleanup and improvements
2016-05-25 20:42:17 +03:00
Alexander Bruy
dadc9d2057 fix typo 2016-05-24 19:59:07 +03:00
Alexander Bruy
8ad1e3c8bc [processing] add ability to choose encoding when importing into PostGIS (fix #14687) 2016-05-24 19:32:58 +03:00
volaya
2eebe0d314 [processing] additional mechanism to add scripts from 3rd party plugin 2016-05-23 19:36:16 +02:00
Alexander Bruy
6207412bf7 [processing] restore CreateConstantRaster algorithm (fix #14860) 2016-05-23 12:41:45 +03:00
Nyall Dawson
1767d3b073 [processing] Use QgsVectorLayer::selectByExpression for select by expression alg 2016-05-19 10:40:18 +10:00
volaya
f001ac11f7 [processing] fixed repaint in set vector style algorithm 2016-05-18 14:24:45 +02:00
arnaud.morvan@camptocamp.com
7847f971d4 Processing - Adapt RefactorFields to work on tables as well as vector layers 2016-05-17 14:16:16 +02:00
Matthias Kuhn
0d165e5621 Merge pull request #3058 from arnaud-morvan/processing_postgis_errors
Processing - Fix unicode/str error in postgis_utils
2016-05-11 12:30:14 +02:00
arnaud.morvan@camptocamp.com
66b1416dfe Processing - Fix unicode/str error in postgis_utils 2016-05-11 11:27:58 +02:00
Harrissou Sant-anna
cf45742fe8 use same icons as in other dialogs for this task 2016-05-09 07:02:30 +02:00