<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>Create polygon from buffered points</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi there,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">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).</FONT></P>

<P><FONT SIZE=2 FACE="Arial">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: </FONT></P>

<P><FONT SIZE=2 FACE="Arial">1) Buffer all points in table hpt_test (out 2000m) to produce polygons (circles) -- to be inserted into table hpt_buf_test, </FONT></P>

<P><FONT SIZE=2 FACE="Arial">2) Dissolve where these circles overlap to create single buffer polygons.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">3) Perform an inside buffer (in -1300m) on the result polygon produced in step 2 -- this will help correct polygon shape.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">4) Reproject (transform) to equal area projection (Albers-Canada) to calculate area</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">The desired result will be a table containing rough fire perimeter estimates (fairly accurate on large size wildfires).</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Here is what I've done to prepare the buffer polygon table :</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Courier">CREATE TABLE cwfis_datamart.hpt_buf_test ( ID int4, NAME varchar(20) );</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier">SELECT AddGeometryColumn('cwfis_datamart','hpt_buf_test','the_geom',42304,'MULTIPOLYGON',2);</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">Now that I've got the table set up, I attempt to add buffer polygons to the table (step 1 above):</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Courier">INSERT INTO cwfis_datamart.hpt_buf_test (ID, NAME, the_geom)</FONT>

<BR><FONT SIZE=2 FACE="Courier">VALUES (1,'First Geometry',(SELECT buffer(the_geom,2000)</FONT>

<BR><FONT SIZE=2 FACE="Courier">FROM cwfis_datamart.hpt_test));</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">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.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">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 :)</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Thanks!</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">John Little</FONT>

<BR><A HREF="http://cwfis.cfs.nrcan.gc.ca/"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://cwfis.cfs.nrcan.gc.ca/</FONT></U></A>
</P>
<BR>
<BR>

</BODY>
</HTML>