I am using the Javascript v3 API and I have a heatmap working with my data displaying where I have collected certain information. I want to create different heatmap overlays based on the data.
So I have a load of mobile signal strength data that I am plotting on the map and I want to show the good signal areas in green, bad in red but in areas where there are good and bad samples have an orange/yellow overlay.
I have found the 'weight' but it seems to be based on the number of occurrences of samples rather than the value of those samples. Can anyone help?
You may increase the weight to get a result that is more differentiated based on the weight, e.g. by using Math.pow
weight:Math.pow(signalStrength, 2)
(Modify the exponent to get a result that fits your needs)
Related
I am using geocoding and maps api to heatmap a lot of entries (12000+) (these will be filtered down to ~5-600 a map) currently using a random 500 dataset from these.
The problem is some of these addresses haven't geocoded correctly (e.g. showing miles away sometimes not on same continent) which is not an issue on it's own (happy for these to be ignored and just be in the oblivion) however these are drastically reducing visibility of map so when zoomed in even with opacity set as high as possible they are a barely visible pinprick on map.
Is there a simple way of just stopping these few erroneous entries from interfering or will I have to weed them out?
Below is sample of how it looks...
Compared to how I'd like it to look (different data set created created previously in fusion tables)...
(these are same zoom levels on google maps, top one just cropped more to show how difference)
For anyone else who come across this...
maxIntensity: The maximum intensity of the heatmap. By default, heatmap colors are dynamically scaled according to the greatest concentration of points at any particular pixel on the map. This property allows you to specify a fixed maximum. Setting the maximum intensity can be helpful when your dataset contains a few outliers with an unusually high intensity.
I found setting this on a sliding scale was best to dynamically adjust map depending on amount of data points in map.
I'm trying to create an interactive map (Google Map / OpenStreetMap etc.) showing a global grid of coloured squares representing temperature data. The length of each side of a square inside the grid is 0.5 degrees in terms of the UTM.
I have temperature data for the centre of each square on the grid. These could be min, max etc. I wish to plot this data on an interactive map so that the result will be a kind of heatmap where low values will be bluish and high values will be reddish.
I would expect the result to be similar to this, but interactive:
I have searched for about eight hours and I can't seem to find a viable solution.
I have looked at Fusion Tables, and followed a tutorial to get this example: Fusion Table Example, so I've looked into making a KML file of the 0.5 degrees grid, but got stuck here.
I have looked at CartoDB and made this but if you zoom in, the points are circular and scale smaller as you zoom in. I wish the points to be square and to stay the same size for all zoom levels.
I was thinking of doing something like this but I imagine having this grid on the entire global map would cause it to be very slow.
I hope to have drop-downs on the page to switch to different parameters like max, min temperature etc, and for the overlay to change.
I already have a grid working here but the user simply clicks on a grid to get the temperature graph for that grid. If the user could click something to turn on the coloured grid to see a kind of heat map when they zoom out, that would be great, but I'm a bit lost as to which direction to take. Any help would be greatly appreciated.
We are creating a Google Map with heatmap layer. We are trying to show the energy use of ~1300 companies spreadout over the United States. For each of the companies we have their lat/long and energy use in kWh. Our plan is to weight the companies on the heatmap by their kWh use. We have been able to produce the map with the heatlayer, however, because we have such a huge variance in energy use (ranging from thousands to billions of kWh), the companies using smaller amounts of energy are not showing up at all. Even when you zoom in on their location nothing you can't see any coloring on the map.
Is there a way to have all companies show up in the heatmap, no matter how small their energy use is? We have tried setting the MaxIntensity, but still have some of the smaller companies not showing up. We are also concerned about setting the MaxIntensity too low since we are then treating a companies using 50 million kWh the same as one using 3 billion kWh. Is there anyway to set a MinIntensity? Or to have some coloring visible on the map for all the companies?
Heatmap layers accept a gradient property, expecting an array of colors as its value. These colors will always have linear mapping against your sample starting from zero. Also, the first color (let's say, gradient[0]) should be transparent, for it's supposed to map zeroes or nulls. If you give a non transparent color to the first gradient point, then the whole world will have that color.
This means that if, for example, you enter a gradient of 20 points, all points weighting less than 1/20th of the maximum will show as interpolate between gradient[0] (transparent) and gradient[1] (the first non transparent color in your gradient). This will result in semi transparent datapoints for non normalized samples.
If you need to somehow flatten your values universe, you'll have to feed the Heatmap with precomputed values. For example, the value of log(kWh) will be a flatter curve to represent.
Another workaround would be to offset every value with a fraction of the maximum (for example, 10% of the maximum), so the minimum will be displaced from the zero in at least one color interval.
I'm working on the following scenario: I have a geographical location and I need to create a heat-map visualization of travel times (by car) from that location to anywhere around. I'm planning on using Google Distance Matrix API for getting travel duration. But, since it has a limit on the no of API calls, I need to somehow limit the calls.
My plan, so far, is the following: compute the travel duration (basically a numeric value) to a set of points evenly distributed on a grid around the given position (e.g. 0.5km east, 0.5 km east-0.5km north, 0.5 km east-1 km north etc.). This points would represent the centers of square-shaped areas and I will consider the travel duration to the center as the travel duration to anywhere in the area. Display these areas as colored squares on a Google Maps in a heatmap style.
A good example of something that looks alike is this: http://project.wnyc.org/transit-time/#40.72280,-73.95464,12,709 .
So, my questions are:
Does it seem like a good strategy?
Is there a better visualisation strategy for something like this?
How can I create those square-shaped colored areas on Google Maps?
Thanks!
Calculating duration would surely involve traffic flow rather than simply distance. If your calculations are purely on distance you could use the Google Maps direction requests to calculate the distance to each point.
I'm not sure a heat map is the way forward for this scenario.
There a number of way you could achieve this. Here's a few:
a. Use a custom overlay
(https://developers.google.com/maps/documentation/javascript/examples/overlay-simple)
b. Draw polygons on the map and give them different colours based on
the journey duration. This would involve taking the area in question and slicing it up in to polygons however you need to. These polygons could take the same shape as your example. You would need to be rather precise with your latlng. SQL's spacial querys would help you here depending on the tech your using. (https://developers.google.com/maps/documentation/javascript/examples/polygon-arrays)
c. Depending on how specific you wanted to be you could draw circles with different radius value and different colours.
d. You could make custom markers in the shapes you require and add them to the map in the correct latlng in order to fill an area. You could have different markers for different duration and add them accordingly.
I'm sure there are other options as well.
I have a google map which presents the distance from a particular location.
The map consists of a set of polygons, where a polygon encircles an area which is the same distance from the point. So in other words, I colour a region which is between 0 and 5 minutes from the point in one colour, between 5 and 10 in another colour, and so on up to 120 minutes. This gives me 20 different colours.
What rgb colours would you recommend I use to give a nice contrast on my map. Perhaps there is a standard algorithm for this. Otherwise I can use a lookup table since its only 20 different colours.
Thanks,
Barry
One possibility is to choose a single colour and set the Opacity so that the circles get progressively fainter as the radius increases. Whether this is a good solution may depend on what the importance of the information is.
UPDATE: A better solution is to adopt the MySociety colours as in this map which shows travel times to London. They've done a lot of this and if you write to them, they'll almost certainly let you have the scales they use.