2886 Commits

Author SHA1 Message Date
Alexander Bruy
14c930a5a8 [API][network analysis] move network analysis into analysis library to
be consistent with other analysis stuff
2016-11-21 16:47:24 +02:00
nirvn
cc985c2318 use temporary memory db for style tests (avoids clash with default symbols) 2016-11-20 10:20:54 +07:00
nirvn
8fcf8345bd tests for two additional QgsStyle functions: tag() & symbolHasTag() 2016-11-18 14:14:16 +07:00
Nyall Dawson
e624518e00 Merge pull request #3755 from nirvn/style_manager_upgrade
[FEATURE] Style management re-work and upgrade
2016-11-17 12:40:52 +10:00
Nyall Dawson
1da400a99d Rename enum values for consistency 2016-11-17 09:04:19 +10:00
Nyall Dawson
9ee7873572 Allow showing additional items in QgsMapLayerComboBox
These may represent additional layers such as layers which
are not included in the map layer registry, or paths to
layers which have not yet been loaded into QGIS.
2016-11-17 09:04:19 +10:00
Nyall Dawson
ec49341f85 Allow showing CRS in QgsMapLayerComboBox 2016-11-17 09:04:19 +10:00
Nyall Dawson
959f97f682 Allow not set choice in QgsMapLayerComboBox 2016-11-17 09:04:19 +10:00
Nyall Dawson
60bbd09339 Avoid double-evaluating postgres default values 2016-11-16 14:19:24 +01:00
Nyall Dawson
249c8dca20 Prioritise provider default literals over reused values when
creating a new feature
2016-11-16 14:19:24 +01:00
Nyall Dawson
b5864cd432 [FEATURE] Improve handling of defaults (inc provider default clauses,
literal defaults, and qgis expression defaults) and automatically
handle unique value constraints on layers

Add a new method QgsVectorLayerUtils::createFeature which returns
a new feature which includes all relevant defaults. Any fields
with unique value constraints will be guaranteed to have a value
which is unique for the field.

Currently only in use by the split feature tool.

Sponsored by Canton of Zug and the QGEP project
2016-11-16 14:19:24 +01:00
Nyall Dawson
747097d43d New method QgsVectorLayerUtils::createUniqueValue
Returns a new unique attribute value for a layer. For numeric
fields this is the max attribute value + 1, for strings we
attempt to create a unique value by append _1, _2, etc to either
a specified 'seed' value, or failing that to the end of the
value of that field from the first feature in the layer.
2016-11-16 14:19:24 +01:00
Nyall Dawson
4682eaf6eb Add QgsVectorLayer::uniqueStringsMatching() to retrieve
a list of unique strings matching a substring for a field
2016-11-16 14:19:24 +01:00
Nyall Dawson
3242321aa9 [FEATURE] Add method to get list of unique strings matching
a substring from a vector data provider

Base implementation iterates through all features, but
providers can override with optimised versions. Native
implementations for postgres, spatialite and OGR included.
2016-11-16 14:19:24 +01:00
Matthias Kuhn
f18d1c3083 Rename listActions to actions and fix test 2016-11-16 09:33:19 +01:00
Matthias Kuhn
a6eb7b6281 Convert action ids to uuid 2016-11-16 09:33:19 +01:00
nirvn
5e487cfea4 [FEATURE] Style management re-work and upgrade
- A new favorite grouping system was added, which the symbols list
widget defaults to
- The selected tag / smartgroup in the symbols list widget now
persists when switching layers (and across sessions)
- The symbols list widget will update the tag / smartgroup combo
box when users add / rename / remove categories
- Users can now directly tag, as well as add to favorites, symbols
while saving those to the style database
- To streamline style management, groups have been removed and
fully replaced by tags
- Tags have been integrated into the import/export user interface
2016-11-16 14:12:19 +07:00
Nyall Dawson
6727ea78bd Merge pull request #3764 from nyalldawson/cache_fix2
Cache fixes
2016-11-16 10:38:47 +10:00
Denis Rouzaud
a373f95707 [FEATURE] add functionnality to copy/move feature to move feature map tool 2016-11-15 11:28:47 +01:00
Nyall Dawson
8f8624a333 Improve test debugging 2016-11-15 14:03:49 +10:00
Nyall Dawson
b5c1d0f24e QgsCacheIndexFeatureId can also handle non-FilterFid requests
in certain circumstances

On behalf of Faunalia, sponsored by ENEL
2016-11-15 14:03:49 +10:00
Nyall Dawson
5e3d8fe0b6 Use cached feature iterator if cache has all needed features
Previously a cached feature iterator would only be returned
if cache was either full or used a cache index

