1859 Commits

Author SHA1 Message Date
Nyall Dawson
fe3417b5ef Partial revert of 70bff3f
Commit was causing crashes in browser. Refs #13738
2015-11-05 21:23:04 +11:00
elpaso
954b39d389 [FEATURE] store python init code into the project
Adds an option and code editor to store python form
init code into the project (and the DB, since it's in
the style section)
2015-11-04 18:03:27 +01:00
elpaso
e69bebdda0 Added /Out/ to run 2015-11-04 18:02:13 +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
Nyall Dawson
556d87a86c Fix some clang warnings 2015-11-02 18:07:16 +11: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
7842391eba Add some missing consts to operators 2015-10-28 09:47:44 +11:00
Nyall Dawson
fe221d54bf Don't return QStrings by reference, since they're implicitly shared
anyway
2015-10-28 09:47:44 +11:00
Nyall Dawson
f1633a1796 Change all signals to use const refs for non trivial objects 2015-10-26 22:46:25 +11:00
Nyall Dawson
70bff3f6aa Finish flipping a lot of methods to take const references for
non-trivial types
2015-10-26 22:46:14 +11:00
Matthias Kuhn
cd0eb05ded [py3] Some compatibility fixes for python 3 2015-10-24 13:47:32 +02:00
Juergen E. Fischer
bf64f8d0a0 spelling fixes and indentation update 2015-10-22 21:56:54 +02:00
Juergen E. Fischer
0559939725 partly revert 3e0badc (fixes #13645 and #13646) 2015-10-22 01:14:42 +02:00
Juergen E. Fischer
4cdf05f90f fix typo 2015-10-19 23:54:01 +02: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
Juergen E. Fischer
cc9c789760 avoid on duplicate user functions (fixes #13579) 2015-10-18 00:27:28 +02:00
Juergen E. Fischer
3e0badcb55 Fix sip conversion from QgsFields to QList<QgsField> (fixes #9208) 2015-10-17 22:03:03 +02: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
fab5a32d9a Fix geometry casting in python bindings (missing MultiLineString and
GeometryCollection casts)
2015-10-17 15:02:11 +11:00
Nyall Dawson
2e1d2d1862 Fix calculation of area/length of mixed geometry collections 2015-10-16 21:38:13 +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
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
53c507d3a7 db manager: add credentials to postgis rasters (fixes #13594) 2015-10-13 22:54:01 +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
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
mhugent
c7b9fa646b Merge pull request #2353 from manisandro/geos_snap
Replace GEOS C++ dependency with hand-rolled snap-to-grid implementation
2015-10-12 10:50:36 +02:00
Juergen E. Fischer
8e2b791092 case-sensitivity of vector layer field (fixes #13032)
* fieldNameIndex: resort to case-insensitive lookup only if
  case-sensitive lookup has no match
* file writer: fix handling of fields that only differ by case
2015-10-11 22:42:28 +02:00
Nyall Dawson
a784d6bc3d If svg files with params do not have a default value set, then don't
reset the fill/border color and border width when changing svg
marker/svg fill SVG files

This change makes the behaviour consistent between the svg marker
symbol and the other marker symbols. Additionally, svg files
which have customisable colors and NO default values set will
be shaded in gray fill/black outline in the svg selector widget,
to follow the same behaviour as the other marker symbol selectors.

Note that this change has NO EFFECT unless the svg files are
modified to remove the default param value, so there will be no
change for users' custom symbols. A follow up commit will need
to remove the default param values from the preinstalled SVG
files though. If you want to test in the meantime, I've modified
just the first two symbols in the accomodation group to make
this change for testing.

(refs #10908)
2015-10-11 23:00:01 +11:00
Nyall Dawson
d72587f436 Fix Coverity issues:
- uninitialized members
- memory leaks
2015-10-10 13:25:58 +11:00
Nyall Dawson
4925a54f35 Followup e5ea5ff, better API 2015-10-09 20:35:28 +11:00
Nyall Dawson
b55708ec7b Fix doxygen warning 2015-10-09 06:52:04 +11: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
3520f038dd Fix missing sip bindings for renderers (fix #13545) 2015-10-08 23:47:51 +11:00
Nyall Dawson
e5ea5ff89a Fix add ring/fill ring tool works on first polygon (fix #13069)
Now the tools will prefer to operate on selected features first.
Improves editing of overlapping features.
2015-10-08 23:33:58 +11:00
Nyall Dawson
45a6f715b3 Fix fill ring tool creates more features than needed (fix #13354) 2015-10-08 22:40:58 +11:00
Sandro Mani
c927073e20 Add some docstrings 2015-10-08 11:28:32 +02:00
Nyall Dawson
dcbe0d370e Fix legends are empty if presets used with filtered legend (fix #13300) 2015-10-08 07:57:21 +11:00
Juergen E. Fischer
3dcabfb57c fix windows build (followup c49b5b7) 2015-10-07 11:36:15 +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
Nyall Dawson
0caf944747 Misc optimisations identified by clazy:
- call reserve on container classes where applicable
- make sure Q_FOREACH uses references
- remove dynamic casts to base classes
- fix some implicit bool conversions
2015-10-05 18:43:18 +11:00
Juergen E. Fischer
c3b027121a debian packaging update and typo fix 2015-10-05 00:17:05 +02:00
Nyall Dawson
e553a79256 [composer] Fix image size/resolution was not honored during export (fix #13438) 2015-10-05 08:21:36 +11:00
Juergen E. Fischer
7408151916 remove whatsnew from api and install (followup 95c377a) 2015-10-04 09:51:00 +02:00