[mapguide-users] spatial filter question

George McLean gmclean at gorge.net
Mon Mar 5 17:29:56 EST 2007


Hello,

I have a map of utility infrastructure with point and line features 
representing different elements stored in a MySQL database. To try and 
isolate the process of selecting an element I have written my own 
function that captures the coordinates of a mouse click and then uses 
these coordinates to query features from the MySQL database. It appears 
to me when querying against a line feature that the spatial query uses 
the envelop created by the endpoints of the line. For example if I use a 
filter like:

"geometry within geomfromtext ('point (x y)')"

the query returns all the line features from the table where the point 
falls in the envelope of the line. Is this the normal behavior?

What I would like to be able to do is create a short line from the mouse 
coordinates and then select line features only where the two lines 
cross. I have tried queries like:

"geometry intersects geomfromtext('linestring (x0 y0, x1 y1)')"

or

"geometry crosses geomfromtext('linestring (x0 y0, x1 y1)')"

but I still select all line features whose envelopes the linestring crosses.

I am using the 3.2 FDO provider and if this is better directed towards 
the FDO list, please let me know.

Any suggestions would be appreciated.

George McLean




More information about the mapguide-users mailing list