<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Yamini,<br>
<br>
Are you sure that multipolygons is what you want to work with?
Since a multipolygon can consist of multiple polygons (obviously)
who share a common centroid that can be way outside your actual
polygons.<br>
<br>
That said, I would make use of ST_Dumppoints to do that.<br>
Something like:<br>
============<br>
WITH pointsdump AS<br>
(<br>
SELECT gid, ST_Centroid(geom) AS centre,
(ST_Dumppoints(geom)).geom AS point FROM polygontable<br>
)<br>
<br>
SELECT gid, ST_Distance(centre, point) AS distance FROM pointsdump<br>
===========<br>
<br>
Now for every point in a geometry with a known gid you will see
the distance to it's centroid.<br>
You can do statistics on these numbers with something like:<br>
SELECT gid, avg(distance) avg, max(distance) max, etc... FROM
results GROUP BY gid<br>
<br>
Cheers,<br>
Tom<br>
<br>
On 30-7-2012 15:04, Yamini Singh wrote:<br>
</div>
<blockquote cite="mid:SNT131-W191EDF8C3A988183433217A9C60@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<div dir="ltr">
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am looking for suggestions for the
following problem I have
at hand.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoListParagraph"
style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]-->1.<span
style="font-size: 7pt; font-family: 'Times New Roman'; ">
</span><!--[endif]-->I have a table that contain multipolygons<o:p></o:p></p>
<p class="MsoListParagraph"
style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]-->2.<span
style="font-size: 7pt; font-family: 'Times New Roman'; ">
</span><!--[endif]-->I want to calculate the maximum distance
of
points that form the polygon from the centroid
of the polygon. For example of the polygon is formed of 50
points then I want
to have distance of all the 50 points from the centroid of the
polygon.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am not sure if someone has done this
before. But I am
finding it difficult to implement it. Any help in this regards
is welcome…<o:p></o:p></p>
<p class="MsoNormal"><br>
</p>
<p class="MsoNormal">Best,</p>
<p class="MsoNormal">YJS</p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
<br>
</body>
</html>