go-heatmap
go-heatmap copied to clipboard
Add option to disable transformations.
Creating heatmaps to be overlaid on Google Maps requires precisely controlling the projection and scale of plotted points. The transformation feature doesn't fit this use case well so the option to disable it is handy.
Before accepting this, could you possibly add a license to the repo to make it clear what the conditions for use are? I'd be fine with GPL but something like MIT or BSD would be nice.
Also I've found that when feeding in co-ordinates, I often find them upside-down when using the translate function.
I'm not a GPL fan... Added an MIT thing copied from another repo.
Do you have an example of the difference this produces?
On Wed, Sep 16, 2015 at 8:34 AM bobobo1618 [email protected] wrote:
Before accepting this, could you possibly add a license to the repo to make it clear what the conditions for use are? I'd be fine with GPL but something like MIT or BSD would be nice.
Also I've found that when feeding in co-ordinates, I often find them upside-down when using the translate function.
— Reply to this email directly or view it on GitHub https://github.com/dustin/go-heatmap/pull/2#issuecomment-140778696.
Thanks!
I don't have images on hand right now but if you want them for docs I'll add some later tonight. If you wanted them to see what my code does, if I have a set of GPS coordinates from LA mapped using the Mercator projection and scaled to meet my required image size, the existing code 'zooms in' on LA while my new code maintains a worldwide view.
On Wed, 16 Sep 2015, 08:43 Dustin Sallings [email protected] wrote:
I'm not a GPL fan... Added an MIT thing copied from another repo.
Do you have an example of the difference this produces?
On Wed, Sep 16, 2015 at 8:34 AM bobobo1618 [email protected] wrote:
Before accepting this, could you possibly add a license to the repo to make it clear what the conditions for use are? I'd be fine with GPL but something like MIT or BSD would be nice.
Also I've found that when feeding in co-ordinates, I often find them upside-down when using the translate function.
— Reply to this email directly or view it on GitHub https://github.com/dustin/go-heatmap/pull/2#issuecomment-140778696.
— Reply to this email directly or view it on GitHub https://github.com/dustin/go-heatmap/pull/2#issuecomment-140781680.
Here's an example using a randomly generated sample of points between 1 and 256 on a 1024x1024 heatmap:
Before my change (transform=true):

The 256x256 blob is expanded to take up the full 1024x1024 image.
After my change (transform=false):

The 256x256 blob is left in the corner it was generated in, fitting well into situations where precise location is needed for things like map overlays.
@dustin I'm happy to fix this up and merge - is it ok with you? As @bobobo1618 points out, the data is "stretched" into whatever size image is given and this is not desired for my use case.
This exact use case came up for me on a project recently, I copied the contents of the PR into my local clone, but it would be nice to see this get merged at some point
I second @Rossiar 's suggestion of getting this merged.
This is exactly i need!
I've apparently completely forgotten about this. I think it would be fine since it seems to be useful for people.
Is there a test case that works reasonably here? I updated the commit to build properly, but my test data + no transform = doesn't seem to do anything.
Any update on this?