qgis / qgis4.0_api

Tracker for QGIS 4.0 API related issues and developer discussion
3 stars 1 forks source link

QgsAbstractFeatureSource hasGeometry / isSpatial #79

Open 3nids opened 7 years ago

3nids commented 7 years ago

The base class has no virtual method to determine if the source has a geometry type. Sometimes a private var is used (which can be used thanks to the friend class), sometimes a method (such as hasGeometry, isSpatial or hasDefinedGeometry) and sometimes nothing.

I would propose to add a pure virtual method to QgsAbstractFeatureSource and go with isSpatial.

On the same note, vector layer has the duplicate isSpatial and hasGeometryType.

nyalldawson commented 7 years ago

isSpatial sounds good to me.

I'd also suggest we drop hasGeometryType in favour of QgsMapLayer::isSpatial. It's more flexible since it can be safely called with any layer type.

m-kuhn commented 7 years ago

+1, hasGeometryType sounds weird anyway