i already have the "Polygon" latitude and longitude coordinates but i need to to know how to make a database and save them in it so i can call this polygon again in the code from the already saved database.
Asked
Active
Viewed 556 times
1 Answers
0
language and application agnostic? it's just labeled polygon.
coordinates expressed as floats/doubles can go like that to the database.
or you can make a very very long string and store the coordinates like lat lon;lat lon;lat lon; (...) When retrieving the data you can do a string split by ';' to get pairs then split by ' ' to get the specific lat and lon.
The first works ok for few polygons/few vertexes, the second for lots of polygons with few/not too many vertexes (if there are too many vertexes they'll break the string maximum length).

gia
- 757
- 5
- 19
-
i am using javascript , php and the program is dreamweaver cc2014 – Remon Ramzy Mar 30 '15 at 02:14
-
Use the second method of storage then, will be much easier to send from php to js, you can split it in js before painting. – gia Mar 30 '15 at 02:17
-
sorry but i am kinda new into this , i need step by step how to store the lat and long of the polygon in database , and then what to write in the code to retrieve the polygon and make it appear from the database. – Remon Ramzy Mar 30 '15 at 02:19
-
sorry, google that, plenty of js+php+mysql tutorials, once you are done researching if you have a more specific question, ask again. – gia Mar 30 '15 at 02:22
-
i did create a table and it has 3 columns , id , lat , long , i need to know how to write in them ? just paste all the lat of the polygon in the lat column ? or what – Remon Ramzy Mar 30 '15 at 02:24
-
probably, but keep in mind my reply, its best to have a single string – gia Mar 30 '15 at 02:27