Colin Dunklau <colin.dunk...@gmail.com> writes:
> Hello! I believe I've found a bug in the type conversion process from
> polygon to point.

> In the documentation found here
> http://www.postgresql.org/docs/9.2/interactive/functions-geometry.html,

> Table 9-32 claims that running the point() function on a polygon
> returns the "center of polygon". This is not the case for some
> polygons, as shown below.

It looks like what the code is actually computing is the average X
position and average Y position of the points listed in the polygon.
I'm not sure how defensible that algorithm is (the comment attached
to it mumbles something about how it should be the weighted means
of the line segments instead).  But for non-convex polygons like
these I'm not sure there's any intuitively correct answer.  If you
want us to change the code to produce the answers you exhibit, you'd
better explain (1) how you got them and (2) why that's the right
answer and the current way is wrong.

                        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to