1

I have a web based image editor, In image editor, there is a feature to draw freely on image. User can draw anything he wants. I want to store the coordinates of the polygon drawn on an image into mysql db. For one image there will be thousands of such points, so storing them linearly is not a good solution. Should I use spatial data type? Suggestions are welcome.Thanks in advance.

Amir Saleem
  • 2,912
  • 3
  • 21
  • 35
  • So something like flowpaper, essentially? – Strawberry Nov 25 '17 at 10:01
  • Yes, kind of. But here the main concern is what data type to use to store x and y coordinates into mysql DB. – Amir Saleem Nov 26 '17 at 08:16
  • 1
    Well, I think it's unlike that you'd ever want to interrogate the geometry from within database, so, despite your concerns, I'd be tempted to store it as a string of points, just like they do over at flowpaper. Take a look at MySQL's geometry tools, eg. Linestring: https://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html – Strawberry Nov 26 '17 at 09:37

0 Answers0