Function intersects : unexpected behaviour

Function intersects : unexpected behaviour

am 18.06.2003 13:56:49 von Garlenc Laurent

> Hello,
>
> I may underline a bug within the intersects funtion (spatial extensions) distributed with mysql-standard-4.1.0-alpha-pc-linux-i686.
>
> Here is the problem definition :
> It seems that the function intersects ALWAYS return 0 when there is only one line in the table on which the query is made.
>
> Here is the problem illustration :
>
> mysql> create table city(City VARCHAR(30),Location geometry);
> Query OK, 0 rows affected (0.02 sec)
>
> mysql> insert into city values("Paris",GeomFromText('POINT(2.33 48.87)'));
> Query OK, 1 row affected (0.00 sec)
>
> mysql> select City from city where (select intersects(GeomFromText(AsText(Location)),GeomFromText('Poly gon((2 50, 2.5 50, 2.5 47, 2 47, 2 50))'))=0);
> +-------+
> | City |
> +-------+
> | Paris |
> +-------+
> 1 row in set (0.00 sec)
>

>
> This behaviour is unexpected because Paris is included in the defined Polygon.
>
>
> mysql> insert into city values("Toulouse",GeomFromText('POINT(1.43 43.6)'));
> Query OK, 1 row affected (0.00 sec)
>
> mysql> select City from city;
> +----------+
> | City |
> +----------+
> | Paris |
> | Toulouse |
> +----------+
> 2 rows in set (0.00 sec)
>
> mysql> select City from city where (select intersects(GeomFromText(AsText(Location)),GeomFromText('Poly gon((2 50, 2.5 50, 2.5 47, 2 47, 2 50))'))=0);
> +----------+
> | City |
> +----------+
> | Toulouse |
> +----------+
> 1 row in set (0.00 sec)
>

>
> When there is another line in the table, the intersects function seems to work correctly.
>
> Thank you for your feedbacks,
>
> Laurent Garlenc
>

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: Function intersects : unexpected behaviour

am 19.06.2003 10:10:52 von Ramil Kalimullin

Garlenc Laurent wrote:
>>Hello,
>>
>>I may underline a bug within the intersects funtion (spatial extensions) distributed with mysql-standard-4.1.0-alpha-pc-linux-i686.
>>
>>Here is the problem definition :
>>It seems that the function intersects ALWAYS return 0 when there is only one line in the table on which the query is made.

Thank you for the bug report.
It seems the problem is in the subselect code and we work on it.

You can rewrite your query:

select City from city where
intersects(GeomFromText(AsText(Location)),GeomFromText('Poly gon((2 50,
2.5 50, 2.5 47, 2 47, 2 50))'))=0;

to get right result.

BTW, in the future please use our bug system http://bugs.mysql.com to
report bugs.

Regards,
Ramil.
--
For technical support contracts, visit https://order.mysql.com/?ref=mrka
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Ramil Kalimullin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Izhevsk, Russia
<___/ www.mysql.com


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: Function intersects : unexpected behaviour

am 19.06.2003 17:19:04 von Sanja Byelkin

Hi!

On Wed, Jun 18, 2003 at 01:56:49PM +0200, Garlenc Laurent wrote:
> > Hello,
> >
> > I may underline a bug within the intersects funtion (spatial extensions) distributed with mysql-standard-4.1.0-alpha-pc-linux-i686.
> >
> > Here is the problem definition :
> > It seems that the function intersects ALWAYS return 0 when there is only one line in the table on which the query is made.
> >
> > Here is the problem illustration :
> >
> > mysql> create table city(City VARCHAR(30),Location geometry);
> > Query OK, 0 rows affected (0.02 sec)
> >
> > mysql> insert into city values("Paris",GeomFromText('POINT(2.33 48.87)'));
> > Query OK, 1 row affected (0.00 sec)
> >
> > mysql> select City from city where (select intersects(GeomFromText(AsText(Location)),GeomFromText('Poly gon((2 50, 2.5 50, 2.5 47, 2 47, 2 50))'))=0);
> > +-------+
> > | City |
> > +-------+
> > | Paris |
> > +-------+
> > 1 row in set (0.00 sec)
> >

> >
> > This behaviour is unexpected because Paris is included in the defined Polygon.

Thank you for excellent bugreport, but this bug is same with 442 and 443 which
are in patch pending state (i.e. patch is committed, but waiting for
approving)

[skip]

--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: Function intersects : unexpected behaviour

am 19.06.2003 17:29:49 von Sanja Byelkin

On Thu, Jun 19, 2003 at 06:19:04PM +0300, Sanja Byelkin wrote:
[skip]
> Thank you for excellent bugreport, but this bug is same with 442 and 443 which
> are in patch pending state (i.e. patch is committed, but waiting for
> approving)

oops. Sorry, I mistaken.

--
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Oleksandr Byelkin
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Lugansk, Ukraine
<___/ www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org