Our web mapping requirements are fairly standard - some basic querying and the ability to print out the resulting map (or save the image). Typically we've used ESRI products in the past (right now we're using GeoCortex) but we still haven't been able to solve the problem of how to parse the legend information to match what is actually being shown on the map. For example, if there are four polygons showing up on the map, there should only be four legend items for the polygons. Is there an open source solution for this problem?
EDIT: Let's see if I can clarify this more. Currently, we have a geology layer with 33,000+ polygons. The legend for this layer is a single image and contains several hundred legend items (ie. it's the legend for the entire geology layer, stored in a JPEG/PNG).
Typically, a user will zoom in on an area (such as a single NTS map sheet, or even smaller) and so a subset of geology polygons will be shown on screen. They will then save the map as a print document (PDF or image), which is generated by GeoCortex/ArcGIS Server. The print document will contain a header, an image of the map and a legend. However, the legend for the geology layer will be the legend for the entire geology layer, not what is actually shown on the map (ie. a much smaller subset).
So, I'm looking to see if there is a FOSS solution to enable me to clip out or generate on the fly an subset of the geology legend which reflects the actual items on-screen/on the map, to go with the print document. I hope that clarifies things; I apologize if it doesn't!
Answer
It is definitely possible to do what you want, depending on certain conditions. Take a look at this Flex App I had developed a couple of years back: http://india-wris.nrsc.gov.in/LULCApp.html.
The Legend and the Stats, change depending on the data visible in the current extent. The Algorithm requires that each of the class have a distinct color. The Flex Application knows the class, and its colour. At every extent change, it converts the current map extent to a bitmap, and then finds out the colours in it. Using this, you can find out which colours or classes are currently visible. Based on this information, the legend is dynamically created.
I had used Flex at that time, but this is also possible using the Canvas in HTML5. Or you can use any Server side code to do the same thing to your map image to get your dynamically created legend.
No comments:
Post a Comment