Spatial Query with MySQL FDO provider

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Spatial Query with MySQL FDO provider

George McLean
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
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: Spatial Query with MySQL FDO provider

Gavin Cramer
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: [hidden email]
[mailto:[hidden email]] On Behalf Of George McLean
Sent: Thursday, February 15, 2007 6:15 PM
To: [hidden email]
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
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

RE: Spatial Query with MySQL FDO provider

Dan Stoica
In reply to this post by George McLean
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: [hidden email]
[mailto:[hidden email]] On Behalf Of Gavin Cramer
Sent: Friday, February 16, 2007 4:08 PM
To: George McLean; [hidden email]
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: [hidden email]
[mailto:[hidden email]] On Behalf Of George McLean
Sent: Thursday, February 15, 2007 6:15 PM
To: [hidden email]
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
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial Query with MySQL FDO provider

George McLean
Thanks Dan and Gavin,

I should have some time to check my syntax later this week. I appreciate
the help!

George

Dan Stoica wrote:

> 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: [hidden email]
> [mailto:[hidden email]] On Behalf Of Gavin Cramer
> Sent: Friday, February 16, 2007 4:08 PM
> To: George McLean; [hidden email]
> 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: [hidden email]
> [mailto:[hidden email]] On Behalf Of George McLean
> Sent: Thursday, February 15, 2007 6:15 PM
> To: [hidden email]
> 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
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
>
>  

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial Query with MySQL FDO provider

George McLean
In reply to this post by Dan Stoica
Dan,

Would you mind posting the correct syntax for the LINESTRING filter you
show below? I am still not having an success with this.

Thanks,

George

Dan Stoica wrote:

> 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: [hidden email]
> [mailto:[hidden email]] On Behalf Of Gavin Cramer
> Sent: Friday, February 16, 2007 4:08 PM
> To: George McLean; [hidden email]
> 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: [hidden email]
> [mailto:[hidden email]] On Behalf Of George McLean
> Sent: Thursday, February 15, 2007 6:15 PM
> To: [hidden email]
> 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
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
>
>  

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Spatial Query with MySQL FDO provider

George McLean
In reply to this post by Dan Stoica
Dan and Gavin,

It was a simple syntax error but I was confused because I could make the
Point geometry work. You pointed me in the right direction. Thanks again!

George


Dan Stoica wrote:

> 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: [hidden email]
> [mailto:[hidden email]] On Behalf Of Gavin Cramer
> Sent: Friday, February 16, 2007 4:08 PM
> To: George McLean; [hidden email]
> 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: [hidden email]
> [mailto:[hidden email]] On Behalf Of George McLean
> Sent: Thursday, February 15, 2007 6:15 PM
> To: [hidden email]
> 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
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
> _______________________________________________
> fdo-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-users
>
>
>  

_______________________________________________
fdo-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-users