[fdo-users] Spatial Query with MySQL FDO provider

Dan Stoica dan.stoica at autodesk.com
Fri Feb 16 16:50:38 EST 2007


What Gavin says is correct: in the case of mispelled geometry property
you get a native MySql error:

[1064] You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ')' at line 1

It is strange you don't get it for POINT ("Only POINT seems to work.")

By any chance, are you passing the string with single quotes like:

	selCmd->SetFilter(L"'geometry INTERSECTS GEOMFROMTEXT
('LINESTRING XY (2536400 481800, 2536500 481900)')' ");

In this case you'll get: 

"(.\Src\Fdo\Parse\Parse.cpp: 353) String does not represent a valid
filter.  [(\Src\Fdo\Parse\Parse.cpp: 346) String incorrectly formatted.
]"

So, please check the quotes and let me know what is the case.

Dan.



-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Gavin Cramer
Sent: Friday, February 16, 2007 4:08 PM
To: George McLean; fdo-users at lists.osgeo.org
Subject: RE: [fdo-users] Spatial Query with MySQL FDO provider

I just tried it by quickly hacking a unit test, and both the POINT and
LINESTRING examples worked for me.  I am using MySQL 5.0.24a.

However, I did notice that when I misspelled the property name (it was
supposed to be "Geometry" for the unit test), the resulting error
message was from MySQL, regarding a bad ')'.  It was not a complaint
about the column name, nor was it an FDO SQL translation exception about
a property name that you might expect if you created the filter using
C++ objects, e.g. with FdoSpatialCondition::Create().

Is this any help?

Gavin


-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of George McLean
Sent: Thursday, February 15, 2007 6:15 PM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] Spatial Query with MySQL FDO provider

I am having trouble writing spatial queries against MySQL 5.0.18 using 
the OSGeo.MySQL.3.2 provider

I pass the string 'geometry INTERSECTS GEOMFROMTEXT ('POINT XY (2536400 
481800)')' to the SetFilter method of an MgFeatureQueryOptions object. 
When I call selectFeatures from a feature service object, I get no
errors.

When I use the filter string 'geometry INTERSECTS GEOMFROMTEXT 
('LINESTRING XY (2536400 481800, 2536500 481900)')' I get the following 
error on selection:

An exception occurred in FDO component. String does not represent a 
valid filter.

As far as I can tell the query string is OK. I have the same problem 
with using POLYGON as the geometry as well. Only POINT seems to work. 
When I query the capabilities of the MySQL provider it appears to me 
that LINESTRING and POLYGON are supported.

Any suggestions?

Thanks

George McLean
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users


More information about the fdo-users mailing list