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 have 3000+ polygons which represent watersheds (18 main watersheds). At the first stage all the 18 watershed will show and their list will be placed in the left sidebar. If any user mouse over the map only popup will show the watershed name. If any user click on any major watershed on map it will open pop up window with detail. At a larger zoom, all watersheds will show.

I'm asking for your advice which open-source solution is the best for handling that large amount of polygons? I was thinking about Leaflet or OpenLayers but I don't know can they handle large amounts of polygons. Also, do you suggest do store them in mysql or? Thank you.

share|improve this question
3  
Can you rasterize these polygons? or perhaps use a feature server such a geoserver or featureserver? –  dassouki Aug 29 '12 at 16:33
add comment

4 Answers

up vote 13 down vote accepted

I would create a image service (raster layer) and serve it out with Web Map Service (WMS). This way you can use any API framework which you feel comfortable with as long as it supports WMS (OpenLayers does). You can use WMS to show a layer of all polygon features then use WMS's GetFeatureInfo onclick to pull up information on that polygon.

If for any reason you need the vector data on the map, you could create it dynamically onclick with the GetFeatureInfo response data.

share|improve this answer
    
I'll do that, thank you. –  againstflow Aug 30 '12 at 10:50
add comment

In addition to TileMill you could check out MangoMap, it's not open source but it is currently free and is capable of handling this type of data.

[Disclaimer: I work with MangoMap, but am answering because it's appropriate in this case]

share|improve this answer
add comment

See TileMill, which can rasterize UTFGrid interaction into an MBTiles file and host it on MapBox or an open-source MBTiles server implementation like TileStache.

Here's it with lots and lots of polygons. This approach requires you to rasterize - aka bake - tiles, but is essentially the only way to do what you want without having massive server resources, a custom app, or a very restricted set of browsers.

share|improve this answer
    
I like this example. Can you tell me how can I rasterize shapefiles? In TileMill? Thanks. –  againstflow Aug 29 '12 at 17:37
    
Yep, it's the most common way. Here's the documentation on adding tooltips that way. If you're super-allergic to GUI tools and a Python/Mapnik pro, there's also a cli route that avoids all of that but is a bit cryptic. –  tmcw Aug 29 '12 at 21:05
add comment

Scale dependency and a spatially indexed database will be key to this issue. You should be able to represent watersheds using at least two, possibly three or four, levels. For example, you could divide the data into Major (the 18), Minor (some combination of all mid-scale watersheds that all fall within the same Major), and Tertiary (the 3000 polygons). This would give you three different vector layers/services.

Use scale dependency to draw only the appropriate service depending on the user's zoom level.

Use a database with spatial indexing to ensure the services draw quickly, and draw only the portion that is needed to fill the current view window.

Alternatively, you might consider creating tiles of the watershed maps (again, created based on appropriate scales for each layer) and serve them that way.

Alot of questions already exist on this site that recommend appropriate open source solutions to employ these strategies.

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.