Re: [QGIS-Developer] PostGIS Raster loading extrem long in QGIS 3.16 and 3.22

2022-03-15 Thread Alessandro Pasotti via QGIS-Developer
Hi,

the reason for the different behavior is that the old QGIS version was
using GDAL to access PG rasters while the new versions uses a QGIS native
data provider which is using ST_SummaryStatsAgg() to calculate statistics,
I believe that this call can become very slow on large rasters and we
should probably reduce the time by using a smaller sample size but this has
to be implemented/fixed yet, feel free to file a ticket on the QGIS bug
tracker.

The good news is the you can still load the raster from QGIS using the GDAL
provider with a connection string that looks like this:  "PG:
dbname={dbname} mode=2 host={host} port={port} table={table}
schema={schema} sslmode=disable"

Hope this helps.

Regards.
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


[QGIS-Developer] PostGIS Raster loading extrem long in QGIS 3.16 and 3.22

2022-03-15 Thread Pascal Bircher / Netzwerk Schweizer Pärke via QGIS-Developer
Dear QGIS-Developer
I am working on a test-server (RAID6) implementing PostgreSQL/PostGIS with 
vector and raster support. The aim is a big database sharing different data 
types including high resolution (0.5m, also 0.1m; 8 bit; 3 bands) rasters and 
(2m, also 0.5m; 32bit floating point; 1 band) rasters.

For QGIS 3.16 and 3.22 I can report the following issue.
When I try to add a PostGIS raster with 32 bit floating point and a resolution 
of 2m into QGIS the query SELECT ST_SummaryStatsAgg() needs a lot of time at 
least 10-20 minutes on database.

Another interesting aspect I observed is that QGIS 3.10.4 loads the same raster 
nearly instantly.

I do not understand why a postgis-raster needs 10-20min to load in QGIS 3.16 
and 3.22 and QGIS 3.10.4 does not run the above mentioned query on the database.

Kind regards

---
Pascal Bircher
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


[QGIS-Developer] Casting a SimpleMarker (renderer) to a SimpleFill one?

2022-03-15 Thread Richard Duivenvoorde via QGIS-Developer

Hi,

I'm wondering if there is an easy way to put the (mostly colors) of a 
Point-layer upon another Polygon layer.
(I recall Andreas also wrote about this?)

Usecase: having a layer with a lot of measuring points on it, rule-based styled 
on value.
Creating a Voronoi-layer from it, and being able to use the (point) rules on 
that polygons (having the same value)..

I'm able to 'do this' by saving as qml and then hand editing some properties:

class="SimpleMarker"
to
class="SimpleFill"


to


o
to
2


But I wondered if there is/should be a 'cleaner' way.

Tried [0]:
renderer = layer1.rendererV2()
layer2.setRenderer(renderer)
but that crashes QGIS if you try to open/change a symbol.

Is there a way to do this easier then:
- walk over the rules
- create a QgsSymbolV2.defaultSymbol(layer.geometryType())'s
- copy over some properties...

I'm aware that off course there is a big difference between the point and 
polygon styles/renderers, but I also think it would be nice to be able to (in 
QGIS itself) to 'copy' the point style to a polygon style and only take with it 
whatever 'fits'?

Anybody some info/idea's?

Regards,

Richard Duivenvoorde


[0] 
https://snorfalorpagus.net/blog/2014/03/04/symbology-of-vector-layers-in-qgis-python-plugins/
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


[QGIS-Developer] Improve postgresql network latency by using "pipeline mode" connexion ?

2022-03-15 Thread Régis Haubourg via QGIS-Developer
Hi all,
The article [0] popped today about the new pipeline mode [1] in postgresql
14 libpq.
This could improve transaction latencies with databases that could be in
slow networks or cloud hosting.
It does not improve all the use cases, but it seems possibly interesting
for editing sessions by reducing round trips between client and server.

Has anyone already explored this ?

Best regards
Régis

[0]
https://www.cybertec-postgresql.com/en/pipeline-mode-better-performance-on-slow-network/
[1] https://www.postgresql.org/docs/14/libpq-pipeline-mode.html
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [QGIS-Developer] enabling proxy for wms/wmts layer

2022-03-15 Thread Richard Duivenvoorde via QGIS-Developer

On 3/14/22 19:47, Lucia Kadlecova via QGIS-Developer wrote:

Hello,
I would like to ask how to enable proxies when adding WMTS via WMS. On server 
where I run standalone QGIS python to access the WMTS I need to execute below 
commands to be able connect from server to net.

export http_proxy=http://xx.xx.xx.xx:8080/ 
export https_proxy=https://xx.xx.xx.xx:8080/ 

I tried to add to below code via subprocess.run, but no success

|projectName = 'wms_load' project = QgsProject.instance() urlWithParams = 
'crs=EPSG:3857=7=image/png=geolandbasemap=normal=google3857=https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml
 ' rlayer = QgsRasterLayer(urlWithParams, 
'geolandbasemap', 'wms') if not rlayer.isValid(): print("Layer failed to load!") else: print('Layer loaded') 
project.addMapLayer(rlayer) project = QgsProject.instance() project.write() qgs.exitQgis()|


Hi Lucia,

For what I know QGIS is not picking up the proxies from the environment. It is 
using
https://qgis.org/pyqgis/3.6/core/QgsNetworkAccessManager.html for all network 
requests, and (like you have to explicitly set a proxy in settings/network in 
QGIS) you probably have to use/set a 'proxyFactory' in your code.

Not 100% sure about this, and I agree that it would be better/nice if Qt/QGIS 
would pick up proxy settings from the environment (and maybe it does, can you 
ask in you script for that?).

Regards,

Richard Duivenvoorde
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer