Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm looking for a way to take the overlap area of multiple polygons and work with that result as a single entity, ideally all in the API.

share|improve this question
add comment

4 Answers 4

There are no extensive Javascript computational geometry implementations: most geometry libraries rely on JTS or its C++ port GEOS, neither of which have yet been ported to native Javascript. Most people handle this by using a spatial database such as PostGIS to manipulate geometries server-side, and then pass back the results with GeoJSON or similar. OpenGeo has an example application which does unions of input geometries from a webmap that might be of help.

If you'd like to implement the algorithm yourself in Javascript, check this SO post which describes the general process, which involves finding and removing interior points from the joint geometries.

share|improve this answer
add comment

As far as I know, the Google Maps API doesnt do much geoprocessing, so you would have to code the union yourself or look into using a spatially enabled database to do the union. I have usually just been able to code any simple geoprocessing that I needed for a Google Maps web page, so I cant be more helpful than that. Its just a suggestion for the next place to look.

share|improve this answer
add comment

You could use JTS to do your geoprocessing and then use the GALGWT library to integrate with Google Maps with the added benefit its all Java code so you can use an ide like eclipse to help you avoid simple mistakes. Also as its Java it can be uploaded on AppEngine and deployed as an cloud application.

share|improve this answer
add comment

I know this might not be what your looking for, but in case someone else stumbles to this link and it helps them...

If you make use of the ESRI Google Extender API and you also happen to have ArcGIS Server, you can make use of the geometry service and geoprocessing services. Hopefully they will update this API soon, so that it can work alongside v10 which has an improved geometry service allowing you to do operations like unions.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.