List:General Discussion« Previous MessageNext Message »
From:Onur UZUN Date:April 18 2010 1:52pm
Subject:Re: What returns from distance function?
View as plain text  
I used below query from http://lists.mysql.com/mysql/219805

SET @center = GeomFromText( 'POINT(39.78824896727801 30.50930339115439)' )
;# MySQL returned an empty result set (i.e. zero rows).

SET @radius = 0.005;# MySQL returned an empty result set (i.e. zero rows).

SET @bbox = GeomFromText( CONCAT( 'POLYGON((', X( @center ) - @radius , ' ',
Y( @center ) - @radius , ',', X( @center ) + @radius , ' ', Y( @center ) -
@radius , ',', X( @center ) + @radius , ' ', Y( @center ) + @radius , ',',
X( @center ) - @radius , ' ', Y( @center ) + @radius , ',', X( @center ) -
@radius , ' ', Y( @center ) - @radius , '))' ) ) ;# MySQL returned an empty
result set (i.e. zero rows).

SELECT astext( point ) , Distance( @center , point ) AS dist
FROM psn.psn_place
WHERE MBRContains( @bbox , point )
ORDER BY dist
LIMIT 10;

I don't know type of 'dist' in this result, I need 'dist' column in meter
format.

+------------------------------------------+---------------------+
| astext( point )                          | dist                |
+------------------------------------------+---------------------+
| POINT(39.7872360228843 30.5097413063049) | 0.00110355155014048 |
| POINT(39.7872648779901 30.5084055662155) | 0.00133211161219657 |
| POINT(39.7871288466708 30.5080997943878) | 0.00164417619226759 |
+------------------------------------------+---------------------+


On Sun, Apr 18, 2010 at 4:25 PM, Onur UZUN <onuruzun05@stripped> wrote:

> Distance between two points. but in which type? and how can i convert this
> value to meter?

Thread
What returns from distance function?Onur UZUN18 Apr
  • Re: What returns from distance function?Onur UZUN18 Apr