79 Commits

Author SHA1 Message Date
Alessandro Pasotti
79219dae23 Forward port of histogram binding fix with a bonus test
Fwd port of PR #30033
Fixes #29700

With a new test for the bug.
2019-06-09 10:25:50 +02:00
Nyall Dawson
8b16e05998 Cleaner handling of raster provider native resolutions 2019-06-06 17:11:06 +10:00
Nyall Dawson
c82d3b643f Upgrade QgsCoordinateTransformContext for proj 6
This reworks (on proj 6 builds only!) QgsCoordinateTransformContext
to use proj strings of proj coordinate operations to handle the
users' preferred list of operations when transforming coordinates
between two CRSes.

Previously, the context heavily utilised internal transform ID
numbers, which were QGIS specific and relied on matching entries
from the QGIS srs.db file. This approach was undesirable because
it meant QGIS had to maintain and carry it's own table of
possible transform pathways between CRS pairs (which was difficult
to update, impossible to track, and most likely severely out of
date).

Now we can utilse Proj 6's (wonderful!) logic for determining the
best coordinate operation to utilise between two CRSes. All the
old API has been deprecated and no longer works under proj 6, but
that's unavoidable (and unlikely to be in use by plugins anyway,
it's VERY low level stuff).

A further bonus of this work is that QgsCoordinateTransform no
longer relies on proj strings of the source/dest CRS to build
the transform -- the issue with that approach was that proj
strings are lossy (and not always possible to generate), so
now by default we are generating better pathways between CRS
pairs.

This resolves issues with transforms which rely on pivot datums,
such as GDA94 - GDA2020 conversions.

Sponsored by ICSM
2019-05-31 10:38:08 +10:00
Nyall Dawson
60deffbfa8 Add method to QgsRasterBlockFeedback to collect error messages
And append raster errors to rendering errors whenever encountered
2019-05-22 03:46:00 +10:00
Alessandro Pasotti
56a6df4d71 Fix doxy deprecated 2019-04-17 10:06:41 +10:00
Alessandro Pasotti
3d687e5558 Add transform context to raster file writer task 2019-04-17 10:06:41 +10:00
Alessandro Pasotti
87998f7f7d Pass transformContext to raster writer 2019-04-17 10:06:41 +10:00
Alessandro Pasotti
654a78d6ff Raster transform context 2019-04-17 10:06:41 +10:00
Alessandro Pasotti
b3a448a2b2 Do not store context in layer (but in provider) ...
... also use transform context in raster projector
and deprecate setCrs without context
2019-04-17 10:06:41 +10:00
Alessandro Pasotti
82f2cb18b2 Deprecate default ctor for mesh layer options 2019-04-17 10:06:41 +10:00
Alessandro Pasotti
e930bee9e2 Add mandatory options to QgsVectorLayer ctor
... and deprecate the rest.

In QGIS 4 we'll have to get rid of the deprecated default ctor and
create a new one which takes no arguments.
2019-04-17 10:06:41 +10:00
Alessandro Pasotti
470759833e coordinateTransformContext -> transformContext for consistency
I like "coordinateTransformContext" more btw.
2019-04-17 10:06:41 +10:00
Alessandro Pasotti
df2bdf9c1a Handle the coordinate tranform context in the layer ctor
Also use the context when read/write XML by passing it
in the R/W context
2019-04-17 10:06:41 +10:00
Nyall Dawson
107b48a430 Add NULLPTR macro for use in doxygen comments
For the c++ api dox this expands to "\c nullptr" (the
\c directive indicates a code literal value), and for sipify/Python
it expands to ``None`` (`` is sphinx annotation for literal values)

Makes for nicer dox for both c++ and Python!
2019-02-27 09:41:11 +10:00
Nyall Dawson
a7ca08784c Nullptr consistency in dox 2019-02-27 09:41:11 +10:00
Nyall Dawson
b6d66becab Sipify 2019-02-27 09:41:11 +10:00
Blottiere Paul
3fbda69669 Update sip binding 2019-02-26 12:56:14 +00:00
Nyall Dawson
7eab74f803 Fix use of trailing */ in dox, which messes with sipify Python documentation output 2019-02-25 19:02:12 +10:00
Bas Couwenberg
371176357b Fix spelling errors.
* cancelation -> cancellation
 * overal      -> overall
2019-02-24 22:39:40 +01:00
Luigi Pirelli
2a917f4c10
Merge pull request #9049 from luipir/rasterSLD_export
Add SLD 1.0 export for rasters
2019-02-11 22:04:30 +01:00
Nyall Dawson
715395aa47 Fix incorrect 'not available in Python' dox 2019-02-05 13:46:34 +11:00
Nyall Dawson
384d310233 Minor improvements to PyQGIS returns for SIP_OUT params 2019-02-05 04:55:34 +11:00
Luigi Pirelli
3b1127ee70 spellechck do warning if htmls tags in methoid description => fail travis 2019-02-02 11:01:09 +01:00
Luigi Pirelli
bdda8d0b37 back to const methods 2019-02-01 18:13:05 +01:00
Luigi Pirelli
0e9af79165 fixed AStyle with astyle-all.sh 2019-02-01 14:42:36 +01:00
Luigi Pirelli
82e48f9c82 Added SLD 1.0 export for rasters 2019-01-31 15:21:05 +01:00
Nyall Dawson
ddd357c2ea Add API to QgsRasterBlock to obtain both pixel value AND no data
flag in a single call

