First time using PostGIS in an app.

- Get Heat Map of customers from address table using leaflet.js and heatmap.js

Have DB called store_dev. Installed OSM Bright from Mapbox in it.

Have a table called "addresses" with street, city, state, zip, lat and lng. When user enters Address I get lat / lng from openstreetmap nomination service.

Do I need to store anything else?
Nomination returns things like boundingbox and polygonpoints, any advantage on storing this?

1 Answer 1


You need only lat/lng to show your customer visits with heatmap.js. Leaflet.js has getBounds() method returning the rectangle you map is currently showing, use it to select whatever customer hit locations should be shown on a map. Here's an example for this kind of spatial queries. Optionally you can store hit times to show only recent customer activity and to make your heat spots "cool off" with time. To make this work, store your lat/lng info as PostGis geometries, i.e. points for this case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.