Hello again,<br><br>I found the generate_series function (yes i am a newbie!) and I can use it in order to calculate the distance between<br> my centroid (geometry_centroid) and my polygon (geometry_zone) with the following request<br>

<br><br>SELECT (distance_spheroid(geometry_centroid,ST_AsText(ST_PointN(ExteriorRing(geometry_zone), generate_series(1,(SELECT npoints(geometry_zone) FROM "208_1_26624_zones" WHERE "cellID"='1')))), 'SPHEROID["WGS 84",6378137,298.257223563]')) as d FROM "208_1_26624_zones" WHERE "cellID"='1';<br>

<br>Now I can't use the max function because of the following error: "set-valued function called in context that cannot accept a set"<br>when I use<br><br>SELECT
max(distance_spheroid(geometry_centroid,ST_AsText(ST_PointN(ExteriorRing(geometry_zone),
generate_series(1,(SELECT npoints(geometry_zone) FROM
"208_1_26624_zones" WHERE "cellID"='1')))), 'SPHEROID["WGS
84",6378137,298.257223563]')) as d FROM "208_1_26624_zones" WHERE
"cellID"='1';<br>
<br>
<br>any idea ?<br><br>thanks!<br>Nick<br><br><br><div class="gmail_quote">2009/2/18 My Pid <span dir="ltr"><<a href="mailto:mamat750@gmail.com" target="_blank">mamat750@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br><br>I would like to know how I could get the maximum distance between a POINT and a POLYGON.<br>


(the POINT i am talking about here is in fact the ST_Centroid of the mentionned POLYGON)<br><br>I looked for a function that transform my POLYGON into several POINT but without success.<br>
<br>I am working with longitude, latitude, altitude for POINT<br>It is really the max distance that I am looking for (not the minimum distance.)<br>and "accuracy" is important to me.<br><br>thanks in advance for your help !<br>



<br>regards,<br>Nick<br><br><br>
</blockquote></div><br>