gis - Check if a point is near a linestring with MySQL Spatial Extension (untrustable) -


i have discover if given point @ least 500 meters (ou other distance) route line exist in database recorded using mysql spatial.

i see there no similar function in mysql spatial, , find previous answer doesn't work me because line big (more 300km) check solution point point: find n nearest linestring point using mysql spatial extensions

i'm can't create buffer (a circle/polygon given radius) point check if touch.


update - 12/7 did it, mysql spatial seams not trustable. made createbuffer function, create 20 points polygon around given point meters given distance radius: http://pastebin.com/xefb8zxi

i'm testing qgis given results buffer, , fine function (except meters decimal degress value generate smaller expected, not issue right now).

and made few intersects checks, , aways return true, if result polygon not intersects line. remade same tests using center point, , results same. discovery intersect doesn't check linestring point or polygon, bounding box of linestring, when indicate point outside linestring bbox.

intersects query "rota" linestring data:

 select intersects(rota, createbuffer(geomfromtext('point(-19.7736 -43.7255)'),500))   log_viagem rota not null; 

how can trust mysql spatial now? or concept intersects wrong?


solved: didn't read important note @ 5.5 version of mysql:

note currently, mysql not implement these functions according specification. implemented return same result corresponding mbr-based functions.

the solution taking server administrator update 5.6.1, there upgrade in note

note mysql implemented these functions such used object bounding rectangles , returned same result corresponding mbr-based functions. of mysql 5.6.1, corresponding versions available use precise object shapes. these versions named st_ prefix. example, contains() uses object bounding rectangles, whereas st_contains() uses object shapes.

as of mysql 5.6.1, there st_ aliases existing spatial functions exact. example, st_isempty() alias isempty()


Comments