[Qgis-developer] Render extents based subset of features

Chris Crook ccrook at linz.govt.nz
Wed Jun 8 22:10:11 EDT 2011


I have a layer of simple lines (ie straight lines with no midpoint nodes), which I want rendered so that only lines with one of the endpoints within the extents are displayed and selectable.  Lines which cross the map window but do not terminate in it are omitted.

This is to display land survey data, where I'm only interested in observations relating to marks in the current view.

At the moment my best idea on implementation is to intercept the mapcanvas render starting and render ending events, and update the layer subset query on render starting and reset it on render ending.  But I suspect that changing the query will trigger a refresh, which will mess things up.  And even if it doesn't, subsequently selecting on the layer will find features not included in the canvas.

Perhaps better would be to update the layer subset query whenever the canvas extents change.  This is probably safer, and gets around the issue of selection.  It will be messy handling interations with user written layer subselects though.  Also I'm not sure that it will sit well with the map composer?

I think that the ideal solution is to have a custom data provider or vector layer that overrides the select() function (though again I suspect this would corrupt the user select functions).

I'm not really wanting to be writing C++ for this - hoping for a python solution.

Any suggestions?

Thanks
Chris
______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject to legal privilege. 
If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message.
If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________


More information about the Qgis-developer mailing list