Permalink
Browse files

Fix Cluster Layers Filter Translation (#5205)

  • Loading branch information...
szekerest committed May 13, 2016
1 parent 1058774 commit cc03ceec064a0b2fb07e1f68f5b189dcdb2d67d3
Showing with 55 additions and 2 deletions.
  1. +55 −2 mapcluster.c
View
@@ -1497,6 +1497,52 @@ int msClusterLayerOpen(layerObj *layer)
return MS_SUCCESS;
}
+int msClusterLayerTranslateFilter(layerObj *layer, expressionObj *filter, char *filteritem)
+{
+ msClusterLayerInfo* layerinfo = layer->layerinfo;
+
+ if (!layerinfo) {
+ msSetError(MS_MISCERR, "Layer is not open: %s", "msClusterLayerTranslateFilter()", layer->name);
+ return MS_FAILURE;
+ }
+
+ return layerinfo->srcLayer.vtable->LayerTranslateFilter(&layerinfo->srcLayer, filter, filteritem);
+}
+
+int msClusterLayerEscapeSQLParam(layerObj *layer, const char* pszString)
+{
+ msClusterLayerInfo* layerinfo = layer->layerinfo;
+
+ if (!layerinfo) {
+ msSetError(MS_MISCERR, "Layer is not open: %s", "msClusterLayerEscapeSQLParam()", layer->name);
+ return MS_FAILURE;
+ }
+
+ return layerinfo->srcLayer.vtable->LayerEscapeSQLParam(&layerinfo->srcLayer, pszString);
+}
+
+int msClusterLayerGetAutoProjection(layerObj *layer, projectionObj* projection)
+{
+ msClusterLayerInfo* layerinfo = layer->layerinfo;
+
+ if (!layerinfo) {
+ msSetError(MS_MISCERR, "Layer is not open: %s", "msClusterLayerGetAutoProjection()", layer->name);
+ return MS_FAILURE;
+ }
+
+ return layerinfo->srcLayer.vtable->LayerGetAutoProjection(&layerinfo->srcLayer, projection);
+}
+
+int msClusterLayerGetPaging(layerObj *layer)
+{
+ return MS_FALSE;
+}
+
+void msClusterLayerEnablePaging(layerObj *layer, int value)
+{
+ return;
+}
+
void msClusterLayerCopyVirtualTable(layerVTableObj* vtable)
{
vtable->LayerInitItemInfo = msClusterLayerInitItemInfo;
@@ -1514,6 +1560,14 @@ void msClusterLayerCopyVirtualTable(layerVTableObj* vtable)
vtable->LayerGetNumFeatures = msClusterLayerGetNumFeatures;
vtable->LayerGetAutoStyle = msClusterLayerGetAutoStyle;
+ vtable->LayerTranslateFilter = msClusterLayerTranslateFilter;
+ /* vtable->LayerSupportsCommonFilters, use driver implementation */
+ vtable->LayerEscapeSQLParam = msClusterLayerEscapeSQLParam;
+ /* vtable->LayerEscapePropertyName, use driver implementation */
+
+ vtable->LayerEnablePaging = msClusterLayerEnablePaging;
+ vtable->LayerGetPaging = msClusterLayerGetPaging;
+ vtable->LayerGetAutoProjection = msClusterLayerGetAutoProjection;
}
#ifdef USE_CLUSTER_PLUGIN
@@ -1531,8 +1585,7 @@ PluginInitializeVirtualTable(layerVTableObj* vtable, layerObj *layer)
#endif
-int
-msClusterLayerInitializeVirtualTable(layerObj *layer)
+int msClusterLayerInitializeVirtualTable(layerObj *layer)
{
assert(layer != NULL);
assert(layer->vtable != NULL);

0 comments on commit cc03cee

Please sign in to comment.