MySQL Forums
Forum List  »  GIS

Re: Spatial query...
Posted by: Jose Paredes
Date: November 23, 2008 11:23PM

Hi petrus.
------------------------------------------------
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)'))

whereas the following query returns the expected result set?

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(44.44 33.33)'))
---------------------------------------------------
Look, you only need the first part of your sentence, then the last one actually is taken from a column allready in WKT format, then not neededany conversion.

Try this:

elect 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))'),astext(location);

location is a geometric column, use astext() to convert to WKT, and use directly on the query.

Regards.
Jose Paredes.

Options: ReplyQuote


Subject
Views
Written By
Posted
8687
November 28, 2006 11:46AM
3566
April 04, 2007 04:41AM
Re: Spatial query...
3675
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.