3

I have created a map file broadly as shown below. I then created 6 points as in the DATA_TABLE. The 3 on the left have val 100 and the three on the right have val 1.

When I view this layer it renders as follows. With both sides looking the same? Why is the val value not affecting the weight and hence the colour ramp.

Have I misinterpreted something?

I was expecting the higher valued items on the left to be "redder".

enter image description here

LAYER
  NAME feature_heatmap
  TYPE raster
  CONNECTIONTYPE kerneldensity
  CONNECTION "point_data"
  STATUS ON


  PROCESSING "RANGE_COLORSPACE=HSL"
  PROCESSING "KERNELDENSITY_RADIUS=50"
  PROCESSING "KERNELDENSITY_COMPUTE_BORDERS=ON"
  PROCESSING "KERNELDENSITY_NORMALIZATION=1"
  OFFSITE 0 0 0

    CLASS
          STYLE
            COLORRANGE  "#0000FFFF"  "#FF0000FF"
            DATARANGE 0 255
          END
    END

 END

 LAYER
      PROJECTION
        "init=epsg:4326"
        "init=epsg:3857"
        "init=epsg:27700"
      END # PROJECTION


      NAME "point_data"
      STATUS ON
      TYPE POINT
      CONNECTIONTYPE POSTGIS
      <OBFUSCATED CONNECTION DETAILS>
      DATA "wkb_geometry from (SELECT wkb_geometry, feature_id as id, val::INTEGER as VAL FROM DATA_TABLE)))  AS FOO USING UNIQUE id using srid=4326"
      CLASSITEM val
          CLASS
            STYLE
              SIZE [val]
            END 
          END 

 END
  • Just one thing to note your PROJECTION should only have one epsg code (the source data can't be in all 3 projections) – geographika Dec 1 '16 at 14:37
  • Any luck with "KERNELDENSITY_NORMALIZATION=AUTO" ? – geographika Dec 1 '16 at 14:41
  • Nope. Exactly the same result. – CitizenFish Dec 1 '16 at 14:54
1

Time to raise my hand and admit that this was a data issue not a mapfile one. The mapfile above works fine. The data view I had behind it didn't and hence caused all values to be the same.

0

Have you tried RANGEITEM in STYLE of the CLASS. Let say your value field is "MyRunningAverage", then it could be

  PROCESSING "RANGE_COLORSPACE=HSL"
  PROCESSING "KERNELDENSITY_RADIUS=50"
  PROCESSING "KERNELDENSITY_COMPUTE_BORDERS=ON"
  PROCESSING "KERNELDENSITY_NORMALIZATION=1"
  OFFSITE 0 0 0    
  CLASS
     STYLE
          RANGEITEM "MyRunningAverage"
          COLORRANGE "#0000FFFF"  "#FF0000FF"
          DATARANGE 0 255
      END # STYLE
END

Your Answer

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

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