1

I'm trying generate a heatmap from my PostGIS table, but my map is empty...

Here is my config file:

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=auto"
  OFFSITE 0 0 0

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

And my "point_data" layer:

layer
    name "point_data"
    status on
    processing "close_connection=defer"
    extent -180 -90 180 90
    projection
        "init=epsg:4326"
    end
    connectiontype postgis
    connection "MY CONNECTION STRING"
    data "geom from my_geom_table using unique id using srid=4326"
    type point
    metadata
        "ows_title" "feature_heatmap"
        "ows_abstract" "Test heatmap"
        "ows_srs" "epsg:4326"
        "ows_enable_request" "*"
        "wms_timeitem" "pass_time"
        "wms_timeextent" "2001-01-01/2018-12-31"
        "wms_timedefault" "2001-01-01"
    end
end

My result: enter image description here

Only "point_data" layer:

enter image description here

  • What is your MapServer version? – user30184 Jun 1 '18 at 16:17
  • @user30184 Version is 7.0.7 – user3240723 Jun 1 '18 at 16:28
  • i just enabled DEBUG and i'm getting: "no overlap ... no result" – user3240723 Jun 1 '18 at 16:34
  • How does the GetMap request look? – user30184 Jun 1 '18 at 16:44
  • https://MY_URL/wms?service=WMS&request=GetMap&layers=feature_heatmap&styles=&format=image%2Fpng&transparent=true&version=1.1.1&width=512&height=512&srs=EPSG%3A4326&bbox=-45,-40.979898069620134,-22.5,-21.94304553343818 – user3240723 Jun 1 '18 at 16:45
1

Your mapfile works for me. I made some small changes and digitized a few points into a shapefile "heatmap_points.shp" as test data.

This is my mapfile

MAP
  NAME ""
  STATUS ON
MAXSIZE 5000  
CONFIG "MS_ERRORFILE" "c:\ms4w\apps\heatmap_error.txt"
CONFIG "CPL_DEBUG" "ON"
EXTENT -180 -90 180 90
  SIZE 600 600 
  SHAPEPATH "c:/ms4w/tmp/ms_tmp"
  IMAGECOLOR 255 255 255
  UNITS METERS
  WEB
    IMAGEPATH "c:/ms4w/tmp/ms_tmp"
    IMAGEURL "c:/ms4w/tmp/ms_tmp"
      METADATA
      "ows_enable_request" "*"      
      "wms_srs"    "EPSG:4326"
      "wms_onlineresource"    "http://localhost:80/cgi-bin/mapserv?map=c:/ms4w/apps/heatmap.map"
      "wms_title"    "heatmaptest"
     END
  END
    PROJECTION
    "init=epsg:4326" 
  END
  DEBUG OFF


  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=auto"
  OFFSITE 0 0 0

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

layer
    name "point_data"
    status on
    extent -180 -90 180 90
    projection
        "init=epsg:4326"
    end
    data heatmap_points
    type point
    metadata
        "ows_title" "heatmap_points"
        "ows_abstract" "Test heatmap"
        "ows_srs" "epsg:4326"
        "ows_enable_request" "*"
    end
end   

END

This is my WMS GetMap request:

http://localhost/cgi-bin/mapserv.exe?
map=c:\ms4w\apps\heatmap.map&
REQUEST=GetMap&
SERVICE=WMS&
VERSION=1.1.1&
WIDTH=1284&
HEIGHT=744&
LAYERS=feature_heatmap&
TRANSPARENT=TRUE&
FORMAT=image%2Fpng&
BBOX=-170.68595869761833,-22.853271028037383,-27.082732891166728,60.356074766355135&
SRS=EPSG:4326&
STYLES=

And this is the result shown together with USA map from another WMS

enter image description here

  • which mapserver version are you using? – user3240723 Jun 21 '18 at 18:39
  • The image above was generated by MapServer version 7.0.7 (MS4W 3.2.3). – user30184 Jun 21 '18 at 19:17
  • Are you using the "mode=map"? I cant get it working without this parameter.. – user3240723 Jun 21 '18 at 19:57
  • In my log i see: "msResampleGDALToMap(): no overlap ... no result." when i dont use mode=map in request – user3240723 Jun 21 '18 at 19:57
  • I was testing with a WMS client as you can see from the GetMap request in my answer. By looking at the log message if you use WMS your BBOX is outside your data. – user30184 Jun 21 '18 at 20:43

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.