qgis / qgis4.0_api

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

Duplicated WKB type enum #2

Closed nyalldawson closed 7 years ago

nyalldawson commented 8 years ago

Currently two different enums are used in QGIS for storing WKB types - the older QGis::WkbType and the replacement QgsWKBTypes::Type enum.

Aside from making things difficult to work with (Eg https://github.com/qgis/QGIS/blob/master/src/core/qgsvectorfilewriter.cpp#L1729 ), it also makes it difficult to fully support z/m values throughout QGIS.

For instance, fixing http://hub.qgis.org/issues/12010 requires knowledge that the Postgres datasource contains z values, and the inserted geometry should also have these. Without breaking API and making QgsVectorDataProvider::geometryType() return a QgsWKBTypes::Type (or adding another signature geometryTypeV2() ) this is not currently possible.

A rough estimate is that Qgis::WkbType is used around 1000 times through the codebase, it is unknown at this stage how many occurrences could be just ported in place without additional work.

mhugo commented 8 years ago

+1 very important topic

nyalldawson commented 7 years ago

This has been fixed thanks to @m-kuhn