1

I'm having a bit of a problem with clustering in map server the clustering itself works fine and the GetFeatureInfo works fine most of the time. However some times when I click on a cluster point it some times gives a different number to how many points are meant to be in the cluster.

See this example cluster should contain 171 points but clicking on it gives 173.

Cluster Incorrect

Here is my mapfile I've removed the classes as its ridiculously long with them and I don't think its relevant

MAP
  FONTSET "fonts.list"
  IMAGETYPE "png"
  MAXSIZE 3000
  NAME "TEST"
  SIZE 1000 1000
  STATUS ON
  UNITS DD

  OUTPUTFORMAT
    NAME "png"
    MIMETYPE "image/png"
    DRIVER "AGG/PNG"
    EXTENSION "png"
    IMAGEMODE RGB
    TRANSPARENT FALSE
  END # OUTPUTFORMAT

  SYMBOL
    NAME "circle"
    TYPE ELLIPSE
    FILLED TRUE
    POINTS
      1 1
    END
  END

  PROJECTION
    "init=epsg:4326"
  END # PROJECTION
  LEGEND
    KEYSIZE 20 10
    KEYSPACING 5 5
    LABEL
      SIZE MEDIUM
      OFFSET 0 0
      SHADOWSIZE 1 1
      TYPE BITMAP
    END # LABEL
    STATUS OFF
  END # LEGEND

  QUERYMAP
    SIZE -1 -1
    STATUS OFF
    STYLE HILITE
  END # QUERYMAP

  SCALEBAR
    INTERVALS 4
    LABEL
      SIZE MEDIUM
      OFFSET 0 0
      SHADOWSIZE 1 1
      TYPE BITMAP
    END # LABEL
    SIZE 200 3
    STATUS OFF
    UNITS MILES
  END # SCALEBAR

  WEB
    METADATA
      "wms_srs" "EPSG:900913"
      "ows_enable_request"  "*"
      "wms_title"   "Testing"
    END # METADATA
  END # WEB

  LAYER
    CLASSITEM "Cluster:FeatureCount"
    CLUSTER
      BUFFER 10
      REGION "ellipse"
    END # CLUSTER
    CONNECTION ""
    CONNECTIONTYPE POSTGIS
    DATA "position from data"
    LABELCACHE OFF
    LABELITEM "Cluster:FeatureCount"
    METADATA
      "wms_include_items"   "all"
      "wms_timeitem"    "datetime"
      "wms_timeextent"  "1910-01-01/2050-02-01"
      "gml_include_items"   "all"
      "gml_geometries"  "none"
      "wms_title"   "Data"
    END # METADATA
    NAME "test1"
    PROCESSING "GETSHAPE_STYLE_ITEMS=all"
    PROCESSING "LABEL_NO_CLIP=True"
    PROCESSING "CLUSTER_GET_ALL_SHAPES=ON"
    PROCESSING "ITEMS=id"
    STATUS OFF
    TEMPLATE "blank.html"
    TILEITEM "location"
    TOLERANCE 10
    TYPE POINT
    UNITS METERS


    CLASSES_HERE
  END # LAYER

END # MAP

I hope that provides enough for some suggestions on the issues if any more information is required please do let me know, any suggestions would be highly appreciated.

  • Could it be that you are picking up more than one cluster, for example a cluster of 2 that is hiding beneath the cluster of 171. What happens if you reduce the TOLERANCE value to 1? – nmtoken Apr 28 '14 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.