Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am working on python plugins for QGIS.I developed the plugins same as RT SQL LAYER plugins.

When we draw the layers using query builder of "Add Postgis Layer" option,toggle editing option is available for the same.

But when i try to draw layers using RT SQL LAYER plugin ,it is not available for editing. Same happens with my plugins too.

How do I make toggle editing option available for my plugins.?? My plugins are in python.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

The query builder just sets a subset string via QgsVectorLayer::setSubsetString() on the layer (also changeable later in the layer properties or via "Query" in the layer context menu).

In the postgres provider case this can be an arbitrary complex where clause and the layer remains editable.

RT layer however creates an layer from an arbitrary complex query, which is not updateable and therefore can't be edited.

share|improve this answer
add comment

In RT SQL Layer, it is possible to define queries that change the data (e.g. apply a buffer to points) in a way that it wouldn't be feasible to allow editing on the layer. (What should happen if the buffers are manipulated? That cannot be written back to PostGIS.)

Whether a layer is editable or not depends on its data provider and the methods it implements.

share|improve this answer
    
ok...which data provider can be use to make layer editable?? Thanx in advance:) –  Poonam Narvekar May 24 '12 at 7:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.