I need to store map bounds in a MySQL database. I’ve spent some time on the docs for geospacial extensions, but it’s difficult and in my case unnecessary to learn all related info (WKT, WKB etc.)
I just need a way to store a rectangle of coordinates and read it back later.
Of course I could also just write the raw coordinates to floats, but if it isn’t to complicated, I would prefer to have it in 1 column.
So, what’s the simplest possible SQL code for that requirement?
PS: I already use a POINT value in that table, so the extensions are installed and working.
You can store polygons in a geometry column within mysql. This will then let you perform some geometry function on them (if you need to – but doesn’t sound like you do)
http://dev.mysql.com/doc/refman/4.1/en/polygon-property-functions.html
Edit:
Try the above sql statements. I create a table with a geometry column, Add the polygon then select the data astext.