5268 Commits

Author SHA1 Message Date
Peter Petrik
11f10c10c2 add documentation 2018-12-07 15:54:16 +01:00
Peter Petrik
fa1ddb1f7a fix spellcheck 2018-12-07 15:54:16 +01:00
Peter Petrik
28071728f1 [mesh] use MDAL 0.1.0 API in QGIS. Allows lazy loading of formats and effective transfer of data
introduce MeshDataBlock

use mesh block in rendering

calculate magnitude

use new mesh API

fix bug for memory layer

fix SIP, sip is unable to work with qvector<qgsmeshvertex>

fix tests

implement new MDAL min/max api

improve mesh documentation

fix travis build
2018-12-07 15:54:16 +01:00
Alessandro Pasotti
16922a3041
Merge pull request #8612 from elpaso/vector-legend-toggle-items
Add a toggle action to vector layer legend items [feature]
2018-12-07 09:36:14 +01:00
Alessandro Pasotti
465479056d Move toggle action first and fix since 3.6 2018-12-07 08:07:18 +01:00
Nyall Dawson
048d526542 Add unit tests, standardise method names 2018-12-07 08:08:52 +10:00
Nyall Dawson
34f6e371a7 [FEATURE][layouts] Add new grid frame style "Zebra (Nautical)",
which shows nautical-style blocks in the grid corners when a
margin is set for the grid.
2018-12-07 08:08:52 +10:00
Nyall Dawson
11258c05b0 [FEATURE][layouts] Don't draw diagonals on line border grid style when a
margin is set

Instead, split this behaviour off into a new "Line border (Nautical)"
grid style. It's a very specific type of effect and won't always
be desirable when using margins with the line border style.
2018-12-07 08:08:52 +10:00
Nyall Dawson
470cd0b619 Code style fixes 2018-12-07 08:08:52 +10:00
konst
d794bdb74c [FEATURE] [needs-docs] Add the grid frame MARGIN In the "Print Layout" map grid 2018-12-07 08:08:52 +10:00
Nyall Dawson
e6ec1ec53e [FEATURE][API] Add iterator for QgsGeometryCollection
Iterates over the geometries in the collection, allowing this type
of code:

  gc = QgsGeometryCollection()
  gc.fromWkt('GeometryCollection( Point(1 2), Point(11 12), LineString(33 34, 44 45))')
  for part in gc:
    print(part.asWkt())
2018-12-07 05:51:27 +10:00
Nyall Dawson
e23527bf92 Use TypeHint annotation to indicate correct return type when sip code returns SIP_PYOBJECT
Provides correct return type hints to IDEs (and hopefully PyQGIS docs too!)
2018-12-07 05:51:27 +10:00
Nyall Dawson
4bba8ae64d [FEATURE][API] Add some nice PyQGIS API for working with geometry collections
- Calling removeGeometry with an invalid index will now raise an IndexError
- Calling collection[0] will return the first geometry in the collection,
collection[1] the second, etc. And negative indices return from the end
of the collection, so collection[-1] returns the last geometry in the collection.
- Geometries can be deleted by calling `del collection[1]` (deletes the
second geometry from the collection). Also supports negative indices
to count from the end of the collection.
2018-12-07 05:51:27 +10:00
Alessandro Pasotti
ff99f1b825 [feature] Add a toggle action to vector layer legend items 2018-12-05 12:34:43 +01:00
nirvn
c6425338ee [FEATURE] Raster image marker 2018-12-05 15:44:44 +07:00
nirvn
60442980dd Add dox comment, fix travis 2018-12-05 11:14:13 +07:00
nirvn
ad4b876866 Add opacity parameter to image cache 2018-12-05 11:14:13 +07:00
Nyall Dawson
c1df802769 Add method to QgsImageCache to retrieve original image size 2018-12-05 11:14:13 +07:00
Nyall Dawson
84838d1ec6 [FEATURE][API] Add a content cache for raster images
This new class QgsImageCache is the equivalent of QgsSvgCache
but for raster images.

QgsImageCache stores pre-rendered resampled versions of raster
image files, allowing efficient reuse without incurring the
cost of resampling on every render.

