Reid, I don't know if you are going to find exactly what you are looking for. I haven't done extensive work with labeling algorithms, but I've sketched some ideas on paper, and no one else was responding to your post. I thought I would take a stab at it.
This is what I would do if I needed to design a labeling algorithm. Start by placing the label in the location that makes the most sense for the "typical" geometry in you spatial layer. For example, on a linear geometry that represented a road you'll probably want the center point for the label to be in the mid point of the linear feature. You'll also want the label aligned along the linear geometry. Once you have the logic to compute the position of the "default" label placement for the layer, start to think about what conflicts might occur with the default placement and create rules to resolve the conflict. (For example, what do you do if the linear segment is shorter than the label at the specified text size? You could shrink the label, move the label and show a leader to the linear segment, or place some type of key or symbol on the linear segment and have a legend with the road name at another location on the map.) I encourage you to take a look at some of the product documentation for other labeling tools. See how they have designed their systems and then implement some of those same features with your own logic. I hope that will get you started. The Sunburned Surveyor -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Reid Priedhorsky Sent: Wednesday, December 27, 2006 11:18 AM To: [email protected] Subject: [Geowanking] Looking for a decent map labeling algorithm Dear geowankers, I am writing a Flash web mapping algorithm, and we need a map labeling algorithm. I was hoping that you folks might be able to point me in the right direction. Here are our top requirements: 1. Fast. 2. Easy to implement and understand. (I would like to minimize the amount of effort I spend learning about map labeling.) Other requirements: 1. Currently just needs to label the transportation network; later, point and area features too. 2. Decent results. (Good/great is not necessary - we can make it better later.) 3. Doesn't need to work at small scales, say less than 1:24k or so (we will punt to MapServer for rendering for scales below a certain threshold). 4. Must be able to expand the map without needing to relabel everything. (I.e., panning into a new area means just labeling the new stuff.) Does this make sense? I am a newbie in this area, so please feel free to ask follow-up questions. Any ideas about where I should look would be very welcome. Many thanks, Reid _______________________________________________ Geowanking mailing list [email protected] http://lists.burri.to/mailman/listinfo/geowanking Warning: Information provided via electronic media is not guaranteed against defects including translation and transmission errors. If the reader is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this information in error, please notify the sender immediately. _______________________________________________ Geowanking mailing list [email protected] http://lists.burri.to/mailman/listinfo/geowanking
