Skip to content

Commit

Permalink
#8725-R: New vector provider capability for topological simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 authored and m-kuhn committed Jan 15, 2014
1 parent 3b6ed3b commit f37b056
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/core/qgsvectordataprovider.cpp
Expand Up @@ -200,6 +200,12 @@ QString QgsVectorDataProvider::capabilitiesString() const
QgsDebugMsg( "Capability: Simplify Geometries before fetch the feature" );
}

if ( abilities & QgsVectorDataProvider::SimplifyGeometriesWithTopologicalValidation )
{
abilitiesList += tr( "Simplify Geometries with topological validation" );
QgsDebugMsg( "Capability: Simplify Geometries before fetch the feature ensuring that the result is a valid geometry" );
}

return abilitiesList.join( ", " );

}
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsvectordataprovider.h
Expand Up @@ -88,6 +88,8 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
SelectEncoding = 1 << 13,
/** supports simplification of geometries on provider side according to a distance tolerance */
SimplifyGeometries = 1 << 14,
/** supports topological simplification of geometries on provider side according to a distance tolerance */
SimplifyGeometriesWithTopologicalValidation = 1 << 15,
};

/** bitmask of all provider's editing capabilities */
Expand Down
2 changes: 1 addition & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -1495,7 +1495,7 @@ int QgsOgrProvider::capabilities() const
}

// supports geometry simplification on provider side
ability |= QgsVectorDataProvider::SimplifyGeometries;
ability |= ( QgsVectorDataProvider::SimplifyGeometries | QgsVectorDataProvider::SimplifyGeometriesWithTopologicalValidation );
}

return ability;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -994,7 +994,7 @@ bool QgsPostgresProvider::hasSufficientPermsAndCapabilities()
}

// supports geometry simplification on provider side
mEnabledCapabilities |= QgsVectorDataProvider::SimplifyGeometries;
mEnabledCapabilities |= ( QgsVectorDataProvider::SimplifyGeometries | QgsVectorDataProvider::SimplifyGeometriesWithTopologicalValidation );

return true;
}
Expand Down

0 comments on commit f37b056

Please sign in to comment.