Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Hi I am trying to generate heatmap using Geoserver Transformation SLD. as mentioned on the page, It requires few parameters:

  1. data
  2. weightAttr
  3. radiusPixels
  4. pixelsPerCell
  5. outputBBOX
  6. outputWidth and
  7. outputHeight

I am able to use it by specifying these parameters directly in SLD as default parameters. But i am not able to pass it as OpenLayers request. There is my code:

    var layer = new OpenLayers.Layer.WMS("Heat Map",
      "http://port/geoserver/wms", 
      {
        layers: 'work:cbsa_pop', 
        format: "image/png",
        transparent: "true",
        styles:'heatmap',
        maxExtent: new OpenLayers.Bounds(-124.269,32.545,-114.354,41.956),
        projection: new OpenLayers.Projection("EPSG:4326"),
        data:'data_attr',
        weightAttr:'w_attr',
        radiusPixels:100,
        pixelsPerCell:100,
        BBOX:new OpenLayers.Bounds(-124.269,32.545,-114.354,41.956),
        outputWidth:1000,
        outputHeight:1000
    });

This way it is not accepting any of the parameter. Any guidance will be helpful.

share|improve this question
    
please show the full error –  iant Jun 23 '13 at 18:52
    
@iant : It is not giving any error but I am also not getting image which in other case (SLD with default specification), I am getting proper Heatmap. –  anand Jun 23 '13 at 19:23

2 Answers 2

Look at the "env" filter function, you can pass parameters to it via the env=k1:v1;k2:v2 request parameter.

share|improve this answer
    
I tried that way but i am getting error .. Unexpected token = –  anand Jun 23 '13 at 14:04

I'm having the same problem. It seems that with this URL (from fresh Geoserver 2.2):

http://yourserver.org/geoserver/usa/wms?LAYERS=usa%3Astates&STYLES=heatmap&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG%3A4326&BBOX=-73.248829406739,41.360256530762,-70.498977111817,42.523655578614&WIDTH=780&HEIGHT=330&weightAttr=FAMILIES

Adding in &weightAttr=FAMILIES should tell it to use the FAMILIES parameter for weighting

But I get the exact same image as if I didn't use that value. Likewise if I add &ENV=weightAttr:FAMILIES

Any ideas?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.