lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Ireson (JIRA)" <>
Subject [jira] [Commented] (SOLR-8197) Make zero counts in heatmap PNG transparent
Date Thu, 04 Jan 2018 14:55:00 GMT


Neil Ireson commented on SOLR-8197:

Thanks for the reply.

Originally I developed a system to explore UK crime statistics, more recently this is being
used to plot (100+ million) GPS points from a mobile tracking app. The heatmap is used to
show stop and transition points for various types of users and transportation. I was using
the fact Solr could send PNG to handle the case when the local client or communication speed
is limiting the responsiveness of the UI. The user can chose where the image is created. However
due to the sensitivity of the tracking data we use a proxy NodeJS server between the client
and Solr server, so I could remove the functionality to directly present the Solr PNG and
instead provide the option to create the heatmap image on the proxy server. 

That said I think mapping zero to the transparent value would be useful for anyone who wishes
to display the PNG, as a "cheap" way to view the heatmap. 

> Make zero counts in heatmap PNG transparent
> -------------------------------------------
>                 Key: SOLR-8197
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>          Components: spatial
>            Reporter: Neil Ireson
>            Priority: Minor
>         Attachments: transparency.patch
> It would be useful to have transparent zero values so that I can overlay the image as
a layer on a map.
> The change just requires altering two methods in as follows:
> {code}
> static void writeCountAtColumnRow(BufferedImage image, int rows, int c, int r, int val)
> {
>       image.setRGB(c, rows - 1 - r, val == 0 ? 0 : val ^ 0xFF_00_00_00);
> }
> static int getCountAtColumnRow(BufferedImage image, int rows, int c, int r)
> {
>       int val = image.getRGB(c, rows - 1 - r);
>       return val == 0 ? 0 : val ^ 0xFF_00_00_00;
> }
> {code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message