From: Baron Schwartz Date: May 2 2010 5:34pm Subject: Re: mysql spatial functions (Was: Best index for searching on lat / long data i.e. decimal vs. float) List-Archive: http://lists.mysql.com/mysql/221485 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 `n` and so on. Your mistake is that you are creating a text string, "POLYGON(......)" and embedding column names 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. On Sun, May 2, 2010 at 11:15 AM, dan wrote: > > I have seen that but I am stuck at just populating my POLYGON column > (poly). =A0I have tried this: > > UPDATE `grid` SET poly =3D PolygonFromText('POLYGON(`n` `e`, `s` `e`, `s` > `w`, `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: >> 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 help me with understanding the mysql spatial functions? =A0= 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 >>> bounds a specific point. >>> >>> Dan >>> >>> -- >>> MySQL General Mailing List >>> For list archives: http://lists.mysql.com/mysql >>> To unsubscribe: > http://lists.mysql.com/mysql?unsub=3Dyuzhihong@stripped >>> >>> > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Dbaron@stripped= om > > --=20 Baron Schwartz Percona Inc Consulting, Training, Support & Services for MySQL