4d4e9f5d91
to be rendered. This allows for a large extent (larger than can be rendered into a single image in memory) to be rendered out as tiles. Since the full extent is used for the placement calculations text crossing tile boundaries will be consistent. This method is a little inefficient when a large number of labels need placed, an improved method would be to cache these placements between tiles, but the attached is a start. c++ users should simple call the render method with a start X and Y coordinate specified, for (int TileX = 0;TileX < 5;++TileX) { for(int TileY = 0;TileY < 5; ++TileY) { int TileSize=250; int StartX = TileX*TileSize; int StartY = TileY*TileSize; Image32 buf(TileSize,TileSize); agg_renderer<Image32> ren(m,buf,StartX,StartY); ren.apply(); char name[324]; sprintf(name,"tile_%d_%d.png",TileX,TileY); ImageUtils::save_to_file(name,"png",buf); } } python users should call render_tile_to_file for y in range(tile_count_y): for x in range(tile_count_x): if not os.path.exists("tiles/%d/%d/" % (map_scale, y)): os.makedirs("tiles/%d/%d/" % (map_scale, y)) render_tile_to_file(m, x*tile_size, y*tile_size, tile_size, tile_size, 'tiles/%d/%d/%d.png' % (map_scale,y,x), 'png') |
||
---|---|---|
.. | ||
mapnik | ||
mapnik_color.cpp | ||
mapnik_coord.cpp | ||
mapnik_datasource.cpp | ||
mapnik_datasource_cache.cpp | ||
mapnik_envelope.cpp | ||
mapnik_filter.cpp | ||
mapnik_font_engine.cpp | ||
mapnik_image.cpp | ||
mapnik_image_view.cpp | ||
mapnik_layer.cpp | ||
mapnik_line_pattern_symbolizer.cpp | ||
mapnik_line_symbolizer.cpp | ||
mapnik_map.cpp | ||
mapnik_parameters.cpp | ||
mapnik_point_symbolizer.cpp | ||
mapnik_polygon_pattern_symbolizer.cpp | ||
mapnik_polygon_symbolizer.cpp | ||
mapnik_projection.cpp | ||
mapnik_python.cpp | ||
mapnik_query.cpp | ||
mapnik_raster_symbolizer.cpp | ||
mapnik_rule.cpp | ||
mapnik_shield_symbolizer.cpp | ||
mapnik_stroke.cpp | ||
mapnik_style.cpp | ||
mapnik_text_symbolizer.cpp | ||
SConscript |