FAQ
Hi all,

I was to extract the '_lines' (path) if the lines are contained or on by a
box-like polygon. The result turns wrong if the box-like polygon is
changed from a square (x_max = y_max) to a rectangle (x_max <> y_max).

Please also notice that although the _lines #2 is contained by both square
and rectangle, it does not appear in both table.

I am wondering if it is a bug. Perhapes I did something wrong?

regards,
Daniel Lau
Hong Kong University of Science and Technology

Example:
_____________________________________________________________________

test=# select * from test;
geoid | _lines
-------+---------------------------------------
0 | ((0,0),(1,1))
1 | ((1,1),(0,0))
2 | ((833749,820999),(844362,821001))
3 | ((1000000,1000000),(1000001,1000001))
4 | ((0,0),(1,1),(3,-1))
(5 rows)

test=# select * from test where polygon(pclose(_lines)) @ polygon
'(-2,-2),(850000,850000)';
geoid | _lines
-------+---------------
0 | ((0,0),(1,1))
1 | ((1,1),(0,0))
(2 rows)

test=# select * from test where polygon(pclose(_lines)) @ polygon
'(-2,-2),(840000,850000)';
geoid | _lines
-------+--------
(0 rows)

Search Discussions

•  at Dec 22, 2003 at 3:34 pm ⇧

Daniel Lau writes:
I was to extract the '_lines' (path) if the lines are contained or on by a
box-like polygon. The result turns wrong if the box-like polygon is
changed from a square (x_max = y_max) to a rectangle (x_max <> y_max).
The examples you give are not "box-like"; they are in fact just line
segments. You need four points to define a box-like polygon.

AFAICS the quoted example is correct behavior.

regards, tom lane
•  at Dec 29, 2003 at 4:18 am ⇧
Thank you for answering my question.

regards,
Daniel
On Mon, 22 Dec 2003, Tom Lane wrote:

Daniel Lau <iedaniel@ust.hk> writes:
I was to extract the '_lines' (path) if the lines are contained or on by a
box-like polygon. The result turns wrong if the box-like polygon is
changed from a square (x_max = y_max) to a rectangle (x_max <> y_max).
The examples you give are not "box-like"; they are in fact just line
segments. You need four points to define a box-like polygon.

AFAICS the quoted example is correct behavior.

regards, tom lane

Related Discussions

Discussion Overview
 group pgsql-bugs categories postgresql posted Dec 22, '03 at 9:08a active Dec 29, '03 at 4:18a posts 3 users 2 website postgresql.org irc #postgresql

2 users in discussion

Content

People

Support

Translate

site design / logo © 2021 Grokbase