[MapServer-users] mapserver union layer of type chart

Zmitser Kozhukh zmitserk at mail.ru
Fri Jun 7 03:08:45 PDT 2024


 
Hello,
 
just  wondering weather it is possible to have union (by connectiontype) layer of type chart? 
Yesterday I have tried, but each time got an empty image.
 
Configuration looks like:
 
LAYER
  NAME union_layer_name
  TYPE         CHART
  #PROCESSING "CHART_TYPE=pie"
  #PROCESSING "CHART_SIZE_RANGE=c 30 100 2 2000000 5"
  PROCESSING "ITEMS=province,c,n,y,ts,level_code"
  STYLEITEM "AUTO"
  STATUS DEFAULT
  CONNECTIONTYPE UNION
  CONNECTION "layer1,layer2 etc."
  METADATA
      ows_title         "name"
      ows_include_items '*'
      gml_include_items "all"
      gml_geom_type "point"
      ows_enable_request '*'
      "wms_timeextent" "2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023"
      "wms_timeitem" "ts"
      "wms_timedefault" "2009"
  END
  
  PROJECTION
    "init=epsg:4326"
  END
  
  VALIDATION
    'time' '[0-9]{4}'
    'default_time' '2009'
  END
  
    CLASS 
    END
  
  END
  
LAYER 
    NAME  layer1
    CONNECTIONTYPE POSTGIS
    CONNECTION "host=x dbname=x user=x password=x"
    DATA "geom_p from (... )   foo using unique province using srid=4326"
    
    STATUS       ON
    TYPE         CHART
    PROCESSING "CHART_TYPE=pie"
    PROCESSING "CHART_SIZE_RANGE=c 30 100 2 2000000 5"
    STATUS ON
    PROCESSING "LABEL_NO_CLIP=True"
    
    PROJECTION
      "init=epsg:4326"
    END
    
    VALIDATION
    'time' '[0-9]{4}'
    'default_time' '2009'
    END
    
    METADATA
      wms_title "layer 1"
      gml_include_items "all"
      gml_geom_type "point"
      ows_include_items  "all"
      ows_enable_request "*"
      "wms_timeextent" "2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023"
      "wms_timeitem" "ts"
      "wms_timedefault" "2009"
    END
    
    MAXSCALEDENOM 10000001
    MINSCALEDENOM 1200001
 
    FILTER ([level_code]=1)
    
etc...
 
If I uncomment these lines in union layer:
  #PROCESSING "CHART_TYPE=pie"
  #PROCESSING "CHART_SIZE_RANGE=c 30 100 2 2000000 5"
 
This works but returns an empty image. And if these lines are not there , mapserver breaks with internal error.
 
I have looked briefly through documentation but nowhere was mentioned that union layer doesn’t support type chart, so maybe there is something missing in my mapfile.
 
Another thing is that may be there are other better option for me rather than using union layer. The thing is that I would like to draw map charts for different administrative units based on map scales, let’s say if I am in small map scale to draw chart for the country, if I zoom in — for district, and if I zoom further — for municipality. I have tried to keep it all in one layer of type chart and use this type of class definitions:
class
expression ([level_code]=1)
minscaledenom 1000000
maxscaledenom 500000
…..
 
But it didn’t  work — apparently in layer of type chart keyword expression is not used in the same way as in other layers.
So,  would be grateful if someone could help me with this.
 
Sincerely, Zmitser
 
 
 
--
Zmitser Kozhukh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20240607/b2fa4c93/attachment.htm>


More information about the MapServer-users mailing list