Re: Spatial query...
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.