Re: [BUGS] postgres 9.2.2 point conversion from polygon doesn't always give accurate center

2013-02-04 Thread Colin Dunklau
You nailed it, stupid typos. Sorry for the inconvenience, and thank you all for your assistance. On Sun, Feb 3, 2013 at 3:33 AM, Simon Riggs wrote: > On 1 February 2013 17:54, Colin Dunklau wrote: > >> For the below two queries, I expect to get a result of (0.5, 0.5). >> >> cdunklau=# select po

Re: [BUGS] postgres 9.2.2 point conversion from polygon doesn't always give accurate center

2013-02-03 Thread Tom Lane
Dean Rasheed writes: >>> 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. > Although, if that's really how it's being calculated, then that's not > really the centroid. Yeah --- according to the wikipedia

Re: [BUGS] postgres 9.2.2 point conversion from polygon doesn't always give accurate center

2013-02-03 Thread Simon Riggs
On 1 February 2013 17:54, Colin Dunklau wrote: > For the below two queries, I expect to get a result of (0.5, 0.5). > > cdunklau=# select point( polygon '((0,0),(0,1),(1,1),(0,1))'); > point > - > (0.25,0.75) > (1 row) > I think you just simply mistyped the coordinates... srigg

Re: [BUGS] postgres 9.2.2 point conversion from polygon doesn't always give accurate center

2013-02-03 Thread Dean Rasheed
On 3 February 2013 09:16, Dean Rasheed wrote: >> 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. Although, if that's really how it's being calculated, then that's not really the centroid. Consider for exam

Re: [BUGS] postgres 9.2.2 point conversion from polygon doesn't always give accurate center

2013-02-03 Thread Dean Rasheed
On 1 February 2013 22:16, Tom Lane wrote: > Colin Dunklau 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 th

Re: [BUGS] postgres 9.2.2 point conversion from polygon doesn't always give accurate center

2013-02-01 Thread Tom Lane
Colin Dunklau 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 > retur

[BUGS] postgres 9.2.2 point conversion from polygon doesn't always give accurate center

2013-02-01 Thread Colin Dunklau
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