I am trying to implement QGIS spatial query functionality in my plugin. I want to eliminate spatial operators which are not suitable for certain geometries. For eg. when I select layer with point geometry only certain(crosses,intersects, is disjoint,touches, Within) spatial operators are given by QGIS. Want to determine how to get to this result.
Got the layer geometry types using:
layer = iface1.activeLayer()
if layer.wkbType()==QGis.WKBPoint:
print 'Layer is a point layer'
if layer.wkbType()==QGis.WKBLineString:
print 'Layer is a line layer'
if layer.wkbType()==QGis.WKBPolygon:
print 'Layer is a polygon layer'
if layer.wkbType()==QGis.WKBMultiPolygon:
print 'Layer is a multi-polygon layer'
if layer.wkbType()==100:
print 'Layer is a data-only layer'