[postgis-users] Geographic Binning - How to?

Dylan Beaudette debeaudette at ucdavis.edu
Fri Dec 26 16:16:11 PST 2008


On Friday 26 December 2008, adam at spatialsystems.org wrote:
> I'm not sure how to do Geographic Binning of data or if it's possible with
> PostGIS.
>
> I have millions of GPS data points of RF signal measurements taken every
> second from a car traveling in a major city.  I want to divide the data
> into 30 meter sections and average the data points for every section.  So
> when I drive through an intersection twice or overlap drive routes, the
> data will show up as one point averaged out.
>
> Can someone give me a lead on how to geographically bin data out of
> PostGIS?
>
> Thanks,
> Adam

Sounds like a wardriving exercise. See ST_SnapToGrid() for "binning", then 
aggregate on the (x,y) coordinates of the returned geometry.

Here is an example:

http://casoilresource.lawr.ucdavis.edu/drupal/node/485

Dylan

-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341



More information about the postgis-users mailing list