This is much more efficient then making two calls, since the
QgsRasterBlock::isNoData() check internally calls QgsRasterBlock::value().
So by requiring API users to make the two separate calls individually,
we double the time this process takes...
2019-01-22 12:13:39 +11:00
Nyall Dawson
d57c182d8b Allow QgsRasterIterator to iterate over a raster layer, WITHOUT
actually fetching the raster block data

This allows for efficient iteration over a "reference" layer, where
you require the block extent/origin/pixel size/etc (but not the
reference layer block data itself!), in order to fetch a block from
a DIFFERENT set of rasters (but keeping these pixel-aligned to the
reference raster).
2019-01-22 07:52:45 +11:00
Juergen E. Fischer
196024ccba typo fixes 2019-01-01 21:53:37 +01:00
Denis Rouzaud
166e952c33 run sipify 2018-12-19 08:04:27 -04:00
Denis Rouzaud
edfb7e1465 run sipify 2018-12-18 17:17:25 -04:00
Alessandro Pasotti
326640d881 Implement setDataSource for rasters 2018-11-05 10:24:35 +01:00
Denis Rouzaud
cb9774022f create dialog for saving different styles 2018-09-14 16:35:30 +10:00
Denis Rouzaud
15e0d873d9 select categories in copy style in legend menu entry
not working yet, just set the menu entries
QgsMapLayerStyle::StyleCategory has moved to QgsMapLayer to avoid making QgsMapLayerStyle a QObject and they are mostly used in QgsMapLayer
2018-09-14 16:35:30 +10:00
Denis Rouzaud
51e9be0575 add API to select section of layer style when reading/writing 2018-09-14 16:35:30 +10:00
Denis Rouzaud
4b7da692d6 run sipify all 2018-09-10 11:41:57 -04:00
Juergen E. Fischer
a823046b5f followup spelling fixes 2018-09-07 00:33:13 +02:00
Peter Petrik
d7afb710d7 [mesh] [feature] add opacity slider to mesh contours settings 2018-08-28 09:17:31 +02:00
Chris Mayo
2a72eda514 Improve documentation of QgsRasterLayer constructor
- baseName is just passed on to the parent constructor to be the display
   name, use a literal string in the example to avoid misunderstanding.

 - Remove stray bullet.
2018-08-24 06:16:57 +10:00
Martin Dobias
358d12946b Read/write mesh styling from/to project files 2018-08-14 16:42:13 +02:00
Alessandro Pasotti
82fdb56c6a Const correctness for rasterblock 2018-08-08 09:39:57 +02:00
Alessandro Pasotti
6b10ffefb0 Add overload that accepts qgissize instead of int
to avoid a lot of annoying warnings and spare
some casts
2018-08-08 09:23:39 +02:00
Nyall Dawson
74c2ed12a5 Nicer API for raster sampling 2018-07-20 07:24:35 +10:00
Nyall Dawson
54e511960c More heavily optimised sample method for gdal provider 2018-07-20 07:24:35 +10:00
Nyall Dawson
b747ff6301 Dox++ 2018-07-20 07:24:35 +10:00
Nyall Dawson
ba10d1b5e7 [FEATURE] Add QgsRasterDataProvider::sample method for efficient
sampling of rasters at a given point

This is an alternative to the ::identify method, which is less
efficient but more powerful
2018-07-20 07:24:35 +10:00
Martin Dobias
48195e0158 Make shade() const 2018-07-12 15:10:12 +02:00
Martin Dobias
0a35d43552 Speed up rendering of RGB images
In my simple test case this made map rendering of RGB satellite image tiles
go down by ~50% from ~40ms per tile to ~20ms per tile (in debug version, ahem)
2018-07-09 22:01:11 +02:00
Peter Petrik
aeea184890 [mesh] [feature] App widgets for styling mesh layers
- Adding datasets to mesh layer from properties panel
- Information and source panel in properties panel
- Selection of active dataset (properties or styling panel)
- Styling of contours/scalars (properties or styling panel)
- Styling of mesh frame (properties or styling panel)
- Styling of vector arrows (properties or styling panel)
2018-06-26 08:50:19 +02:00
Martin Dobias
4c84cfa29a Fix a memory leak in classify() + add missing annotations/docstrings
A pseudo color renderer was getting created in classify() but never deleted.

Spotted by @PeterPetrik

As a bonus switched a for loop from mixed constBegin()/end() usage to range for.
2018-06-22 05:48:46 +10:00