Update: I did rewrite my PhP code to handle the unusual situations, it just took a little more expertise using nested while loops and arrays than I had this morning.
The only shortcut that I had to take that I didn't like was removing the islands - I couldn't find a good way to handle them, so I just removed them and all of my doughnut shaped polygons now appear as mere circles: which for my purposes should suffice just fine as these polygon types were a small minority. If anyone is interested in the PhP code that I used to format/reparse the MULTIPOLYGON((())) output from MySQL as stored by shp2mysql into a valid KML file, I'd be happy to share it - just email me directly. Dominic On Apr 17, 10:31 am, Dommer <[email protected]> wrote: > So I have a map I'm working to build: and to build it I've created a > mySQL database table from the shapes within a shape file. I'm taking > the multipolygon() values and recoding the coordinates as an array. > Everything seems great, except that some of the multipolygons really > are MULTI. The text of the PhP I'm working with is here: > > http://freeforthepicking.com/Query/changedpamela16.txt > > You can see the output of the above file by saving the following, and > giving it a KML extension: > > http://freeforthepicking.com/Query/changedpamela16.php > > Essentially my problem is that my PhP doesn't know how to properly > process the contents of a multipolygon with more than one polygon. > > What I need the PhP to do is assess and do something different each > time a multipolygon is encountered (MOST of the polygons in the > dataset are not multi, just single polygons even though they are > stored as multipolygon). Namely, instead of just taking the array of > coordinates and parsing it out - it needs to split it into two arrays, > each one under their own separate polygon tag in the KML. I am okay > with the manipulation of the string within the while loop: but what I > need to do is a conditional loop WITHIN the first while loop that > creates that second (or third) polygon. > > I'm learning, and I think pretty fast- but a tip from someone who > knows PhP better than I do would be really helpful. Just a basic > approach would be fine - no need to rewrite code for me I can struggle > through that on my own. > > I'm sure someone has dealt with this already in the past. > > Dom --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
