go-heatmap icon indicating copy to clipboard operation
go-heatmap copied to clipboard

Add option to disable transformations.

Open bobobo1618 opened this issue 10 years ago • 11 comments

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.

bobobo1618 avatar Sep 16 '15 15:09 bobobo1618

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.

bobobo1618 avatar Sep 16 '15 15:09 bobobo1618

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.

dustin avatar Sep 16 '15 15:09 dustin

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.

bobobo1618 avatar Sep 16 '15 15:09 bobobo1618

Here's an example using a randomly generated sample of points between 1 and 256 on a 1024x1024 heatmap:

Before my change (transform=true):

test2

The 256x256 blob is expanded to take up the full 1024x1024 image.

After my change (transform=false):

test1

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.

bobobo1618 avatar Sep 16 '15 23:09 bobobo1618

@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.

Rossiar avatar Jun 12 '18 13:06 Rossiar

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

GarrettKelley avatar Aug 17 '18 12:08 GarrettKelley

I second @Rossiar 's suggestion of getting this merged.

cmitchell avatar Aug 29 '18 11:08 cmitchell

This is exactly i need!

Icaro-Lima avatar Feb 26 '19 18:02 Icaro-Lima

I've apparently completely forgotten about this. I think it would be fine since it seems to be useful for people.

dustin avatar Feb 26 '19 20:02 dustin

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.

dustin avatar Feb 26 '19 21:02 dustin

Any update on this?

andersfylling avatar Jun 02 '19 23:06 andersfylling