6929 Commits

Author SHA1 Message Date
Nyall Dawson
2aab28380c [browser] Don't show gdal/ogr layer items for QGIS style xml files
These aren't layers, so the extra entries are just distracting noise.
2019-01-16 12:10:25 +11:00
lbartoletti
c885cd7267 add toString and repr for qgsvector 2019-01-16 01:10:33 +11:00
Peter Petrik
9aacf4bac6 fix #20316 not possible to assign mesh crs 2019-01-15 12:41:39 +01:00
lbartoletti
edadcb773f Refactoring of rectangle maptools
Adds a new geometry class QgsQuadrilateral, for 4 sided geometries.
2019-01-15 10:24:16 +11:00
Peter Petrik
cd9a84e11c [feature] [mesh] Mesh Calculator
Similarly to raster calculator, mesh calculator can take dataset groups from current mesh layer and
combine them with various aritmentic/logical operators to new dataset group.
2019-01-14 12:32:36 +01:00
Raymond Nijssen
0ba9a326ec Add API to calculate innerTangents for 2 circles 2019-01-14 05:27:19 +10:00
Nyall Dawson
ac10769809 Move method for detecting project colors to QgsProperty 2019-01-12 18:11:44 +10:00
Nyall Dawson
b0de40d9ab Fix crash on exit when project signal is emitted during project destruction 2019-01-12 18:11:44 +10:00
Nyall Dawson
f7745c94d9 Add a signal to QgsProject for when project color scheme changes 2019-01-12 18:11:44 +10:00
Matthias Kuhn
b61d6f8f90
Merge pull request #8832 from troopa81/fix_20547
fixes #20547 : Fix error when using a spatialite layer with a non-int primary key an a spatial index
2019-01-11 23:07:10 +01:00
Nyall Dawson
629de0c651 Fix some corner cases 2019-01-12 05:31:00 +10:00
Nyall Dawson
2a774d6dac [FEATURE][processing] New algorithm "Geodesic line split at antimeridian"
Ports the similar algorithm from the shape tools plugin to c++, and utilises
built in QgsDistanceArea ellipsoidal calculations to split the lines.

This algorithm splits a line into multiple geodesic segments, whenever the
line crosses the antimeridian (±180 degrees longitude)

Splitting at the antimeridian helps the visual display of the lines in some
projections. The returned geometry will always be a multi-part geometry.

Whenever line segments in the input geometry cross the antimeridian,
they will be split into two segments, with the latitude of the breakpoint
being determined using a geodesic line connecting the points either side
of this segment. The current project ellipsoid setting will be used when
calculating this breakpoint.

If the input geometry contains M or Z values, these will be linearly
interpolated for the new vertices created at the antimeridian.

Supports in-place edit mode also.
2019-01-12 05:31:00 +10:00
Nyall Dawson
021f5ea366 [needs-docs][api] Rename QgsDistanceArea methods to change "date line"
to "antimeridian"

Because the date line =/= +/-180 degree longitude, which is what
we were incorrectly using it to mean.
2019-01-12 05:31:00 +10:00
Nyall Dawson
a8bd12c4e3 [FEATURE][API] Add method to QgsDistanceArea to split a (multi)line geometry
at the antimeridian

Whenever line segments in the input geometry cross the antimeridian, they
will be split into two segments, with the latitude of the breakpoint being
determined using a geodesic line connecting the points either side of this
segment.

If the geometry contains M or Z values, these will be linearly interpolated
for the new vertices created at the antimeridian.
2019-01-12 05:31:00 +10:00
Alessandro Pasotti
4d609ff46f
Merge pull request #8830 from elpaso/bugfix-server-fcgi-rewritten-uri
[server] Use REQUEST_URI as default URL for FCGI requests
2019-01-11 15:58:26 +01:00
Julien Cabieces
8efc68984f Use mkdtemp for temporary directory and clean at the end of the test 2019-01-11 15:39:58 +01:00
Julien Cabieces
99076c94e4 Correct spell problems 2019-01-11 15:36:24 +01:00
Nyall Dawson
2623e605e6 Indentation 2019-01-11 22:34:34 +10:00
Nyall Dawson
e569331abb Disable linked color buttons when a project color is set for a property 2019-01-11 22:34:34 +10:00
Nyall Dawson
eecfe50dc5 [FEATURE] Show Project Colors in color bound data defined buttons
This adds a new "Project Colors" section in data defined buttons
which are linked to a color value. The color menu contains all
colors defined as part of the current project's Project Color
Scheme (which is defined through project properties).

When a project color is selected from the button, the property
becomes linked to that color. It will automatically follow any
future changes to the color when made through project properties.

This allows users to define common colors for a project once,
and then "bind" symbol, label, layout, etc colors to these
preset colors. The link is live, so you change it once, and
the change is reflected EVERYWHERE. Sure beats updating a color
100 times when it's use has been scattered throughout a project's
symbols, labels, etc...

(Basically, this is just adding a shortcut to setting a data
defined expression "project_color(...)" for the property. The
project_color function has been around a LOOONG time, but it's
only really been usable by power users before this change)
2019-01-11 22:34:34 +10:00
Nyall Dawson
938adb8c17 [api] Add PyQGIS helpers to QgsGeometry.asMultiPoint(), asMultiPolyline()
and asMultiPolygon()

