Server-side preprocessing for Heatmap using PHP

I want to create a heat map from the GPS log data. The process is as follows:

  • I store log data in MySQL using Geospatial Indexing. A record consists of latitude / longitude data and a time stamp.
  • The admin panel has a Google map, and the administrator can move and scale the map.
  • Each time the map is scaled or shaded, the panel sends an AJAX request containing the boundary points of the map (north-east and south-west latitude / longitude).
  • Using the MySQL geospatial function, I can query the entire record inside this boundary.
  • I send the data of records that will be displayed by the Heatmap rendering library. (Right now I'm using Heatmap.js , a little bit buggy for Google Maps. Does anyone have a better suggestion?)

The problem is that my data is growing too large, so transferring data to the client and rendering the heat map is now becoming too slow. I think it would be nice to have script preprocessing for data aggregation, which would reduce the payload before sending it to the client’s browser and lightening the rendering. I'm still new to this job, so is there an existing PHP library that can do this?

+6
source share
1 answer

Yes, it will be faster in PHP.

I find this: http://blog.gmapify.fr/create-beautiful-tiled-heat-maps-with-php-and-gd

The tricky part is combining this with Google Maps to be scalable, I don’t see how you can achieve this in a simple way.

+1
source

Source: https://habr.com/ru/post/912008/


All Articles