6568 Commits

Author SHA1 Message Date
Nyall Dawson
34c217cd46 Fix crash when calculating offset on certain single curves which become multilinestrings when offset 2018-11-20 05:06:06 +11:00
Nyall Dawson
a22422c4bf [FEATURE][API] Add parts iterators to QgsGeometry
This allows easy iteration over all the parts of a geometry,
regardless of the geometry's type. E.g.

geometry = QgsGeometry.fromWkt( 'MultiPoint( 0 0, 1 1, 2 2)' )
for part in geometry.parts():
  print(part.asWkt())

geometry = QgsGeometry.fromWkt( 'LineString( 0 0, 10 10 )' )
for part in geometry.parts():
  print(part.asWkt())

There are two iterators available. QgsGeometry.parts() gives
a non-const iterator, allowing the parts to be modified in place:

geometry = QgsGeometry.fromWkt( 'MultiPoint( 0 0, 1 1, 2 2)' )
for part in geometry.parts():
   part.transform(ct)

For a const iteration, calling .const_parts() gives a const
iterator, which cannot edit the parts but avoids a potentially expensive
QgsGeometry detach and clone

geometry = QgsGeometry.fromWkt( 'MultiPoint( 0 0, 1 1, 2 2)' )
for part in geometry.const_parts():
   print(part.x())
2018-11-20 05:05:37 +11:00
Nyall Dawson
f5a6aef55f Raise IndexError in PyQGIS when calling geometryN on a collection
with an invalid geometry index

And add len operator to QgsGeometryCollection
2018-11-20 05:05:37 +11:00
signedav
32b7d7e5dd check uniqueCheck before overwrite defaultValueClause
and some tests for it
this fixes #20397 and fixes #20431
2018-11-19 16:54:28 +01:00
Denis Rouzaud
b089b57681
Merge pull request #8480 from lbartoletti/rectangle3PointsProjected
[FEATURE][needs-docs]Add map tool: rectangle 3 points (projected)
2018-11-19 15:21:46 +01:00
Blottiere Paul
50e2b76ae7
Merge pull request #8005 from lbartoletti/bugfix_18902
Fixes #18902 Snapping and tracing inconsistent behaviour
2018-11-19 04:49:03 +00:00
Blottiere Paul
0a42a101c4
Merge pull request #8063 from tudorbarascu/test_server
test server rendering debian buster bug
2018-11-16 08:28:28 +00:00
Matthias Kuhn
438a1daf6a
Merge pull request #8442 from signedav/textfield_null
Range widget: Remove null representator during editing
2018-11-16 09:03:13 +01:00
Tudor Bărăscu
2cf8f74c71 test server rendering debian buster bug #18988 2018-11-16 08:49:55 +02:00
lbartoletti
c292e69e49
Merge branch 'master' into extendMapTool 2018-11-15 11:37:26 +01:00
Martin Dobias
018e9fa28d
Merge pull request #8467 from wonder-sk/configure-lights
[3d] Configuration of lights in 3D map scene
2018-11-14 13:53:27 +01:00
signedav
c8fc7a2419 tests for focus on null field 2018-11-14 12:43:26 +01:00
nirvn
3b892c9759 [project] Avoid needlessly dirtying when written value does not change 2018-11-14 09:39:35 +07:00
lbartoletti
d40f884dfd Add map tool rectangle 3 points where 3rd point is projected on segment p1-p2 2018-11-14 00:19:57 +01:00
Martin Dobias
3692b6a1d7 Fix tests 2018-11-13 17:12:06 +01:00
lbartoletti
be2ac88643
Merge branch 'master' into extendMapTool 2018-11-13 09:04:56 +01:00
lbartoletti
abcf2aa4cf init trim/extend feature 2018-11-13 09:03:26 +01:00
Nyall Dawson
92f34a94d6 Unit tests for binary editor widget 2018-11-13 07:14:19 +10:00
Nyall Dawson
429320d10d [FEATURE] Binary (blob) field support for memory layers
Allows storage of binary blob fields in memory layers
2018-11-13 07:14:19 +10:00
Nyall Dawson
608d03c53d Add support for binary fields to QgsVectorFileWriter 2018-11-13 07:14:19 +10:00
Nyall Dawson
f3f1214df9 Unit test for creation of blob field in existing table 2018-11-13 07:14:19 +10:00
Nyall Dawson
6d5188bdb2 Fix build on Travis 2018-11-13 07:14:19 +10:00
Nyall Dawson
a192dab9de Unit tests for extract binary algorithm 2018-11-13 07:14:19 +10:00
Nyall Dawson
62bdc28de8 Unit tests for updating OGR binary column 2018-11-13 07:14:19 +10:00
Nyall Dawson
cdaf99de53 Don't try to show CRS in map layer model for aspatial tables 2018-11-13 07:14:19 +10:00
Nyall Dawson
5c27b7da50 [FEATURE] Binary blob support for OGR provider
Instead of converting binary fields to truncated strings, we instead
store their contents as QByteArray values, allowing the original binary
content to be retrieved.

