<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=226414413-06102008><FONT face=Arial 
color=#0000ff size=2>You mean like to concatenate all the point 
field information in one field in the poly.  Also the below I gave was 
to create a new set of data.  To update a poly field by concatenating all 
the field information from the points.  Try something 
like</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=226414413-06102008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=226414413-06102008><FONT face=Arial 
color=#0000ff size=2>UPDATE table1</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=226414413-06102008><FONT face=Arial 
color=#0000ff size=2>SET somefield =  array_to_string(ARRAY(SELECT DISTINCT 
point.somefield </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=226414413-06102008><FONT face=Arial 
color=#0000ff 
size=2>            FROM 
table2 As point </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=226414413-06102008><FONT face=Arial 
color=#0000ff 
size=2>            WHERE 
point.somefield > '' AND ST_Intersects(table1.the_geom, 
point.the_geom)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=226414413-06102008>    <FONT 
face=Arial color=#0000ff size=2>), ",");</FONT></SPAN></DIV>
<DIV><SPAN class=226414413-06102008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=226414413-06102008><FONT face=Arial color=#0000ff size=2>Hope 
that helps,</FONT></SPAN></DIV>
<DIV><SPAN class=226414413-06102008><FONT face=Arial color=#0000ff 
size=2>Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
</B>Intengu Technologies<BR><B>Sent:</B> Monday, October 06, 2008 8:08 
AM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> Re: [postgis-users] 
Newbie question - Transfer attributes fromonefeature to 
another<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>Regina,<BR><BR>Solution 3 is would work fine, but was hoping for a 
solution to transfer the attributes into one field without duplicating the 
poly.<BR><BR>Thanks for the pointer.<BR><BR><BR>
<DIV class=gmail_quote>2008/10/6 Obe, Regina <SPAN dir=ltr><<A 
href="mailto:robe.dnd@cityofboston.gov">robe.dnd@cityofboston.gov</A>></SPAN><BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
  <DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN>Sindile,</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>If a 
  polygon has one or more point features and you want to transfer the attributes 
  from the point feature to the polygon feature, then what do you do in cases 
  where there are multiple points in a polygon</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>would 
  you</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>1) pick 
  the first one you hit</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>2) Sum up, 
  take the max etc. of each</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>3) 
  Duplicate the poly for each point?</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>In all 
  cases, you will want to do an intersect check</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>(solution 
  1)</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>SELECT 
  DISTINCT ON(poly.gid) poly.gid, poly.the_geom, point.somefield1 As somefield1, 
  point.somefield2 As somefield2</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN>FROM</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>table1 As 
  poly INNER JOIN table2 As point</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>ON 
  ST_Intersects(poly.the_geom, point.the_geom)</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>ORDER 
  BY poly.gid, point.gid;</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV></SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>(solution 
  to 2 would look something like this)</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>SELECT 
  poly.gid, poly.the_geom, SUM(point.somefield1) As totsomefield1, 
  MAX(point.somefield2) As maxsomefield2</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN>FROM</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>table1 As 
  poly INNER JOIN table2 As point</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>ON 
  ST_Intersects(poly.the_geom, point.the_geom)</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>GROUP BY 
  poly.gid, poly.the_geom;</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>(solution 
  to 3)</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN><SPAN>  
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>SELECT 
  poly.gid, poly.the_geom, point.somefield1 As somefield1, point.somefield2 As 
  somefield2</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN>FROM</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>table1 As 
  poly INNER JOIN table2 As point</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>ON 
  ST_Intersects(poly.the_geom, point.the_geom)</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>Hope that 
  helps,</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN>Regina</SPAN></FONT></DIV></SPAN></SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
  size=2><SPAN></SPAN></FONT> </DIV><BR>
  <DIV lang=en-us dir=ltr align=left>
  <HR>
  <FONT face=Tahoma size=2><B>From:</B> <A 
  href="mailto:postgis-users-bounces@postgis.refractions.net" 
  target=_blank>postgis-users-bounces@postgis.refractions.net</A> [mailto:<A 
  href="mailto:postgis-users-bounces@postgis.refractions.net" 
  target=_blank>postgis-users-bounces@postgis.refractions.net</A>] <B>On Behalf 
  Of </B>Intengu Technologies<BR><B>Sent:</B> Monday, October 06, 2008 4:47 
  AM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> [postgis-users] 
  Newbie question - Transfer attributes from onefeature to 
  another<BR></FONT><BR></DIV>
  <DIV>
  <DIV></DIV>
  <DIV class=Wj3C7c>
  <DIV></DIV>
  <DIV dir=ltr>I have a polygon (table1) and a point (table2) feature and would 
  want to transfer attributes from the point feature to the polygon feature 
  based on whether the point feature is completely enclosed by the polygon 
  feature.<BR>The polygon feature can have one or more point 
  features.<BR><BR>How do i transfer the attributes.<BR><BR clear=all><BR>-- 
  <BR>Sindile Bidla<BR></DIV></DIV></DIV></DIV>
  <DIV>
  <P></P>
  <HR SIZE=1>

  <P><B>The substance of this message, including any attachments, may be 
  confidential, legally privileged and/or exempt from disclosure pursuant to 
  Massachusetts law. It is intended solely for the addressee. If you received 
  this in error, please contact the sender and delete the material from any 
  computer. </B></P></DIV>
  <P></P>
  <HR SIZE=1>

  <P><B><FONT color=#339900 size=2>Help make the earth a greener place. If at 
  all possible resist printing this email and join us in saving paper. 
  </FONT></B></P>
  <P></P><BR>_______________________________________________<BR>postgis-users 
  mailing list<BR><A 
  href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR><A 
  href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
  target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR><BR></BLOCKQUOTE></DIV><BR><BR 
clear=all><BR>-- <BR>Sindile Bidla<BR></DIV></BODY></HTML>

<HTML><BODY><P><hr size=1></P>
<P><STRONG>
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>