Answer the question
In order to leave comments, you need to log in
Storing polygon data from maps in a database?
You need to draw arbitrary shapes on the map, and then save the data of this shape. For further viewing of figures.
So that's the best way to store data on the server in a database.
Currently using hibernate as orm and ms sql base.
Perhaps it’s worth raising a separate nosql solution for this in order to store all this data as it is - json.
Answer the question
In order to leave comments, you need to log in
There is a special format for this - geoJson.
I would store in it, especially since the
latest versions of MSSQL, MySQL, (Postgre for a long time) support the Json data type.
SQL Server has special geographic and geometric types ( msdn ), have you tried it? If these are really polygons, I see no reason to keep them "as is".
I would have 2 fields: the coordinates of the points and the shape of the figure (rect / poly), well, or depending on the json structure that is transmitted there.
And to store the entire json, received from the API from the outside, in the database, and then every time it is parsed for output, in my opinion, not ice.
Tomorrow the API will change, the field names will change, and then what? There will be problems with versioning.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question