6820 Commits

Author SHA1 Message Date
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
Nyall Dawson
7b245d1857 [FEATURE] Add option to merge categories in categorized renderer
This allows users to select multiple existing categories and
group them into a single category, which applies to any of the
values from the selection.

This allows simpler styling of layers with a large number of
categories, where it may be possible to group numerous distinct
categories into a smaller, more managable set of categories
which apply to multiple values.

The option is available from the right click context menu
in the categories list view, whenever multiple categories
are selected.

Sponsored by SMEC/SJ
2019-01-08 11:10:40 +10:00
Nyall Dawson
d32714c899 [API] Allow categorized renderer category values to be lists of values
When a category is a list of values, that category will apply to
any of the values from the list
2019-01-08 11:10:40 +10:00
signedav
627ac66d73 add jsonb tests and fixed count 2019-01-07 15:26:26 +01:00
Alessandro Pasotti
1ba6b97f74
[server] Fix layer order rendering when layers are in groups (#8796)
* [server] Fix layer order rendering when layers are in groups

Fixes #20810

* Update test images

* [server] Fix order of layers in subgroups

basically: layers in WMS is specified in a comma separated
list where leftmost layer is drawn first (it's at the bottom)
and QGIS layer order is exactly the opposite: first layer
in the TOP (topmost) is drawn last (it is at the top).

For this reason the server reverses the list before passing
it to the renderer.

* Fix order of layers in test

* Update src/server/services/wms/qgswmsrenderer.cpp
2019-01-07 13:13:30 +01:00
signedav
ae1ab67b6c prepared tests for gpkg - not yet active 2019-01-07 11:39:48 +01:00
signedav
e9e7c397e9 add author and reader tables to test valuerelations with json 2019-01-07 11:39:48 +01:00
signedav
95c9279165 tests for json in postgres
only reading not writing possible because of pg implementation
2019-01-07 11:37:57 +01:00
mhugent
54a5fae0b7
Merge pull request #8781 from mhugent/get_atlas_print
[server][needs-docs] Get atlas print
2019-01-07 10:42:23 +01:00
Matthias Kuhn
0c71e720a3
JSON Support for GeoPackage [FEATURE]
Merge pull request #8707 from signedav/json-for-gpkg
Integration of JSON type of GeoPackage
2019-01-07 10:35:30 +01:00