Re: [Qgis-user] variables in postgis filters
On 04/05/2016 10:20 AM, Sandro Santilli wrote: > On Tue, Apr 05, 2016 at 06:09:12PM +1000, Nyall Dawson wrote: > >> What's the topology issue you're hoping to solve with this? > > Topology face layers from the TopoViewer (via DBManager plugin) > use an expensive (and volatile, thus non-indexable) query to > generate the geometry to be used for display. The provider generally > applies the spatial filter to the geometry field, which in this case > is ineffective. > > I could fix this by adding the possibility to specify a > "spatial-filter-field" which is different from the "spatial-display-field" > (similarly could be done for obtaining the $area from the provider, > for example). That would be nice. A possibility for this could be to allow compiling virtual fields which can make use of the expression variables. A function for the topo query could then be translated to a (server side) SQL query. The virtual field could be visualized via the geometry generator symbology. The missing pieces I see are * allow compiling virtual fields * expression compilation for functions * expression compilation for variables Matthias ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
On Tue, Apr 05, 2016 at 06:09:12PM +1000, Nyall Dawson wrote: > What's the topology issue you're hoping to solve with this? Topology face layers from the TopoViewer (via DBManager plugin) use an expensive (and volatile, thus non-indexable) query to generate the geometry to be used for display. The provider generally applies the spatial filter to the geometry field, which in this case is ineffective. I could fix this by adding the possibility to specify a "spatial-filter-field" which is different from the "spatial-display-field" (similarly could be done for obtaining the $area from the provider, for example). Or there could be a way for a query to include its own scale-and-extent-dependent filter to be applied when fetching geometries. This would be more flexible for the user as it could specify any arbitrary filter that could serve to modify what's fetched depending on the viewport (which could even include calling functions that query different tables based on different viewport scales, for instance). --strk; ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
On 5 Apr 2016 17:17, "Sandro Santilli" wrote: > > On Mon, Apr 04, 2016 at 10:25:35AM +1000, Nyall Dawson wrote: > > On 3 April 2016 at 01:27, Sandro Santilli wrote: > > > > Being able to use canvas-dependent variables (extent and scale, > > > mostly) would help a lot with speeding up some kind of query > > > layers (TopoGeometry ones, for example). > > > > Be aware that this would not be possible in a vector layer filter. > > Expressions at the vector layer level will only have access to global, > > project and layer variables. Think about it this way - if the project > > has multiple maps in various composers, which extent and scale would > > be used when fetching features from the layer for something which > > isn't specific to an individual map (Eg the attribute table). > > How's the current support for "simplify at the provider side" done ? > It seems to have the exact same constraints of the ones you're > mentioning (yes, I've seen the recent thread about $area parameter > changing value across zoom levels, which seems to be one of those > side-effects). That's done on the feature request. What's the topology issue you're hoping to solve with this? Nyall > > --strk; ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
On Mon, Apr 04, 2016 at 10:25:35AM +1000, Nyall Dawson wrote: > On 3 April 2016 at 01:27, Sandro Santilli wrote: > > Being able to use canvas-dependent variables (extent and scale, > > mostly) would help a lot with speeding up some kind of query > > layers (TopoGeometry ones, for example). > > Be aware that this would not be possible in a vector layer filter. > Expressions at the vector layer level will only have access to global, > project and layer variables. Think about it this way - if the project > has multiple maps in various composers, which extent and scale would > be used when fetching features from the layer for something which > isn't specific to an individual map (Eg the attribute table). How's the current support for "simplify at the provider side" done ? It seems to have the exact same constraints of the ones you're mentioning (yes, I've seen the recent thread about $area parameter changing value across zoom levels, which seems to be one of those side-effects). --strk; ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
On 3 April 2016 at 01:27, Sandro Santilli wrote: > On Wed, Mar 30, 2016 at 02:47:55AM -0700, ralfwessels wrote: > >> I would like to filter my PostGIS table by the actual extent of the map >> canvas similar to the possibility in the Quick OSM - Plugin. >> >> Does someone know, if this is possible? > > I've been thinking about a way to do this too as I'm afraid it is > currently not available as a core support. There's 2 ways I can think of implementing this. One would be a niave search-and-replace for variable names in the filter before passing it off to the layer's provider. But that's potentially quite fragile. An alternative approach would be to have an optional switch which changes the layer filter from provider-specific syntax to using the standard QGIS expression engine, complete with access to variables and the like. With compiled expressions these could still potentially be handed off to the provider side to speed up the queries. > > Being able to use canvas-dependent variables (extent and scale, > mostly) would help a lot with speeding up some kind of query > layers (TopoGeometry ones, for example). Be aware that this would not be possible in a vector layer filter. Expressions at the vector layer level will only have access to global, project and layer variables. Think about it this way - if the project has multiple maps in various composers, which extent and scale would be used when fetching features from the layer for something which isn't specific to an individual map (Eg the attribute table). Only expressions evaluated in the context of a specific map have access to the map specific scale and extent variables (eg data defined symbology, labeling parameters, etc). Nyall > > I haven't looked at how the QuickOSM plugin deals with the issue, > does it update the layer definition on every pan and zoom operations ? > > --strk; > > > ___ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > List info: http://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
On Sat, Apr 02, 2016 at 09:12:22AM -0700, ralfwessels wrote: > ..but I guess (so far) it is not possible to use current extent informations > (e.g. as variable) within the sql filter options for PostGIS data tables. Correct, that's currently not supported. Willing to fund development in that direction ? I'd be happy to work on it. --strk; ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
Hi, Any plugin can subscribe to receive notifications about canvas updates and can fetch information about the canvas (extent, scale). ..but I guess (so far) it is not possible to use current extent informations (e.g. as variable) within the sql filter options for PostGIS data tables. ralf -- View this message in context: http://osgeo-org.1560.x6.nabble.com/variables-in-postgis-filters-tp5246743p5259318.html Sent from the Quantum GIS - User mailing list archive at Nabble.com. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
On Sat, Apr 02, 2016 at 07:39:47AM -0700, ralfwessels wrote: > Hi, > > I haven't looked at how the QuickOSM plugin deals with the issue, > does it update the layer definition on every pan and zoom operations ? > > No, the QuickOSm-Plugin is not updateing on every pan or zoom - it just > loads the object for the current map extent (if this is not to big though). > But as a first step this would be ok to load data from PostGIS tables. > > So if the QuickOSM Plugin uses the current map extents, thsee must be > accessible somehow. Any plugin can subscribe to receive notifications about canvas updates and can fetch information about the canvas (extent, scale). --strk; ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
Hi, I haven't looked at how the QuickOSM plugin deals with the issue, does it update the layer definition on every pan and zoom operations ? No, the QuickOSm-Plugin is not updateing on every pan or zoom - it just loads the object for the current map extent (if this is not to big though). But as a first step this would be ok to load data from PostGIS tables. So if the QuickOSM Plugin uses the current map extents, thsee must be accessible somehow. ralf -- View this message in context: http://osgeo-org.1560.x6.nabble.com/variables-in-postgis-filters-tp5246743p5259307.html Sent from the Quantum GIS - User mailing list archive at Nabble.com. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
On Wed, Mar 30, 2016 at 02:47:55AM -0700, ralfwessels wrote: > I would like to filter my PostGIS table by the actual extent of the map > canvas similar to the possibility in the Quick OSM - Plugin. > > Does someone know, if this is possible? I've been thinking about a way to do this too as I'm afraid it is currently not available as a core support. Being able to use canvas-dependent variables (extent and scale, mostly) would help a lot with speeding up some kind of query layers (TopoGeometry ones, for example). I haven't looked at how the QuickOSM plugin deals with the issue, does it update the layer definition on every pan and zoom operations ? --strk; ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] variables in postgis filters
Hi, interesting question. I would like to filter my PostGIS table by the actual extent of the map canvas similar to the possibility in the Quick OSM - Plugin. Does someone know, if this is possible? @Walter: try the "Spatial subset query plugin". This is maybe what you want. Ralf -- View this message in context: http://osgeo-org.1560.x6.nabble.com/variables-in-postgis-filters-tp5246743p5258783.html Sent from the Quantum GIS - User mailing list archive at Nabble.com. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: http://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user