New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC108 - Heatmap/Interpolation Layer creation #4857

Merged
merged 1 commit into from Feb 13, 2014

Conversation

Projects
None yet
5 participants
@tbonfort
Member

tbonfort commented Jan 30, 2014

This issue tracks the development of RFC-108: http://mapserver.org/development/rfc/ms-rfc-108.html

@sdlime

This comment has been minimized.

Show comment
Hide comment
@sdlime

sdlime Jan 30, 2014

Member

Awesome addition! Now I can ditch some hacks I dropped into GDAL years ago and a processing chain that also included imagemagick. Got any samples? --Steve


From: Thomas Bonfort [notifications@github.com]
Sent: Thursday, January 30, 2014 9:30 AM
To: mapserver/mapserver
Subject: [mapserver] RFC108 - Heatmap/Interpolation Layer creation (#4857)

This issue tracks the development of RFC-108: http://mapserver.org/development/rfc/ms-rfc-108.html


You can merge this Pull Request by running

git pull https://github.com/tbonfort/mapserver heatmaps

Or view, comment on, or merge it at:

#4857

Commit Summary

  • scafolding for heatmap support
  • some more
  • wip
  • wip
  • fix hsl2rgb
  • wip interpolation maps
  • add options
  • correct projection, configurable attribute

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com/mapserver/mapserver/pull/4857.

Member

sdlime commented Jan 30, 2014

Awesome addition! Now I can ditch some hacks I dropped into GDAL years ago and a processing chain that also included imagemagick. Got any samples? --Steve


From: Thomas Bonfort [notifications@github.com]
Sent: Thursday, January 30, 2014 9:30 AM
To: mapserver/mapserver
Subject: [mapserver] RFC108 - Heatmap/Interpolation Layer creation (#4857)

This issue tracks the development of RFC-108: http://mapserver.org/development/rfc/ms-rfc-108.html


You can merge this Pull Request by running

git pull https://github.com/tbonfort/mapserver heatmaps

Or view, comment on, or merge it at:

#4857

Commit Summary

  • scafolding for heatmap support
  • some more
  • wip
  • wip
  • fix hsl2rgb
  • wip interpolation maps
  • add options
  • correct projection, configurable attribute

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com/mapserver/mapserver/pull/4857.

Show outdated Hide outdated interpolation.c

tbonfort added a commit to tbonfort/msautotest that referenced this pull request Feb 13, 2014

Implement RFC108 heatmap support (#4857)
also adds:
 - rfc86 scaletoken substitutions for PROCESSING entries
 - proj fastpaths for 3857->4326 reprojections

@tbonfort tbonfort merged commit 6676cea into mapserver:master Feb 13, 2014

1 check passed

default The Travis CI build passed
Details
@hlherrera

This comment has been minimized.

Show comment
Hide comment
@hlherrera

hlherrera Aug 27, 2014

I was revising your code,
After compile the project. I did some test and had an uncontrolled exception(Segmentation fault).
I ran shp2img program with a layer of type kerneldensity:

layer
name "heatmap"
type raster
connectiontype kerneldensity
connection "points"
status off
processing "RANGE_COLORSPACE=HSL"
processing "KERNELDENSITY_RADIUS=50"
processing "KERNELDENSITY_ATTRIBUTE=VAL"
processing "KERNELDENSITY_COMPUTE_BORDERS=ON"
processing "KERNELDENSITY_NORMALIZATION=AUTO"
offsite 0 0 0
class
style
COLORRANGE "#0000ff00" "#0000ffff"
DATARANGE 0 32
end
style
COLORRANGE "#0000ffff" "#ff0000ff"
DATARANGE 32 255
end
end
end

layer
name "points"
status on
type POINT
data "points.shp"
class
style
size [intensity]
end
end
end

But layer 'points' had an extent different(outside) from map's extent.
It return status = MS_DONE in kerneldensity.c(#190) file because 'searchrect' didnt overlap.
Later in mapraster.c I had (hDS == NULL) line#717 and calling function msDrawRasterGetCPLErrorMsg(decrypted_path, szPath) throws an exception because decrypted_path is null;

I suggest to initialize decrypted_path always, not only when layer->connectiontype != MS_KERNELDENSITY :
decrypted_path = msDecryptStringTokens( map, szPath );
if( decrypted_path == NULL )
return MS_FAILURE;

I did that and it works...

hlherrera commented on 6676cea Aug 27, 2014

I was revising your code,
After compile the project. I did some test and had an uncontrolled exception(Segmentation fault).
I ran shp2img program with a layer of type kerneldensity:

layer
name "heatmap"
type raster
connectiontype kerneldensity
connection "points"
status off
processing "RANGE_COLORSPACE=HSL"
processing "KERNELDENSITY_RADIUS=50"
processing "KERNELDENSITY_ATTRIBUTE=VAL"
processing "KERNELDENSITY_COMPUTE_BORDERS=ON"
processing "KERNELDENSITY_NORMALIZATION=AUTO"
offsite 0 0 0
class
style
COLORRANGE "#0000ff00" "#0000ffff"
DATARANGE 0 32
end
style
COLORRANGE "#0000ffff" "#ff0000ff"
DATARANGE 32 255
end
end
end

layer
name "points"
status on
type POINT
data "points.shp"
class
style
size [intensity]
end
end
end

But layer 'points' had an extent different(outside) from map's extent.
It return status = MS_DONE in kerneldensity.c(#190) file because 'searchrect' didnt overlap.
Later in mapraster.c I had (hDS == NULL) line#717 and calling function msDrawRasterGetCPLErrorMsg(decrypted_path, szPath) throws an exception because decrypted_path is null;

I suggest to initialize decrypted_path always, not only when layer->connectiontype != MS_KERNELDENSITY :
decrypted_path = msDecryptStringTokens( map, szPath );
if( decrypted_path == NULL )
return MS_FAILURE;

I did that and it works...

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Sep 23, 2014

Member

@hlherrera thanks for reporting. I've added a fix in 5bfaf9b and some tests in mapserver/msautotest_DEPRECATED@85a91d8 , let me know if it works for you to.

Member

tbonfort replied Sep 23, 2014

@hlherrera thanks for reporting. I've added a fix in 5bfaf9b and some tests in mapserver/msautotest_DEPRECATED@85a91d8 , let me know if it works for you to.

tbonfort added a commit to mapserver/msautotest_DEPRECATED that referenced this pull request Sep 23, 2014

@hlherrera

This comment has been minimized.

Show comment
Hide comment
@hlherrera

hlherrera Oct 13, 2014

It works!!!

hlherrera commented Oct 13, 2014

It works!!!

@Yogurt4

This comment has been minimized.

Show comment
Hide comment
@Yogurt4

Yogurt4 Jun 28, 2015

Hi. I was just wondering if this feature could be used to plot a data grid. (And if not, whether it could be developed.)
We have various distribution maps. However, instead of colouring by density of scattered points, we have measurement points on a rectangular grid. The values can come from soil chemistry, air pollution, humidity, etc.
What we need is an interpolation between the measurement points, like the isothermal or isobar plot in the weather forecast.

Or, imagine the SRTM (Surface Radar Terrain Model) data from NASA. It is also a rectangular grid of elevation data. Using this data one could draw an elevation map in MapServer.

Yogurt4 commented Jun 28, 2015

Hi. I was just wondering if this feature could be used to plot a data grid. (And if not, whether it could be developed.)
We have various distribution maps. However, instead of colouring by density of scattered points, we have measurement points on a rectangular grid. The values can come from soil chemistry, air pollution, humidity, etc.
What we need is an interpolation between the measurement points, like the isothermal or isobar plot in the weather forecast.

Or, imagine the SRTM (Surface Radar Terrain Model) data from NASA. It is also a rectangular grid of elevation data. Using this data one could draw an elevation map in MapServer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment