22 Commits

Author SHA1 Message Date
Matthias Kuhn
28a21209b9 [sipify] seealso 2017-04-30 16:52:05 +02:00
Denis Rouzaud
1bfa539df1 [sipify] remove extra blank line 2017-04-24 07:39:30 +02:00
Denis Rouzaud
8f2a5c7c00 sipify all 2017-04-20 14:21:36 +02:00
Denis Rouzaud
56aa36e4be sipify QgsRelation 2017-04-19 15:19:14 +02:00
Matthias Kuhn
741e11df97 Add missing sip bindings 2017-02-20 09:06:02 +01:00
Matthias Kuhn
7e6695b0a0 Expose QgsRelation to QML
API changes for consistency:
  - setRelationName has been renamed to QgsRelation::setName
  - setRelationId has been renamed to QgsRelation::setId
2017-02-20 08:45:54 +01:00
Tudor Bărăscu
783fae1bc9 fix setRelationId description 2017-01-16 13:22:43 +02:00
Patrick Valsecchi
31a1c23903 Add auto-discovery of relations for PostgresQL
Fixed the add relation functionnality: the table is sorted. When the code
was setting the sorted column, the row was sorted and the other columns it was
setting were set on the wrong row.
2016-09-27 16:36:33 +02:00
Nyall Dawson
4cfacf14e3 Make API more consistent
- rename methods with XML to Xml, CRS to Crs, WMS to Wms, ID to Id
- rename methods with SRS to Crs
- rename methods with abbreviations like "dest" to "destination"
- rename methods with abbreviations like "src" to "source"
2016-07-21 08:40:50 +10:00
Nyall Dawson
307aabd66a [FEATURE] Aggregates for expressions
This commit adds a number of different forms of aggregates to
the expression engine.

1. Aggregates within the current layer, eg sum("passengers")
Supports sub expressions (ie sum("passengers"/2) ), group by
( sum("passengers", group_by:="line_segment") ), and optional
filters ( sum("passengers", filter:= "station_class" > 3 ) )

2. Relational aggregates, which calculate an aggregate over
all matching child features from a relation, eg
relation_aggregate( 'my_relation', 'mean', "some_child_field" )

3. A summary aggregate function, for calculating aggregates
on other layers. Eg aggregate('rail_station_layer','sum',"passengers")
The summary aggregate function supports an optional filter,
making it possible to calculate things like:

aggregate('rail_stations','sum',"passengers",
  intersects(@atlas_geometry, $geometry ) )

for calculating the total number of passengers for the stations
inside the current atlas feature

In all cases the calculations are cached inside the expression
context, so they only need to be calculated once for each
set of expression evaluations.

Sponsored by Kanton of Zug, Switzerland
2016-05-17 10:53:25 +10:00
Nyall Dawson
d823be1ede Add some clarifications to QgsRelation api 2016-05-07 21:49:31 +10:00
Juergen E. Fischer
a90be95f7b sip sync 2016-02-14 03:50:49 +01:00
Nyall Dawson
c3a57434d9 Fix clazy 'pass small and trivially-copyable type by value' warnings 2016-02-02 19:47:21 +11:00
Nyall Dawson
881074b194 Boost coverage of SIP bindings
Now all classes and members are either exposed to bindings or marked
as "not available in Python bindings" in the docs.

Drop test thresholds to 0. Now it should be much easier to determine
what missing members have been added which are causing test
failures.
2016-01-05 11:16:15 +11:00
Matthias Kuhn
bffb3a5d7f python bindings for ebc9e029 2015-11-30 14:42:50 +01: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
Matthias Kuhn
1e6f673a23 Update email address 2015-08-30 13:00:15 +02:00
Matthias Kuhn
d01424ae4b Add QgsRelation::getReferencedFeature to access parent feature 2015-07-24 18:57:24 +02:00
Nyall Dawson
c3ec4b9eb0 [FEATURE][composer] Add option for showing child features from a relation
for attribute tables in the composer. If selected, the attribute table
will show all related features to the current atlas feature within
the table body. Sponsored by City of Uster, Switzerland.
2014-09-22 22:59:20 +10:00
Matthias Kuhn
1b205be604 Fix python bindings for QgsRelation.fieldPairs() 2014-08-18 14:56:45 +02:00
Juergen E. Fischer
c4c131ef75 sip sync 2014-05-27 23:32:42 +02:00
Matthias Kuhn
dc3b56a13c Add relations capabilites and widgets 2013-10-07 16:17:43 +02:00