This allows for plugins and scripts to utilise binary fields,
such as extracting their contents.
2018-11-13 07:14:19 +10:00
Nyall Dawson
8ae1880d38 Rename method for consistency, fix dox 2018-11-13 07:13:36 +10:00
Nyall Dawson
8703fb219b [FEATURE][API] New class QgsExifTools
Contains utilities for retrieving the geotag from images and
for setting an image's geotag.

Working with geotags (before this class!) is super-annoying
and fiddly and relies on either parsing command line tools
or depending on non-standard Python libraries which are
not available everywhere, and often very difficult for users
on certain platforms to get installed and working correctly.

With this class we have stable methods for geotag getting/setting
which are universally available and can be used safely
by plugins and scripts.
2018-11-13 07:13:36 +10:00
Juergen E. Fischer
669f6bb4b7 OGC parameter names are case-insensitive 2018-11-10 00:53:30 +01:00
Nyall Dawson
d6aa46cfe7 Add some notes to test, additional test with empty line 2018-11-10 07:24:02 +10:00
Nyall Dawson
ba17b130f8 Move forceRHR to QgsGeometry, avoid duplicate code 2018-11-09 19:06:48 +10:00
Nyall Dawson
63c9bcb5d2 Update reference lines 2018-11-09 19:06:48 +10:00
Nyall Dawson
7641605eb9 Fix warning 2018-11-09 19:06:48 +10:00
Nyall Dawson
30214538c2 [FEATURE] Add option to simple line and marker line to only
render exterior ring or interior rings

This option is shown whenever a simple line symbol or
marker line symbol is used as part of a fill symbol for
rendering polygons.

The default behavior is to render both interior and exterior
rings, but this new setting allows users to set the symbol
layer to render only for the exterior ring OR only
for interior rings.

This allows for symbolisation which wasn't directly possible
before, such as a marker line with markers for interior
rings angled toward the interior of the polygon.

Sponsored by the German QGIS User Group

Fixes #12652
2018-11-09 19:06:48 +10:00
Nyall Dawson
73d0ced5df [FEATURE] Add option to force right-hand-rule during polygon symbol rendering
This new option, available under the "Advanced" button for fill symbols,
allows forcing rendered polygons to follow the standard "right hand
rule" for ring orientation (where exterior ring is clockwise, and
interior rings are all counter-clockwise).

The orientation fix is applied while rendering only, and the original
feature geometry is unchanged.

This allows for creation of fill symbols with consistent appearance,
regardless of the dataset being rendered and the ring orientation
of individual features.

Refs #12652
2018-11-09 19:06:48 +10:00
Nyall Dawson
ae2255469b Fix accidently skipped test 2018-11-09 19:06:48 +10:00
Nyall Dawson
e5946c50e7 Ensure that QgsGeometry::offsetCurve does not reverse curve orientation 2018-11-09 19:06:48 +10:00
Nyall Dawson
1b79b9a140 [FEATURE] force_rhr expression function
Forces polygons to follow the right hand rule, in which the area that
is bounded by a polygon is to the right of the boundary. In particular,
the exterior ring is oriented in a clockwise direction and the
interior rings in a counter-clockwise direction.
2018-11-09 19:06:48 +10:00
Nyall Dawson
27e1ef5c1c Add method to QgsCurvePolygon to force RHR, ensuring standard ring orientation 2018-11-09 19:06:48 +10:00
Nyall Dawson
c22364d45e Add method to determine orientation of closed curves 2018-11-09 19:06:48 +10:00
Nyall Dawson
df81e554f8 Fix crash in geometry checker
Fixes #20408
2018-11-09 12:57:42 +10:00
Alessandro Pasotti
eab40d0e4c
Merge pull request #8435 from elpaso/handle-bad-layers5
bad layers dialog new button labels and icon
2018-11-08 12:15:21 +01:00
Martin Dobias
ad1bba2ac9
Merge pull request #8438 from wonder-sk/fix-block-outside-raster-extent
Fix raster block output when block extent is outside of valid area
2018-11-08 11:56:10 +01:00
Alessandro Pasotti
ba4981a1f4 Move change data source under filter 2018-11-08 11:30:06 +01:00
Martin Dobias
872c9a10a3 Add unit test 2018-11-08 10:09:57 +01:00
Alessandro Pasotti
c74ce886dc Disable "Change data source..." action if layer is editable 2018-11-08 09:22:33 +01:00
Nyall Dawson
4b32e7cc78 [afs] Implemented decodeUri for AFS provider
Allows retrieval of the web URL for an AFS layer
2018-11-07 15:30:17 +10:00
Alessandro Pasotti
9af0719ff2 Bad layers: added tests for subset string and groups 2018-11-06 14:58:04 +01:00
Alessandro Pasotti
7db1d4e8b4 Added test project with the bad layers (not used by tests)
but still useful for manual tests
2018-11-06 10:28:49 +01:00
Alessandro Pasotti
ba3ccca2dd Add rule-based and categorized styles to the bad layers test 2018-11-06 10:27:07 +01:00