- raise ValueError when these methods are called with null geometries
- raise TypeError when these methods are called with incompatible
geometry types, instead of silently returning empty lists
2019-01-11 21:31:14 +10:00
Matthias Kuhn
2664737fc2
Merge pull request #8827 from m-kuhn/gpkg_transaction_test
sqlite_fetch_and_increment cached mode for transactions
2019-01-11 12:26:33 +01:00
Julien Cabieces
06bf5a99db add unit test 2019-01-11 12:04:23 +01:00
Matthias Kuhn
ccdd133c8b
Fix test linking 2019-01-11 10:30:54 +01:00
Nyall Dawson
fdfe0cee23 [api][needs-docs] Allow registering PyQGIS using a nice decorator syntax
This allows nice and simple, elegant construction of checks for
Python.

To use, Python based checks should use the decorator syntax:

  from qgis.core import check

  @check.register(type=QgsAbstractValidityCheck.TypeLayoutCheck)
  def my_layout_check(context, feedback):
    results = ...
    return results

Or, a more complete example. This one throws a warning when attempting
to export a layout with a map item set to the Web Mercator projection:

  @check.register(type=QgsAbstractValidityCheck.TypeLayoutCheck)
  def layout_map_crs_choice_check(context, feedback):
    layout = context.layout
    results = []
    for i in layout.items():
      if isinstance(i, QgsLayoutItemMap) and i.crs().authid() == 'EPSG:3857':
        res = QgsValidityCheckResult()
        res.type = QgsValidityCheckResult.Warning
        res.title='Map projection is misleading'
        res.detailedDescription='The projection for the map item {} is set to <i>Web Mercator (EPSG:3857)</i> which misrepresents areas and shapes. Consider using an appropriate local projection instead.'.format(i.displayName())
        results.append(res)

    return results
2019-01-11 09:51:04 +10:00
Nyall Dawson
fd001bbd4d [FEATURE][layouts] Add validity check to flag when a map item
has an overview which is not linked to any existing maps
2019-01-11 09:51:04 +10:00
Nyall Dawson
93bfbd00fc Astyle 2019-01-11 08:57:39 +10:00
Matthias Kuhn
dafb16654f
Add an additional test for cached mode of sqlite_fetch_and_increment 2019-01-10 10:48:05 +01:00
Matthias Kuhn
d3b4c7d83a
Add cached mode to sqlite_fetch_and_increment for transactions 2019-01-10 10:35:24 +01:00
Matthias Kuhn
c263750930
Merge pull request #8820 from m-kuhn/map_layer_template
QgsProject::mapLayer<Qgs[Type]Layer *>( layerId ); template
2019-01-10 08:06:52 +01:00
Alessandro Pasotti
cf5982c309 Add tests for QgsFcgiServerRequest rewrites 2019-01-09 18:46:32 +01:00
Matthias Kuhn
918bfef51e
Add a test for transaction save local default value generation with gpkg 2019-01-09 18:13:13 +01:00
Matthias Kuhn
e32c739b47
Make use of QgsProject::mapLayer<QgsVectorLayer *> template 2019-01-09 16:25:45 +01:00
signedav
5e61afcfe7 tests for layernodeproperty "showFeatureCount"
fixes https://github.com/opengisch/Vogelwarte_QField_2019/issues/4
2019-01-09 12:52:06 +01:00
Nyall Dawson
41757c6923 Fix build 2019-01-09 12:15:52 +10:00
Matthias Kuhn
15ddb27093
Merge pull request #8721 from signedav/json-for-valuerelations
Storing Value Releation multi-selection as JSON
2019-01-08 15:17:31 +01:00
signedav
6e91349baa json gpkg tests 2019-01-08 11:50:35 +01:00
Matthias Kuhn
af027d9d10
Add NULLIF expression function [FEATURE] 2019-01-08 10:56:34 +01:00
Nyall Dawson
0de94dd1fe [layouts] Fix incorrectly rendered item background and frame when item is
non-opaque

Fixes #20909
2019-01-08 16:24:37 +10:00
Nyall Dawson
13ac907198 latitudeGeodesicCrossesDateLine also returns fraction of segment
along which the crossing occurs
2019-01-08 12:32:50 +10:00
Nyall Dawson
e286c094d6 Fix date line breaks with non geographic input CRS 2019-01-08 12:32:50 +10:00
Nyall Dawson
654d7a4391 spelling 2019-01-08 12:32:50 +10:00
Nyall Dawson
9c7be5fa2f Unit tests for QgsDistanceArea::geodesicLine 2019-01-08 12:32:50 +10:00
Nyall Dawson
b0c3b9f781 Unit tests for QgsDistanceArea::latitudeGeodesicCrossesDateLine 2019-01-08 12:32:50 +10:00
Nyall Dawson
ebd104466e Add method to retrieve destination CRS from QgsDistanceArea 2019-01-08 12:32:50 +10:00
Nyall Dawson
2c0dc09c23 Correctly handle conversion of merged categories to rule based renderer 2019-01-08 11:10:40 +10:00
Nyall Dawson
1051f9b48d Rename some methods for consistency/clarity 2019-01-08 11:10:40 +10:00
Nyall Dawson
a6849ca257 Unit tests for unmerging 2019-01-08 11:10:40 +10:00
Nyall Dawson
63204cfdb5 Fix travis 2019-01-08 11:10:40 +10:00
Nyall Dawson
0259548ac9 Don't allow null entry to be merged 2019-01-08 11:10:40 +10:00