Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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