a general question: how would you rather store polygons in a database ? the way, i store them is as couple of coordinates in a text field. reading them out by php and create a json or xml structure to visualize them in google maps. so i have one table, containing all polygons. but im also thinking of two other methods at the moment. - just store points with lat, lng fields and store the polygons as a list of vertices in another table, which are joined to the points- table. especially for adjacent polygons you haven't to save vertices twice, whichare used by 2 or more polygons. - store them as a geometry feature, so that simple gis operations (contains, overlapping a.s.o.) can be done with sql queries on database level, instead using php or javascript classes
there are some advantages/disadvantages for every solution, but it is worth to keep all methods in mind. On 28 Sep., 11:58, Ranglo <[EMAIL PROTECTED]> wrote: > The coordinates are stored in the mySQL database, and then I use PHP > scripts to pull this information from the database, and the points are > displayed as markers in the GMaps window. What i want to know is how > to take these points and draw them in a series to create a polygon > rather than individual markers? > > Points are stored based on their lat and lng values as a Float data > type (10,6) > > Thanks > > On Sep 28, 12:25 am, "warden [Andrew Leach - Maps API Guru]" > > <[EMAIL PROTECTED]> wrote: > > On Sep 27, 9:53 pm, Ranglo <[EMAIL PROTECTED]> wrote: > > > > Does anyone know (or can recommend a link) how to display a polygon > > > overlay based on a series of coordinates stored in an mySQL database? > > > I expect someone knows. > > > For example, I have a MySQL database which contains coordinates of > > polygons. Using PHP, I retrieve these, create encoded polygons and > > overlay them on a map. > > > Which bit of the process are you finding problematic? I'm prepared to > > help if I can, BUT I'm not going to write code for you; and there are > > reasons why I'm not going to reveal my own source code. But that > > doesn't mean that hints are not available. > > > NB: In your question, you haven't said very much. I assume since > > you're using MySQL that you're also using PHP, but you haven't said > > anything about how your coordinates are stored, for example. It would > > also help if you followed the posting guidelines and posted a link to > > your current web page. While server-side scripts are difficult to > > assist with [because by their nature only you have access to the > > source code] it's possible to glean an insight into what a script is > > doing by looking at the output. > > > Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
