geospatial - Mariadb: geography -


i need check if distance between 2 geographic point less n km. i'm trying execute query:

select st_distance(   st_geomfromtext('point(45.764043 4.835658999999964)', 4326),   st_geomfromtext('point(45.750371 5.053963)', 4326) ) < :n 

but doesn't work because:

so far srid property dummy in mysql, stored part of geometries meta data actual calculations ignore , calculations done assuming euclidean (planar) geometry.

(https://mariadb.com/kb/en/mariadb/st_transform-missing/)

my goal convert distance metric distance or convert n degrees.

how can it? maybe, know better solution?

p.s. need solution based on spatial methods (or more better performance).

i don't think "distance" function available (yet) in spatial. there regular function in https://mariadb.com/kb/en/latitudelongitude-indexing/ work. however, args , output scaled lat/lng (10000*degrees). code altered avoid scaling, needed in context of blog page.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -