[postgis-users] Centroid Within Multi Part Polygon

Obe, Regina robe.dnd at cityofboston.gov
Mon Jun 18 17:33:00 PDT 2007


Simon,
 
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!
 
This might be a stupid question - but it wasn't obvious to me so I will ask it.
 
I presume the function you have is embedded in your
 
http://www.spatialdbadvisor.com/files/spatialdbadvisor_oracle_spatial_types_and_packages.zip
 
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.
 
Thanks,
Regina

________________________________

From: postgis-users-bounces at postgis.refractions.net on behalf of Simon Greener
Sent: Mon 6/18/2007 6:07 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Centroid Within Multi Part Polygon



Someone asked recently about a centroid function which guaranteed that
the created centroid:

1. Fell within a polygon (not outside it as is the case with
implementations that average the X and Y coords of an area);
2. If the polygon is multi-part, put the centroid in the largest part.

I have just such a function but it is currently Oracle PL/SQL based. It
does both of the above + also have an overloaded version which will
return a multi-point object wherein each point is the centroid of each
disperate part in a multi-part polygon. The functions have been heavily
tested with many datasets and are pretty well guaranteed to work. I also
have a Java version.

I do not know PostgreSQL's implementation of PL/SQL but I suspect I
could convert the code pretty easily.  I do not have the time at the
moment to convert them but if anyone wants to download them from my
website (see below) and convert them please feel free. All I ask if for
a copy of the PostgreSQL implementation for hosting back on my website.

regards
Simon
--
SpatialDB Advice and Solutions Architecture,
Oracle Spatial, ArcSDE, Manifold GIS, Radius Topology and Studio
Specialist.
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia.
Website: www.spatialdbadvisor.com
   Email: simon at spatialdbadvisor.com
   Voice: +61 362 396397
Mobile: +61 418 396391
Skype: sggreener
Longitude: 147.20515
Latitude: -43.01530
NAC:W80CK 7SWP3
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




-----------------------------------------
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070618/13e2dc56/attachment.html>


More information about the postgis-users mailing list