Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

First time using PostGIS in an app.

Target:
- 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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.