<br><br><div><span class="gmail_quote">On 7/4/07, <b class="gmail_sendername">Webb Sprague</b> &lt;<a href="mailto:webb.sprague@gmail.com">webb.sprague@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You might want to look into the &quot;centroid&quot; function.&nbsp;&nbsp;I am not sure if<br>that is the best, but it is useful in general.</blockquote><div><br>Sorry ! I forgot to mention the centroid function in my post. <br><br>
But my main question is, what is the syntax for the centriod function when using a lot of points? Do I use multipoint?<br>&nbsp;<br>&nbsp;UPDATE table SET coords = CENTROID(geometryfromtext(&#39; MULTIPOINT( $lat1 $long1, $lat2 $long2, $lat3 $long3)&#39;, 4326))
<br><br>?<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">W<br><br>On 7/4/07, Steve Lefevre &lt;<a href="mailto:lawpoop@gmail.com">
lawpoop@gmail.com</a>&gt; wrote:<br>&gt; Hello all -<br>&gt;<br>&gt; I&#39;m working on a database with GIS data. In my table,&nbsp;&nbsp;I have columns for<br>&gt; latitude, longitude, and coordinates, which is the Postgis geometry data
<br>&gt; type. What I would like to do is find the midpoint or &#39;average&#39; for any<br>&gt; group of points.<br>&gt;<br>&gt; I have the latitude and longitude, and then I use this syntax to create the<br>&gt; coordinates column value:
<br>&gt;<br>&gt; UPDATE table SET coords =&nbsp;&nbsp;geometryfromtext(&#39;POINT( longitude latitude )&#39;,<br>&gt; 4326)<br>&gt;<br>&gt; ( 4326 is the projection value that I understand is useful in the United<br>&gt; States.<br>
&gt;<br>&gt; So now that I have a bunch of lats, longs, and coordinates, I need to find<br>&gt; the center point for any group of them. I can do a select query to get the<br>&gt; specific records I&#39;m looking for, and then I can have the list of lat&amp;long
<br>&gt; points, or the coordinate geometry. How then do I take those rows and create<br>&gt; an SQL st<br>&gt;<br>&gt;<br>&gt; UPDATE table SET coords = geometryfromtext(&#39; MULTIPOINT( $lat1 $long1,<br>&gt; $lat2 $long2, $lat3 $long3)&#39;, 4326)
<br>&gt;<br>&gt; Can I use the &#39;coords&#39; geometry object instead?<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; &quot;Computers are useless. They can only give you answers&quot;<br>&gt; -- Pablo Picasso<br>&gt; _______________________________________________
<br>&gt; postgis-users mailing list<br>&gt; <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>&gt; <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">
http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>&gt;<br>&gt;<br></blockquote></div><br><br clear="all"><br>-- <br>&quot;Computers are useless. They can only give you answers&quot;<br>-- Pablo Picasso