MySQL Forums
Forum List  »  GIS

Re: What returns from distance function?
Posted by: Onur A
Date: April 18, 2010 11:13AM

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 |
+------------------------------------------+---------------------+

Options: ReplyQuote


Subject
Views
Written By
Posted
4712
April 18, 2010 06:01AM
Re: What returns from distance function?
4469
April 18, 2010 11:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.