101 Commits

Author SHA1 Message Date
Nyall Dawson
41fa4b19fd Fix rendering artifacts on the edges of resampled raster tiles
We now buffer the request for the input to a resample filter by
a variable number of pixels (depending on the resampling type)
in order to fetch the neighbouring pixels to the edges of individual
raster blocks. This allows the resampling to utilise these
neighbouring pixels when resampling the edges of tiles, avoiding
discrepancies and rendering artifacts over the borders of
raster tiles.

Fixes #30152
2019-11-15 13:48:38 +10:00
Matthias Kuhn
b08a7d711c Fix sip file for sip and automoc 2019-11-03 21:20:08 +01:00
Matthias Kuhn
4294dda083 Resipify 2019-11-03 21:05:34 +01:00
Nyall Dawson
5e84033193 Sipify 2019-11-01 14:03:01 +10:00
Nyall Dawson
8c8d76387c Doxy 2019-10-31 12:19:59 +10:00
Nyall Dawson
13e9dd727f Deprecate old QgsRasterResampler interface, and add a new interface
which doesn't require pre-allocation of a temporary QImage

The existing interface is very inefficient for the bilinear resampler,
because it requires allocation of a temporary QImage just to pass
the desired height and width to the resampler...
2019-10-31 12:19:59 +10:00
Nyall Dawson
aa962b5da0 [FEATURE] Add option to set color for rendering nodata pixels in raster layers
Allows raster nodata pixels to be colored in a specific (non-transparent) color.
Designed to match the "Display background value" option from ArcMap.

Sponsored by SLYR

Fixes #26087
2019-10-27 10:07:04 +10:00
Nyall Dawson
1ba8db41b6 Fix potential overflow in raster renderer 2019-10-26 06:45:11 +10:00
Denis Rouzaud
758d7cff4a run sipify to update deprecation annotations 2019-10-15 13:17:38 +02:00
Nyall Dawson
3112332227 Rename variable for clarity 2019-10-09 15:01:51 +10:00
Nyall Dawson
cb06519d16 [api] Add API to indicate that individual layers may be loaded without any
CRS validation, regardless of the user's settings

This avoids hacks put in place in other parts of QGIS code or in plugins
to temporarily deactivate the CRS validation prompt, providing a supported,
stable method to indicate that when loading a particular layer no CRS
validation is required.
2019-10-09 15:01:51 +10:00
Nyall Dawson
f5c21a0fbd Optimize QgsContrastEnhancementFunction
Allow some methods to be inlined, and precalculate maximum/minimum values
possible instead of recalculating them for every pixel
2019-09-27 08:21:26 +10:00
Even Rouault
5e70084d32 QgsRasterFileWriter: improve error reporting 2019-09-17 08:58:25 +10:00
Alessandro Pasotti
631ac63e57 Call QgsRasterBlock destructor from SIP (add factory)
Fixes #31343 memory leak
2019-08-23 06:32:32 +10:00
Nyall Dawson
286b967917 Consistent dox 2019-08-07 10:40:30 +10:00
Nyall Dawson
35fc3799cd Dox++ 2019-08-07 06:26:04 +10:00
Nyall Dawson
b4c4c99250 Improve QgsRasterLayer dox 2019-08-07 06:26:04 +10:00
Nyall Dawson
e3fbe28148 Fix incorrect /Factory/ annotation 2019-08-06 21:31:59 +10:00
Matthias Kuhn
e51a3babb7 Move WMS ignore extents to service level 2019-07-24 12:41:31 +02:00
Matthias Kuhn
6ae23a180e [FEATURE] Allow rendering raster layers outside the reported extent
The extent reported by raster layers may be smaller than the area
which can be rendered.
Notably for WMS with symbology that takes more space than the data.

Fix #30251
2019-07-20 14:25:19 +02:00
Nyall Dawson
590d1aae9d [FEATURE][API] Visitor API for style entities
Adds a new visitor pattern API for creation of visitors which visit
all the style entities (symbols, color ramps, text formats, and
label styles) associated with different objects. Can be used on a
renderer, map layer, or project wide level.

E.g. on a project wide level, allows collection of ALL the style
symbols/color ramps/text settings inside a project, including those
in layouts or annotations!
2019-07-06 12:36:54 +10:00
nirvn
efeb8b5e32 [raster] Allow raster providers to hint whether resampling is beneficial
For some providers, such as tiled WMTS/XYZ/AMS, resampling is not
always visually beneficial and can lead to larger downloads
2019-06-25 14:42:36 +07:00
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