Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



The Heat Map Generator finds and visualizes hot spots within your data. This 
could be mapping concentrated areas of cell phone activity, places of high 
population density, or the likeliest kill points in a first-person shooter. 

This package contains three functions: 

1. The heat_map function processes your data, and outputs a histogram or heat 
map bins of high density locations.

2. The heat_map_image function uses the output from heat_map to generate an 
image file. 

3. A demonstration python program that takes heat map output and overlays your data over Google maps.


You can install by running the SQL statements in
or, to uninstall,
Note that the SQL statements assume that you have copied this package to a 
node in	your cluster and are running them from there.

Alternatively, assuming vsql is in your path, just do:

$ make install
$ make uninstall

If you have downloaded this package from Github, rather than from the Vertica Marketplace, you must build it before you can install it:


To build from source code:

$ make


1. heat_map(x,y)

	x, y (float, int, or numeric) - The required data columns.
	w (float, int, or numeric) - (Optional see parameters) weight of the point

Optional Parameters: 
	xbins, ybins (int) - The number of horizontal and vertical bins.
	xmin, ymin, xmax, ymax (float) - Set and constrain specific extrema to
	                          the specified values
	normalize (int)  - Leave the data as a raw count, or normalize it (0-4). 
		   0 - No normalization (default)
		   1 - Normalizes by dividing by max count, all weights will
		        be between 0 and 1
		   2 - Normalizes by dividing by max count and makes sum of 
		        bin weights total to 1
		   3 - Normalizes by dividing by shifting min to 0 then
		        dividing by max counts
	gaussian (bool) - Turn Gaussian blur (smoothing) on or off in the heatmap. 
	bounding_box (bool) - Turn on the bounding box coordinates in output
	use_weigts (bool) - Turn on weighting of points by a third input value 

	Heat Map Histogram, or heat map bins.
	Each bin is output as a single row with:
	     x, y (numeric) - the top left corner of the bin
	     x_t, y_t (numeric) - (optional; see bounding_box param) the bottom 
	     	         right corner of the bin
	     c (float) - the count/weight of the bin

2. heat_map_image(x,y,c)

	Required input: 
		x, y - The required data columns.
		c - The count, or weight.

	Optional input: 
		file_in (string)  - The background image used (PNG only)
		file_out (string) - The location for the image output
		width (int)  -	The desired width of the final image in pixels (1 - 2560)
		height (int) -	The desired height of the final image in pixels (1 - 2560)
		gaussian (boolean)- Turns on image level Gaussian smoothing
		overlay (boolean) - Automatically overlays the created heatmap image
							onto the given input file (if given)
		contour (boolean) - Turns on a different color scheme that stratifies the
							weights of each pixel and puts them into fully-colored
							"buckets" of heat. In order of intensity: red, yellow,
							green, blue
		xflip (boolean) -	Flips all of the pixels across the y-axis (assumes
							origin is center of image)
		yflip (boolean) -	Same as above, except flips across the x-axis

		The image file (in png format)
		The x y red green blue alpha info of pixels (x, y, r, b, g, a)


	Required input: 
		x, y - The required data columns.
		x_t, y_t - The bounding box
		c - The count, or weight.
	Input Format: (equivalent to output of heat_map())
	x | y | x_t | y_t | c 

		HTML file.

See the examples file for samples of usage.


No performance metrics.


Please see LICENSE.txt