<HTML dir=ltr><HEAD><TITLE>[postgis-users] Centroid Within Multi Part Polygon</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText2832 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Simon,</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>I must commend you on the very nice instructive site you have.  Now for a nit-pcik.  Your link to the PostGIS site is broken!</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>This might be a stupid question - but it wasn't obvious to me so I will ask it.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>I presume the function you have is embedded in your</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2><A href="http://www.spatialdbadvisor.com/files/spatialdbadvisor_oracle_spatial_types_and_packages.zip">http://www.spatialdbadvisor.com/files/spatialdbadvisor_oracle_spatial_types_and_packages.zip</A></FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>But wasn't quite clear what it would be named and what .sql file to find it in or if it depends on numerous files.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>Regina</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> postgis-users-bounces@postgis.refractions.net on behalf of Simon Greener<BR><B>Sent:</B> Mon 6/18/2007 6:07 PM<BR><B>To:</B> postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] Centroid Within Multi Part Polygon<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Someone asked recently about a centroid function which guaranteed that<BR>the created centroid:<BR><BR>1. Fell within a polygon (not outside it as is the case with<BR>implementations that average the X and Y coords of an area);<BR>2. If the polygon is multi-part, put the centroid in the largest part.<BR><BR>I have just such a function but it is currently Oracle PL/SQL based. It<BR>does both of the above + also have an overloaded version which will<BR>return a multi-point object wherein each point is the centroid of each<BR>disperate part in a multi-part polygon. The functions have been heavily<BR>tested with many datasets and are pretty well guaranteed to work. I also<BR>have a Java version.<BR><BR>I do not know PostgreSQL's implementation of PL/SQL but I suspect I<BR>could convert the code pretty easily.  I do not have the time at the<BR>moment to convert them but if anyone wants to download them from my<BR>website (see below) and convert them please feel free. All I ask if for<BR>a copy of the PostgreSQL implementation for hosting back on my website.<BR><BR>regards<BR>Simon<BR>--<BR>SpatialDB Advice and Solutions Architecture,<BR>Oracle Spatial, ArcSDE, Manifold GIS, Radius Topology and Studio<BR>Specialist.<BR>39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia.<BR>Website: www.spatialdbadvisor.com<BR>   Email: simon@spatialdbadvisor.com<BR>   Voice: +61 362 396397<BR>Mobile: +61 418 396391<BR>Skype: sggreener<BR>Longitude: 147.20515<BR>Latitude: -43.01530<BR>NAC:W80CK 7SWP3<BR>_______________________________________________<BR>postgis-users mailing list<BR>postgis-users@postgis.refractions.net<BR><A href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR></FONT></P></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>