Hi everybody, I have been developing a client side script that permits executing functions like union, difference or spatial buffers on polygons resp. polylines. The whole thing is far from ready, but as I do not see myself having the time to pick this little project up again in the near future, I thought I might aswell post the code here for the community, perhaps somebody can use this or even pick up where I left.
The code basically adds functions to GPolygons that require another GPolygon as parameter and returns a resulting GPolygon (or in some cases a complex Polygon that consists of two or more GPolygons). It also adds a function to GPolyline, that requires a buffer distance and an accuracy value and returns a GPolygon as a buffer around the line. There are still a couple of things I did not have the time to finish: - the function to handle polygons with holes as one or both of the operands is not yet ready, holes are neglected - I just noticed I lost the polygon buffer function in some other version or so; it is quite easy to derive it from the line buffer function though. - holes do not look nice, there could be something done with GPolygonFromEncoded - if you create buffers around buffers around buffers... you will have very many vertices; an accuracy threshold for the buffer calculation between two vertices should be implemented ... and probably many more, but it has been a while since last looked at the code, so I probably forgot many issues (The functions do all work in R2, by the way, so if you have large polygons or lines, you should convert your shapes to geodesic first.). You can download the js-file here: http://google-maps-api.googlegroups.com/web/gis_functions.js?gda=cE4q_UIAAACCkiYVD_m3RI51iLivEALZQuGxa0eNQlm4EI5iPGzyJ-ZWz--6pmz0su4OGtGcdCRV4u3aa4iAIyYQIqbG9naPgh6o8ccLBvP6Chud5KMzIQ, documentation is within the comments in the file. You can try out the polygon operations here: http://freytag.nl/luftbildserver/digitizer.php -- this will not be hosted forever, though. Have fun! Feedback would be very welcome. Cheers, Goetz -- 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.
