views:

1488

answers:

2

I need to find the centroid of a polygon in Oracle Spatial that exists inside of the polygon itself. I cannot use the sdo_geom.sdo_centroid method because this returns a point outside of the shape if the shape resembles a horseshoe.

I found sdo_geom.sdo_pointonsurface method, but it returns a point that is just on the edge of the polygon. While this mathematically works, it is not safe in our environment because all polygons share a boundary with other polygons and sometimes there is a slight overlap in the data. This overlap cannot include the calculated point.

Is there another approach to finding this point without writing custom code? I'm not opposed to writing custom code for this, but I would like to use something pre-built if it already exists.

Thanks!

+1  A: 

Simon Greener has a package for a "para-centroid": codesys.geom.sdo_centroid.

You can download it, but I don't know if there is any sort of licensing that is attached to the source.

Here are links:

http://bit.ly/T9eyy

http://www.spatialdbadvisor.com/source_code

Thanks! That is what I was looking for. I had come across the site but couldn't find where he actually put the source code. Thanks again!
j0rd4n
A: 

hey dude it's cool all that stuff about SDO Spatial in ORACLE