Additionally, it offers the other benefits QgsSvgCache has,
such as thread safety, ability to transparently download remote
images, and support for base64 encoded strings.
2018-12-05 11:14:13 +07:00
Nyall Dawson
cdba8f5621 Use QgsAbstractContentCache base class for QgsSvgCache 2018-12-05 11:14:13 +07:00
Nyall Dawson
22496dc139 Create a new abtract base class for file content caches (e.g. QgsSvgCache)
Generalise QgsSvgCache and split off into a common base class so
that we can re-use code with alternative similar caches, e.g. a
raster image cache.
2018-12-05 11:14:13 +07:00
Nyall Dawson
ff786f2223 Add group method to QgsSettings
Is present in the QSettings API, but missing from QgsSettings
2018-12-05 04:46:58 +10:00
Nyall Dawson
4bca7838bf [processing] Add method for providers to specify a different list
of supported output formats when an output has no geometry
2018-12-03 18:11:24 +10:00
Denis Rouzaud
dde309439c
Merge pull request #8560 from 3nids/locator_context
Add context menu for locator filter results
2018-11-29 15:28:30 -04:00
Nyall Dawson
d72c4d001f [processing] Allow parameter metadata to set the number of decimal places
to show in numeric/distance widgets

E.g. to only show 2 decimal places:

  # only show two decimal places in parameter's widgets, not 6:
  param.setMetadata( {'widget_wrapper':
    { 'decimals': 2 }
  })
2018-11-30 05:02:59 +10:00
Denis Rouzaud
157c8f4987 more doc 2018-11-29 14:28:14 -04:00
Denis Rouzaud
c13b419d21 fix python bindings 2018-11-29 12:50:48 -04:00
Denis Rouzaud
e03537a4cf fix typo 2018-11-29 08:27:15 -04:00
Denis Rouzaud
f24daa2b69 allow to use icons too 2018-11-29 08:15:12 -04:00
Denis Rouzaud
d272f3cf2a do not use qaction in the result, build context menu in the widget 2018-11-29 08:02:37 -04:00
Denis Rouzaud
c48a706e49 use int as IDs to recognize context menu entries 2018-11-28 08:34:09 -04:00
Denis Rouzaud
91736fd9f6 fix doc 2018-11-28 07:46:24 -04:00
Denis Rouzaud
1bc0fbf9d4 [locator] allow to have context menu entries for results 2018-11-28 07:46:24 -04:00
Juergen E. Fischer
60ea432cbc fix windows build (partly reverts 1a199d095) 2018-11-27 23:16:03 +01:00
Nyall Dawson
6cc41a9474 Remove an incorrect /Transfer/ annotation, add a missing /Transfer/ annotation 2018-11-27 19:07:06 +10:00
Nyall Dawson
f595d53d0a Negative indices count from back of linestring 2018-11-27 09:29:13 +10:00
Nyall Dawson
1e5479964f [FEATURE][API] Add some nice PyQGIS methods and exceptions to QgsLineString
- len(QgsCurve) returns number of points in curve
- raise IndexErrors when calling pointN, xAt, yAt, zAt, mAt, setXAt, setYAt,
setMAt, setZAt with invalid vertex indices
- Add [] getter for retrieving specific vertices, eg. ls[0] returns QgsPoint(...)
- Add [] setter for setting specific (existing) vertices, e.g. ls[1] = QgsPoint(1,2)
- Add del support for removing vertices, e.g. del ls[1] removes the second vertex
2018-11-27 09:29:13 +10:00
Nyall Dawson
1072ebb621 [browser] Add API to access the drive data items 2018-11-26 18:20:08 +10:00
Mathieu Pellerin
4e1d6841ae Avoid more needless project dirtying 2018-11-21 21:46:50 +07:00
Denis Rouzaud
d1d3a51efb
Merge pull request #8429 from lbartoletti/extendMapTool
[needs-docs][FEATURE] Trim/extend
2018-11-21 06:36:08 +01:00
Nyall Dawson
5603546c26 Dox 2018-11-21 08:48:55 +11:00
Nyall Dawson
e21ea25c66 Add method to set QgsFeature geometry directly from QgsAbstractGeometry
Allows

    feat.setGeometry(QgsPoint(1,2))

instead of the more obscure

    feat.setGeometry(QgsGeometry(QgsPoint(1,2)))
2018-11-21 08:48:55 +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
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
lbartoletti
c292e69e49
Merge branch 'master' into extendMapTool 2018-11-15 11:37:26 +01:00
lbartoletti
574a57f2e4 Merge branch 'extendMapTool' of github.com:lbartoletti/QGIS into extendMapTool 2018-11-13 13:39:56 +01:00
Peter Petrik
0e413c04bc sipify 2018-11-13 10:48:02 +01:00
Peter Petrik
7564276994 QPrinter is unavailable on some platforms 2018-11-13 10:48:02 +01:00
Peter Petrik
1559013270 support platforms that does not have QProcess support (iOS) 2018-11-13 10:48:02 +01:00