[mapguide-trac] #792: Excessive labeling with tiled maps

MapGuide Open Source trac_mapguide at osgeo.org
Thu Feb 19 15:04:17 EST 2009


#792: Excessive labeling with tiled maps
-------------------------------+--------------------------------------------
 Reporter:  zspitzer           |         Owner:       
     Type:  defect             |        Status:  new  
 Priority:  medium             |     Milestone:       
Component:  Rendering Service  |       Version:  2.0.2
 Severity:  critical           |    Resolution:       
 Keywords:                     |   External_id:       
-------------------------------+--------------------------------------------
Comment (by waltweltonlair):

 With GETMAPIMAGE we can stitch together features across the entire image
 that are connected end-to-end and want the same label, and generate a
 single label for the resulting stitched feature - Moray Street in your
 attached images is a good example.  I can see from the stylization that
 each block of Moray Street is actually a separate feature.  The stitching
 code merges the geometry for all the features and uses the merged geometry
 when computing the label.  That results in the single label you see.

 With GETTILEIMAGE, we can only consider features that intersect the tile.
 This is a requirement of the local labeling algorithm used to generate
 labels for tiles: since each tile is rendered independently it can only
 depend on data local to that tile (this is necessary to avoid the problem
 where you have discontinuous labels across tile boundaries).  Therefore
 features that don't interest a tile are not accounted for when generating
 the labels.  Stitching is still done for features local to that tile (and
 in fact it's done only on features fully contained within that tile), but
 it will not occur across tiles.  The result is what you're seeing in your
 tiled image: a candidate label is generated for every block of Moray
 Street - no stitching of the road is occuring.

 Changing the tile labeling algorithm to be non-local would allow stitching
 to occur the same as in GETMAPIMAGE.  However, if we allow labels in tiles
 to depend on data outside their extent then the only way to guarantee no
 discontinous labels across tile boundaries is to ensure that every tile
 works with the same data set - it would have to be the entire data set for
 the map.  Obviously that's going to kill performance.

 A compromise is to use a much larger size when generating tiles - on the
 order of the screen size - and then cut up this large tile into the normal
 300x300 size we use in the viewer.  Because each generated tile is large
 the stitching can be more effective.  There have been some past
 discussions around this on the newsgroups.

 Another possibility is to precompute the labels once for the entire map:
 load in the entire data set for the map, generate all labels, and store
 this information somewhere.  Then when we generate tiles we just look up
 the labels.  The initial label generation will be time-consuming, however.
 There's also the problem of how and where to store the information.  If
 you have multiple servers in your MapGuide site then each one needs access
 to the generated labels.

 A final option is for you to clean up your data.  For example with Moray
 street, if you combine all the individual features into one then you will
 get a single label in your tiled map.

-- 
Ticket URL: <https://trac.osgeo.org/mapguide/ticket/792#comment:2>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list