[mapserver-users] PHP-Mapscript - clusterObj ?
Daniel Morissette
dmorissette at mapgears.com
Mon Jun 20 13:06:17 PDT 2011
On 11-06-20 03:47 PM, Chris Green wrote:
> Hi Jeff
>
> Thanks. Fame at last...!
>
> However I am still struggling with the combination of clustering and regex filtering. What I can say for sure is that clustering works if no regex filter is applied, and filtering works (using a regex filter in the form "/target/") with no clustering. But I have so far failed to make the two work together.
>
> This is where I am currently (which does not work for me):
>
> $map = ms_newMapobj("/var/www/vhosts/mysite/httpdocs/test.map");
> $layer1=$map->getLayerByName("test1");
> $layer1->cluster;
FYI the line "$layer1->cluster;" does nothing.
> $layer1->set("filteritem", "attribute 1");
> $layer1->setFilter("/target/");
>
I haven't used the cluster stuff myself so I am not exactly clear on how
it should be used, but if you are trying to set the cluster's expression
then you might have more luck using:
$layer1->cluster->setFilter("/target/");
After quickly re-reading the RFC it's not clear to me what the cluster
filter does and against which attribute the expression will be
evaluated. There is also a GROUP expression in the clusterObj which is
supposed to define how the grouping would be made (but once again how
does it work). Perhaps Tamas could clarify that here and in docs with a
few examples?
--
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000
More information about the MapServer-users
mailing list