MySQL Forums
Forum List  »  GIS

Re: Spatial query...
Posted by: Albert Rovira
Date: April 04, 2007 04:41AM

geopetrus Wrote:
-------------------------------------------------------
> I have a table called images that has a column
> called location of type point. Can someone please
> tell me why the following query returns zero
> results:
>
> select x(a.location), y(a.location) from images a
> where MBRContains(GeomFromText('Polygon((1.0
> 2.0,56.0 2.0, 56.0 66.0,1.0 66.0,1.0
> 2.0))'),GeomFromText('Point(x(a.location)
> y(a.location)'))

You are passing the STRING 'Point(x(a.location) y(a.location)'
to GeomFromText that expects a WKT format. You can try something like :

GeomFromText(concat('Point(',x(a.location),' ',y(a.location),')'))

Albert.

Options: ReplyQuote


Subject
Views
Written By
Posted
8475
November 28, 2006 11:46AM
Re: Spatial query...
3506
April 04, 2007 04:41AM
3611
November 23, 2008 11:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.