[postgis-users] How can I divide up a region into a grid of rectangles?

Simon Greener simon at spatialdbadvisor.com
Fri Nov 11 15:17:38 PST 2011


It that which Regina Obe described in her article on generate_series the sort
of thing you want to do?

http://www.bostongis.com/blog/index.php?/categories/13-generate_series

regards
Simon
On Fri, 11 Nov 2011 15:19:54 +1100, Roxanne Reid-Bennett <rox at tara-lu.com> wrote:

> On 11/10/2011 7:37 PM, MarkW wrote:
>> This is kind of a simplistic approach maybe - because a simple grid
>> doesn't have to intersect with municipal features. But could you
>> simply decide on a rounding level that would give you what you wanted?
>> Round the lat/lons to a certain decimal level, then count by / group
>> on  those rounded lat/lons? Each one could represent centroid or a
>> corner of a grid.
>>
>
> Giving a very simplistic overview... Our current application creates "a
> grid" by using
> ST_SnapToGrid to collapse multiple points to one "standard" point. It
> then uses a
> polygon drawn on a map to create a "boundary".  Given a list of points
> and a polygon, using
> point && polygon [with a gist index on each] for speed
> and ST_Intersects(point,polygon) for accuracy you can collect
> whatever points are "in" the boundary ...
>
> Given a pre-defined grid size...
>
> If you don't want to hassle with boundaries right now, you can artificially
> create all the grid points within your lat/lon range, assign them a
> neighborhood, then look for "identical"
> snapped to grid points in your data with a straight equality test for
> the join
> to collect a count "in" a neighborhood.
>
> Make sure you are working with the "right" (or at least same) SRIDs.
>
> Roxanne
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>


-- 
Holder of "2011 Oracle Spatial Excellence Award for Education and Research."
SpatialDB Advice and Design, Solutions Architecture and Programming,
Oracle Database 10g Administrator Certified Associate; Oracle Database 10g SQL Certified Professional
Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE, Manifold GIS, FME, Radius Topology and Studio Specialist.
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia.
Website: www.spatialdbadvisor.com
   Email: simon at spatialdbadvisor.com
   Voice: +61 362 396397
Mobile: +61 418 396391
Skype: sggreener
Longitude: 147.20515 (147° 12' 18" E)
Latitude: -43.01530 (43° 00' 55" S)
GeoHash: r22em9r98wg
NAC:W80CK 7SWP3



More information about the postgis-users mailing list