[postgis-users] Create polygon from buffered points
Dane Springmeyer
blake at hailmail.net
Wed Nov 14 17:27:35 PST 2007
John,
From your description it seems that the hotspot points represent
individual fires rather than locations around the periphery of
hotspots. Just in case the latter is true it seems like a potential
route would be to dissolve/union all points that relate to a single
fire, then calculate the convex hull of these points, then calculate
the area of that hull.
Here's the SQL:
SELECT ST_Area(St_ConvexHull(ST_Union(the_geom))) FROM hpt_test GROUP
BY fire_group
If my sense of the former is what you are after, your SQL would look
more like:
SELECT ST_Area(ST_Transform(ST_Union(ST_buffer(the_geom, 20000)),
102001)) FROM hpt_test GROUP BY some_unique_hotspot_id
Where 102001 is the ESRI epsg code for Canadian Albers, although this
projection is not in the spatial_ref_sys table of Postgis by default.
You'll have to add it in. You can get the SQL insertion text from
here: http://spatialreference.org/ref/epsg/102001/
That will give you a table listing of the areas of all the buffered
polygons that overlap.
Cheers,
Dane
On Nov 14, 2007, at 3:11 PM, Little, John wrote:
> Hi there,
>
> I am new to this list (and to postgis). I'd really appreciate some
> help with this problem (in my attempt to transfer this existing
> process from ESRI to PostGIS).
>
> I have a table containing points (hpt_test) representing wildfire
> hotspot locations, and I would like to create fire perimeter
> estimates (polygons) using these point locations -- here are the
> steps I intend to follow:
>
> 1) Buffer all points in table hpt_test (out 2000m) to produce
> polygons (circles) -- to be inserted into table hpt_buf_test,
>
> 2) Dissolve where these circles overlap to create single buffer
> polygons.
>
> 3) Perform an inside buffer (in -1300m) on the result polygon
> produced in step 2 -- this will help correct polygon shape.
>
> 4) Reproject (transform) to equal area projection (Albers-Canada)
> to calculate area
>
> The desired result will be a table containing rough fire perimeter
> estimates (fairly accurate on large size wildfires).
>
> Here is what I've done to prepare the buffer polygon table :
>
>
> CREATE TABLE cwfis_datamart.hpt_buf_test ( ID int4, NAME varchar
> (20) );
>
> SELECT AddGeometryColumn('cwfis_datamart','hpt_buf_test','the_geom',
> 42304,'MULTIPOLYGON',2);
>
>
> Now that I've got the table set up, I attempt to add buffer
> polygons to the table (step 1 above):
>
>
> INSERT INTO cwfis_datamart.hpt_buf_test (ID, NAME, the_geom)
> VALUES (1,'First Geometry',(SELECT buffer(the_geom,2000)
> FROM cwfis_datamart.hpt_test));
>
> But this (of course) does not work... and I have scoured the
> archives for clues but without success:( Please help me get started
> on this.
>
> I am aware that buffer is "a very expensive" process, but I can't
> think of an alternative. My test point table is very small, but in
> reality this would be a fairly large table, so I will likely need
> to break this up by region… If anyone can help me out with the sql,
> point me to helpful resources, or suggest a better alternative,
> please advise :)
>
> Thanks!
>
> John Little
> http://cwfis.cfs.nrcan.gc.ca/
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071114/64f2db9a/attachment.html>
More information about the postgis-users
mailing list