Spatial functions

2014-02-09 Thread Lay András
Hi! Can i use MySQL spatial functions directly, to compute distance between two GPS coordinate pairs in WGS84 format? Thank you! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-03 Thread dan
010 at 11:12 PM, dan wrote: >>>> >> >>> >>>> >> >>>> >>>> >> >>>> Can any one help me with understanding the mysql spatial >>>> >> >>>> functions? >>>> >>  I >>>

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread Rob Wultsch
>>> >> >>> On Sat, May 1, 2010 at 11:12 PM, dan wrote: >>> >> >>> >>> >> >>>> >>> >> >>>> Can any one help me with understanding the mysql spatial >>> >> >>>> func

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
t;> wrote: >> >> > Dan, >> >> > >> >> > I think you are trying to create a polygon based on the values in >> >> > other columns in the same row. I think these other columns are >> >> > named >> >>

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
on the values in >> >> > other columns in the same row. I think these other columns are >> >> > named >> >> > `n` and so on. >> >> > >> >> > Your mistake is that you are creating a text string, >> >> > &q

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
inside it. That won't work. Those column >> > names are just part of a string. They are not literal values that the >> > POLYGON() function can interpret. You will need to use CONCAT() or >> > similar to build a string that POLYGON() can interpret. >>

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
n` `w`, `n` `e`)'); >> >> but my poly column just reports back NULL. >> >> the n, e, s & w columns are decimal lat / long data. >> >> Dan >> >> On Sun, 2 May 2010 06:43:13 -0700, Ted Yu wrote: >>> I think you may have seen this

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread Baron Schwartz
/ long data. > > Dan > > On Sun, 2 May 2010 06:43:13 -0700, Ted Yu wrote: >> I think you may have seen this: >> http://dev.mysql.com/doc/refman/5.0/en/relations-on-geometry-mbr.html >> >> On Sat, May 1, 2010 at 11:12 PM, dan wrote: >> >>> >

Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-02 Thread dan
mal lat / long data. Dan On Sun, 2 May 2010 06:43:13 -0700, Ted Yu wrote: > I think you may have seen this: > http://dev.mysql.com/doc/refman/5.0/en/relations-on-geometry-mbr.html > > On Sat, May 1, 2010 at 11:12 PM, dan wrote: > >> >> Can any one hel

mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float)

2010-05-01 Thread dan
Can any one help me with understanding the mysql spatial functions? I can only seem to find bits and pieces of how-to's etc. I have an existing table of lat / long data representing unique boundaries i.e. rectangles and I want to search the table to find the rectangle that bou

Re: How to SELECT rows closest to lat/lng -- USING SPATIAL FUNCTIONS

2007-02-04 Thread M5
Thanks! That really seems to do the trick. Amazing. Now, for some stupid questions: The values 69.1 and 57.3... are you aware of some documentation or tutorial explaining these values and the math? I'd like to understand why it works. Also, I would like to figure out how to, if possible, speed th

Re: How to SELECT rows closest to lat/lng -- USING SPATIAL FUNCTIONS

2007-02-03 Thread Lars Schwarz
haven't followed the complete thread so i don't know what you're after, but maybe this helps? SELECT latitude, longitude, SQRT( POW( 69.1 * ( latitude - [startlat] ) , 2 ) + POW( 69.1 * ( [startlng] - longitude ) * COS( latitude / 57.3 ) , 2 ) ) AS distance FROM foobar ORDER BY distance ASC wher

Re: How to SELECT rows closest to lat/lng -- USING SPATIAL FUNCTIONS

2007-02-02 Thread M5
Thanks for the reply... It returns results, but not exactly what I am hoping for--basically, I get the nearest latitudes (but not near longitude), and nearest longitude (but not near latitudes). In other words, it doesn't return the closest lat/lng pair... Also, the query takes about 8 seco