1667 Commits

Author SHA1 Message Date
Juergen E. Fischer
e497e8b1c0 fix precise build 2015-11-04 08:30:27 +01:00
Nyall Dawson
da942233e7 Add DE-9IM variant which tests against a specified pattern
(available in PyQGIS/expression engine)
2015-11-04 16:03:55 +11:00
Nyall Dawson
9e84fcafd8 Followup 2ac5933 with more data defined fixes
2ac5933 fixed the regression in 2.12, but there were more underlying
issues from <2.8 causing sub symbols with data defined properties
to be ignored.

Add some tests.

(refs #13707)
2015-11-04 16:03:46 +11:00
Hugo Mercier
d16cdcf449 Add more options for filtering legend elements
This introduces two new options to filter legend elements:
- filter by expression: a boolean expression can be set. Only symbols of
features that make the expression evaluated to true will be kept in the legend
- filter by polygon: only symbols of features that are inside the given
polygon will be part of the legend.

The polygon filtering is used in particular for a new option in the
composer legend that allows to filter out anything that is not included
in the current atlas polygon.
2015-11-03 10:39:09 +01:00
rldhont
a9e567060d [QGIS-Server] Test: more ISO compatibility for WxS capabilities 2015-11-02 22:24:42 +01:00
Radim Blazek
f3d9e752b2 [GRASS] added (disabled) test for #13739 2015-11-02 19:42:54 +01:00
Landry Breuil
03eaafe603 Fix build on 32-bits archs using LL for large constants 2015-11-02 11:49:01 +01:00
Nyall Dawson
c445ac1eef Fix expression get_feature function was not fetching feature's
geometry

Fix #13695
2015-11-02 20:40:29 +11:00
Matthias Kuhn
353c0db745 Add test for filter expression on non provider fields 2015-11-02 10:13:31 +01:00
Nyall Dawson
4f7509530a Remove some unnecessary trailing ;
(Gets rid of annoying squiggle warnings from Qt Creator!)
2015-11-02 18:07:04 +11:00
Nyall Dawson
b7e1cae4f0 Switch double quoted single character to single quotes for some
QString methods

Using single quotes is a significant performance boost. Rough
benchmarks indicate the QString single quote methods take
about 15% of the time the double quote variants take.
2015-11-02 17:55:08 +11:00
Radim Blazek
5f9611e37c [GRASS] add test for #13726 (new line attributes lost) 2015-11-01 21:01:23 +01:00
Radim Blazek
968e55cb11 [GRASS] fixed test 2015-11-01 20:24:14 +01:00
Nyall Dawson
2b17c2283d Add tests for get_feature expression function 2015-10-31 16:58:53 +11:00
Radim Blazek
16e902b3c1 [GRASS] coverity fixes 2015-10-30 11:20:21 +01:00
Juergen E. Fischer
d9c8e73fa2 'fix' PyQgsRulebasedRenderer test (followup 08185c9a) 2015-10-29 15:21:05 +01:00
Juergen E. Fischer
0799e09a67 fix qgsauthmanager test on windows 2015-10-28 01:08:10 +01:00
Nyall Dawson
fc49f8dfa9 Add test for coverage of SIP bindings
Not perfect, but good for a quick warning if a new class or member
has been added to the public API without Python bindings. The test
only considers the name of members, since it seems to be impossible
to test for the signature of a Python member. (So adding a new
overloaded method without bindings will still unfortunately pass).

You can avoid the test where bindings are not applicable:
- for a whole class by placing "@note not available in Python bindings"
in the class' Doxygen comments
- or by placing the @note inside a member's Doxygen comments for a
specific member

Additionally, classes which aren't included in the API docs
will not be tested.
2015-10-28 09:54:27 +11:00
Nyall Dawson
9d4e995de6 [FEATURE] Add geometry relation DE-9IM expression function 2015-10-26 22:46:53 +11:00
Nyall Dawson
f7f659be0b Avoid some clazy detaching temporary warnings 2015-10-26 22:46:05 +11:00
Nyall Dawson
d56dcdb02f Fix composer scale bar when crs units are non-meters and OTF is off (fix #13610) 2015-10-23 17:03:34 +11:00
Juergen E. Fischer
bf64f8d0a0 spelling fixes and indentation update 2015-10-22 21:56:54 +02:00
Radim Blazek
86505e0fb8 [GRASS] more edit tests 2015-10-21 20:02:22 +02:00
Hugo Mercier
c7aeb774ce PostGIS: Allow to load TIN, PS and Triangle layers
The postgres provider is modified so that layers with
TIN, PolyhedralSurface and Triangle geometries can be loaded.
Geometries are converted to MultiPolygons (and Polygons for Triangles).

The postgres test is completed to cover the loading of different types
of layers
2015-10-21 09:41:49 +02:00
Nyall Dawson
1969e09b6f Also avoid detaching QgsFields and QgsAttributes where possible 2015-10-20 20:36:08 +11:00
Nyall Dawson
9a94132fb4 Clazy issues:
- use at() instead of [] for temporary containers (at() returns
const reference, so it avoids the detach which occurs with [])
- use at( 0 ) rather than first() for containers, because first()
detaches (Qt5 introduced constFirst()/constLast() to overcome this)
2015-10-20 20:36:08 +11:00
Nyall Dawson
1c76b93d89 Fix storing string representations of doubles in an int field
results in NULL rather than converting value to int
2015-10-20 20:36:07 +11:00
Radim Blazek
483f3ee6b3 [GRASS] fixed running modules in mapsets not owned by user 2015-10-19 16:41:12 +02:00
Nyall Dawson
9319176a7c More clazy recommended optimisations:
- Use constFind instead of find where applicable
- Use midRef instead of mid
- const ref when using Q_FOREACH
- foreach->Q_FOREACH
2015-10-19 17:36:02 +11:00
Larry Shaffer
b5261619b2 [auth] Migrate more manager unit tests; add test html reporter 2015-10-18 16:40:41 -06:00
Larry Shaffer
4d44a96d19 [auth] Start full migration of Py unit tests to C++ 2015-10-18 16:40:41 -06:00
Nyall Dawson
5f1bb6cf1f Geometry fixes:
- when creating geometry from WKT, upgrade dimensionality of geometry
if coordinates are 3/4 dimensional
- match dimensionality of collections to child dimensionality
- fix area of curves was non-zero if curve is closed
- don't consider m values when testing for curve closedness
- add unit tests for closedness
- add unit tests for CircularStrings, CompoundCurves, CurvePolygon,
tests with geometries with Z/M values
2015-10-18 21:03:15 +11:00
Nyall Dawson
8c5f3f88a9 [geometry] Fix calculation of length/perimeter for collections
Split length from perimeter calculation in geometry API, as
returning perimeter for length for polygons is misleading and
results in incorrect length/perimeter calculations for mixed
geometry collections.

Enable length & perimeter unit tests against reference geometries.
Now the length & perimeter values match those calculated by
PostGIS.
2015-10-17 15:40:36 +11:00
Nyall Dawson
785d9952a0 Add a bunch of geometry unit tests against reference geometries
(inc geometry count, node count, ring count, area, centroid,
x/y min/max)

TODO:
- invesigate whether Z/M is required for GeometryCollection WKT
data type if children have Z/M dimension
- fix QGIS handling of mixing length and perimeter for collections
resulting in incorrect length calculation for mixed Collections
2015-10-17 15:02:18 +11:00
Nyall Dawson
f7550b3515 Add some more basic area and length unit test cases 2015-10-16 22:12:07 +11:00
Nyall Dawson
2e1d2d1862 Fix calculation of area/length of mixed geometry collections 2015-10-16 21:38:13 +11:00
Nyall Dawson
725f973840 Fix various Coverity errors (inc mem leaks) 2015-10-16 21:36:38 +11:00
Nyall Dawson
772ab8e249 Update test mask images 2015-10-16 17:46:22 +11:00
Nyall Dawson
55c27ce710 Add some extra unit tests for geometry:
- Add some tests for conversion to/from WKT, using a bulk lot of testsdata
from PostGIS
- Add some tests for area/length calculation, using some test data and
results from PostGIS/geos unit tests
- Add tests for spatial relations, using test data from PostGIS. Note
that this required adding support for calculating the DE-9IM relation. I'll
expose this to users via the expression engine in 2.14.

Along the way this also fixes a number of bugs relating to WKT geometry
import, such as
- add support for alternate MultiPoint(1 1,2 2,...) format
- fix GeometryCollection to support collections with multi* children
and GeometryCollection children (allowed by spec)
2015-10-16 17:46:06 +11:00
Nyall Dawson
34dc314345 Fix exporting geometry collections to WKT
Child types were incorrectly being dropped when the collection
consisted of mixed geometry types (eg line & polygon) (refs #13608)
2015-10-16 07:48:42 +11:00
Radim Blazek
0ded8553bf [GRASS] show init error in tools title 2015-10-15 12:44:10 +02:00
Nyall Dawson
5654eeca55 Fix area calculation when OTF active and no ellipsoid (fix #13601) 2015-10-15 17:51:07 +11:00
Nyall Dawson
5ed3d1b73f Use QString::arg multi argument method to avoid extra heap allocations 2015-10-15 17:51:06 +11:00
Nyall Dawson
a333fc8248 Add method to geometries for adding z/m dimension, initialized
to a specified value
2015-10-14 08:39:05 +11:00
Nyall Dawson
665379645f Add method to QgsWKBTypes to add z/m dimension to a wkb type
Also add some unit tests for QgsWKBTypes
2015-10-14 08:39:05 +11:00
Juergen E. Fischer
e225385aaa indentation update 2015-10-13 22:54:01 +02:00
Radim Blazek
9556a760da [GRASS] edit test fixed for GRASS 6 2015-10-13 12:53:02 +02:00
Radim Blazek
4bd6cf1532 [GRASS] editing test 2015-10-13 12:53:01 +02:00
Nyall Dawson
ff43a5dc1f Merge pull request #2367 from manisandro/qgsround
Introduce qgsRound since std::round is available only in C++11 onwards
2015-10-13 21:11:41 +11:00
Sandro Mani
2ddc07163d More qgsRound tests 2015-10-13 09:22:36 +02:00