0

I want to save some MapPolygons created by an user.. and another variables with some information of each one of this polygons, and to do that i think to use and sql database, but when i try to explorate mysql, i've found a problem, the variables are easy to store... but the MapPath not, because they are a group of basic geolocations (latitude,longitude e altitude) and i don't know how to store it ... its not so simple because the number of sides and coordinates of these polygons, are variable. The user choice how many sides it will have.

So, somebody has an ideia, how i can save these coordinates?

  • Besides the polygon serialization, the classical solution is to create a Coordinates table with the following Fields : PolygonId (foreign key refering to polygon), SequenceNumber (indicating the point index), Latitude, Longitude and Altitude. – Graffito Jul 28 '15 at 20:17

2 Answers2

1

Since MySQL 5.0, you can use Spatial Data types and it will have better performances than XML serialization and will offer you plenty of usefull spatial features, see here for reference: https://dev.mysql.com/doc/refman/5.0/en/spatial-datatypes.html

Also this question was asked on GIS Exchange: https://gis.stackexchange.com/questions/10401/data-types-for-storing-lng-lat-in-mysql

And on StackOverflow: What is the ideal data type to use when storing latitude / longitudes in a MySQL database?

Community
  • 1
  • 1
Nicolas Boonaert
  • 2,954
  • 1
  • 20
  • 28
0

You can serialize your C# object to XML and save as text. Or you can serialize your C# objects to binary and save as BLOB.

Anton
  • 9,682
  • 11
  • 38
  • 68