[ 
https://issues.apache.org/jira/browse/SOLR-8197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16311428#comment-16311428
 ] 

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: https://issues.apache.org/jira/browse/SOLR-8197
>             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 SpatialHeatmapFacets.java 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
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to