Dear everyone,
Recently, I begin to learn to render street map using the data from http://www.openstreetmap.org/. I find that mapnik lib is really a useful and efficient tool to render maps. You are doing an excellent work.
But I come across a problem, I use metatile to improve my rendering performance. Like the following code:
//------------------------------------------Part of my code--------------------------------------------------------------------------------------------
image_32 buf(render_size_tx*TILE_WIDTH, render_size_ty*TILE_HEIGHT); //In general, render_size_tx = render_size_ty = 8
agg_renderer ren(metaMap,buf);
ren.apply();
unsigned int xx, yy;
for(xx = 0; xx < render_size_tx; xx++)
{
for(yy = 0; yy < render_size_ty; yy++)
{
image_view vw(xx*TILE_WIDTH, yy*TILE_HEIGHT, TILE_WIDTH, TILE_HEIGHT, buf.data());
meta.setTile(xx, yy, save_to_string(vw, "png256"));
}
}
//------------------------------------------Part of my code--------------------------------------------------------------------------------------------
Each tile in the metatile is stored in std::string format. But what I need is QImage in QT, so how can I construct QImage from the std::string data? Is it like this
"QImage img((uchar* )(const_cast(meta.getTile(xx, yy).c_str())), TILE_WIDTH, TILE_HEIGHT, QImage::Format_ARGB32);" ? But in practice, it is wrong.
Can you give me some correct examples?
Thank you for your kind consideration.
Sincerely,
Jian Zhu
--
You received this message because you are subscribed to the Google Groups "mapnik" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapnik+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.