On behalf of Faunalia, sponsored by ENEL
2016-11-15 14:03:48 +10:00
Nyall Dawson
afd5d1e934 Recognise that a cache can be filled using a FilterNone request
On behalf of Faunalia, sponsored by ENEL
2016-11-15 14:00:13 +10:00
Nyall Dawson
85c8c97d5f Allow empty field name ('not set' option) in QgsFieldModel, QgsFieldComboBox 2016-11-15 07:00:35 +10:00
Martin Dobias
968e02d6fe Propagate layer/group name changes in the layer tree (fixes #15844) 2016-11-14 19:57:00 +08:00
Nyall Dawson
1f81a7c4fc [FEATURE] pole_of_inaccessibility expression function
Exposes calculation of pole of inaccessiblity to expression
engine
2016-11-14 15:52:41 +10:00
Nyall Dawson
b44093914b Fix test failure, report distance from pole 2016-11-14 15:52:41 +10:00
Nyall Dawson
d6f09c012e [FEATURE] Add method to calculate pole of inaccessibility for polygons
Implements a method in QgsGeometry and a processing algorithm to
calculate the pole of inaccessibility for a surface, which is the
most distant internal point from the boundary of the surface. This function
uses the 'polylabel' algorithm (Vladimir Agafonkin, 2016), which is an iterative
approach guaranteed to find the true pole of inaccessibility within a specified
tolerance. More precise tolerances require more iterations and will take longer
to calculate.
2016-11-14 15:52:41 +10:00
Nyall Dawson
d5c307eb05 Add method to find distance from a point to a poylgon's boundary 2016-11-14 15:52:41 +10:00
Martin Dobias
d729951dcd Remove caching of WKB from QgsGeometry (was kept just for compatibility)
Also improves the API to export/import WKB as QByteArray
2016-11-14 13:36:12 +08:00
Nyall Dawson
fbc12a8a81 Allow showing 'not set' in QgsProjectionSelectionWidget 2016-11-13 20:34:35 +10:00
Alessandro Pasotti
fb124baaf6 Merge pull request #3751 from elpaso/downloader_master
[bugfix][forwardport] File downloader for identify dialog hyperlinks
2016-11-11 17:42:56 +01:00
Alessandro Pasotti
4e96912c91 [bugfix][forwardport] File downloader for identify dialog hyperlinks
fixes #14703

Include C++ and Python tests

Travis won: ported all test cases to Python
and disabled C++ companion test (still useful locally and
for debugging)

For the curious: QTemporaryFile is not working as expected

Moved to Qt5 new style signals

Disabled C++ test and connected cancel to progress

Make string comparison on SSL errors more robust
2016-11-11 17:26:33 +01:00
Nyall Dawson
1ef7ed53c9 Merge pull request #3703 from aaime/svg_params
Export parametric SVG, will fallback symbols for the systems that cannot understand them
2016-11-11 13:25:48 +10:00
nirvn
6b2b4c578a [FEATURE][expression] strpos() and regexp_match() improvements
- strpos() now relies on a simple string within a string search
- regexp_match() now returns pos of a matching regular expression
2016-11-10 11:55:20 +07:00
Nyall Dawson
e40d64f9d5 Make provider default value clauses exempt from unique constraint checks
Otherwise the check fails when the provider has a default value clause
like 'nextval(...)' even though the actual committed value will be
unique.
2016-11-08 12:54:31 +10:00
Nyall Dawson
8cd810ed2c Return false from QgsVectorLayer::addFeatures if adding features failed 2016-11-08 12:54:25 +10:00
Nyall Dawson
fcb6c2bb9a Fix some incorrect return values from QgsFeature python bindings 2016-11-08 12:54:19 +10:00
Nyall Dawson
6f3b0caa81 Add method to QgsAttributes to convert to QgsAttributeMap 2016-11-08 11:25:48 +10:00
Nyall Dawson
32b1603c81 Update indentation 2016-11-08 08:57:51 +10:00
Nyall Dawson
f8bda8dbfc Avoid crash in testqgsexpression.cpp 2016-11-08 08:42:27 +10:00
Nyall Dawson
ec55161866 Avoid lazy evaluation for substr expression function
Better solution is to set handlesNull to true to avoid the default
null parameter = null result behaviour, and handle null values
in params 1 and 2 manually
2016-11-08 08:42:22 +10:00
nirvn
0fbcc4b95d [FEATURE] upgrade the substr() function
- support negative start value (e.g. substr('hello',-2) returns 'lo')
- support negative length value (e.g. substr('hello',3,-1) returns 'll')
- length parameter now optional, defaults to end of string
  (e.g. substr('hello world',7) returns 'world')
2016-11-08 08:42:17 +10:00
Nyall Dawson
b0bd61f308 [FEATURE] Detect default literal values from OGR layers
Requires GDAL >= 2
2016-11-08 08:18:16 +10:00
Nyall Dawson
0ae610c5e3 [FEATURE] Detect literal default values for spatialite provider 2016-11-08 08:18:16 +10:00
Nyall Dawson
1fea20de50 Split handling of literal default values from provider side
default value SQL clauses

QgsVectorDataProvider now has two methods:

- defaultValueClause: returns SQL fragment which must be evaluated
by the provider to obtain the default value, eg sequence values
- defaultValue: returns the literal constant default value
for a field
2016-11-08 08:18:16 +10:00
Nyall Dawson
3c530a62e5 Merge pull request #3723 from nirvn/regexp_matches
[FEATURE] add regexp_matches() function
2016-11-07 14:34:27 +10:00
nirvn
1d245b2ef6 [FEATURE] add regexp_matches() function
The new function returns an array of strings captured by capturing
groups in a supplied regular expression. For e.g., the following
expression: regexp_matches('qgis=>rocks','(.*)=>(.*)')
will return the following array: 'qgis', 'rocks'.
2016-11-07 10:47:19 +07:00
Nyall Dawson
8acc286b0f [FEATURE] Snap to layer algorithm accepts a mode parameter
With a new option to prefer to snap to closest point on geometry.
The old behaviour was to prefer to snap to nodes, even if a node
was further from the input geometry than a segment. The new option
allows you to snap geometries to the closest point, regardless
of whether it's a node or segment.
2016-11-07 12:20:59 +10:00
Nyall Dawson
983fe24806 Port some API from QgsPoint to QgsPointV2 2016-11-07 12:20:59 +10:00