Skip to main content
replaced http://gis.stackexchange.com/ with https://gis.stackexchange.com/
Source Link

Update Please read this answer for a safer method of achieving the same http://gis.stackexchange.com/a/74940/9839https://gis.stackexchange.com/a/74940/9839

In case you experience performance issues you may still resort to original method described below.

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

Update Please read this answer for a safer method of achieving the same http://gis.stackexchange.com/a/74940/9839

In case you experience performance issues you may still resort to original method described below.

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

Update Please read this answer for a safer method of achieving the same https://gis.stackexchange.com/a/74940/9839

In case you experience performance issues you may still resort to original method described below.

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

added 225 characters in body
Source Link
Matthias Kuhn
  • 28.2k
  • 3
  • 89
  • 130

Update Please read this answer for a safer method of achieving the same http://gis.stackexchange.com/a/74940/9839

In case you experience performance issues you may still resort to original method described below.

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

Update Please read this answer for a safer method of achieving the same http://gis.stackexchange.com/a/74940/9839

In case you experience performance issues you may still resort to original method described below.

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

added 32 characters in body
Source Link
Matthias Kuhn
  • 28.2k
  • 3
  • 89
  • 130
 

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )
vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

 

The only way of forwarding a WHERE clause to the data provider (backend) at the moment is to use the setSubsetString method of QgsDataProvider

If you have a QgsVectorLayer assigned to a variable vl :

vl.setSubsetString( 'Counties = "Norwich"' )

This causes heavy side-effects, because the filter will then apply to the whole layer and not only to your query, so you have to carefully consider if this is really an option for your use case!

Any other option will require a seperate connection to the database or adding a new layer with a subsetString as outlined above.

Source Link
Matthias Kuhn
  • 28.2k
  • 3
  • 89
  • 130
Loading