1639 Commits

Author SHA1 Message Date
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
Nyall Dawson
ad10b5264e Fix using add part tool to add part to geometryless rows
(fix #12885, #11319)

Also fix some potential crashes with edit tools and null geometry
2015-10-13 16:59:52 +11:00
Sandro Mani
a9baeb114b Add some qgsRound tests 2015-10-12 23:58:37 +02:00
Nyall Dawson
ec9fd86d30 Add missing mask from previous commit 2015-10-12 21:57:01 +11:00
Nyall Dawson
b93f2eacbe Follow up c7b9fa, fix failing tests
Looks like there's a label in the test which is placed right on the
boundary of the map, so the geos changes in c7b9fa have shifted it
slightly off the canvas and resulted in it not being drawn.

Update test mask images so this label is optional.
2015-10-12 21:56:31 +11:00
Nyall Dawson
f9559003d4 Really fix #13545
I'm not sure what sip voodoo is preventing the bindings from
calling methods in the base class, so for QGIS <3.0 I've aliased
all the new signatures and will rename them back for 3.0
2015-10-12 21:56:30 +11:00
Nyall Dawson
ae85376614 Fix refining rule based renderer using expression (fix #10815) 2015-10-12 21:01:09 +11:00
Nyall Dawson
160f172b42 Flip some QStrings to QLatin1String where they may be faster 2015-10-12 18:38:45 +11:00
Nyall Dawson
52f0b5b612 Bump acceptable doc coverage 2015-10-12 18:38:37 +11:00
Nyall Dawson
1aefa17fbd Update TestQgsLabelingEngineV2 to use render checker, reenable on Travis 2015-10-12 18:38:29 +11:00
Nyall Dawson
ecbd691ca4 Followup 8e2b791, add unit test 2015-10-12 09:14:20 +11:00
Nyall Dawson
80ccb39ae5 More test mask updates. Also disable qgis_labelingenginev2 on Travis
qgis_labelingenginev2 needs to be refactored to use QgsRenderChecker.
Directly comparing the two images is too fragile due and is failing
on Travis.
2015-10-10 22:07:39 +11:00
Nyall Dawson
4eb53d366a Update test mask images 2015-10-10 21:21:21 +11:00
Juergen E. Fischer
b11b73cbbe fix precise build 2015-10-09 08:03:44 +02:00
Nyall Dawson
d1be2ff214 Fix hardcoded border for raster legend items (fix #13540)
Previously raster legend items always had a fixed black border.
Now there's options to change the color/width of this border or
disable it entirely.
2015-10-09 06:12:37 +11:00
Nyall Dawson
dcbe0d370e Fix legends are empty if presets used with filtered legend (fix #13300) 2015-10-08 07:57:21 +11:00
Radim Blazek
e223bccde5 [GRASS] initial editing test 2015-10-07 14:57:06 +02:00
Nyall Dawson
c6df096c38 Followup c49b5b7, more fixes 2015-10-07 18:32:24 +11:00
Nyall Dawson
c49b5b777f Change a lot of arguments to const references in core/gui
Rationale:
- there was a lot of large objects passed by value, so potentially
there's a speed bump from this
- even for implicitly shared classes like QString/QList there's still
a (small) cost for copying the objects when there's no reason to
- it's the right thing to do!
2015-10-07 12:02:04 +11:00
Juergen E. Fischer
ac3f390dfe restore behavior of QgsGeometry::combine on line strings (fixes #13274) 2015-10-05 23:25:06 +02:00
Radim Blazek
32e6d9c564 [GRASS] removed warnings from raster provider 2015-10-05 14:25:50 +02:00
Juergen E. Fischer
1b4ca622c9 add cppcheck fixes 2015-10-03 21:57:17 +02:00
Nyall Dawson
0587a59b39 Only save effect element if it is non-default
(decreases file size of qgs project files)
2015-10-01 06:54:59 +10:00
Martin Dobias
1c877f116c Fix another crash with rule-based labeling + data-defined properties (fixes #13453)
The writing of data-defined properties to XML was using invalid data.
Also fixes a possible memory leak in assignment operator.
Thanks Nyall for help tracking it down!

This code has been funded by Tuscany Region (Italy) - SITA (CIG: 63526840AE) and commissioned to Gis3W s.a.s.
2015-09-30 12:36:44 +08:00
Nyall Dawson
fea4ed9926 Store layer list in canvas order for visibility presets, fixes
data defined style preset for composer maps changing layer
order
2015-09-30 07:11:37 +10:00
Nyall Dawson
fefd85adef Fix some leaks 2015-09-28 18:42:24 +10:00
Larry Shaffer
dd9b37b4c9 [auth] Skip unit tests if qca-ossl plugin is missing 2015-09-26 02:01:15 -06:00
Nyall Dawson
228d816b3b Merge pull request #2330 from boundlessgeo/master-2_11-auth-system
Authentication configuration system with master password
2015-09-26 05:45:28 +10:00
Nyall Dawson
dd759370bd [FEATURE][composer] Option to restrict image/SVG outputs to content
If selected, then the images output by composer will include only
the area of the composition with content. There's also an option
for margins to add around the item bounds if required.

If the composition includes a single page, then the output will
be sized to include EVERYTHING on the composition. If it's a
multi-page composition, then each page will be cropped to only
include the area of that page with items.

A new image export options dialog has been added to facilitate
this, which also includes handy shortcuts for overriding the
print resolution or exported image dimensions.

Sponsored by NIWA
2015-09-25 18:55:35 +10:00