@@ -72,11 +72,7 @@ using namespace mapnik;
7272#define RAD_TO_DEG (180 /M_PI)
7373#endif
7474
75- #ifdef METATILE
7675#define RENDER_SIZE (256 * (METATILE + 1 ))
77- #else
78- #define RENDER_SIZE (512 )
79- #endif
8076
8177extern int foreground;
8278
@@ -245,7 +241,6 @@ static int check_xyz(int x, int y, int z, struct xmlmapconfig * map)
245241 return !oob;
246242}
247243
248- #ifdef METATILE
249244mapnik::box2d<double > tile2prjbounds (struct projectionconfig * prj, int x, int y, int z)
250245{
251246
@@ -312,52 +307,6 @@ static enum protoCmd render(struct xmlmapconfig * map, int x, int y, int z, char
312307
313308 return cmdDone; // OK
314309}
315- #else // METATILE
316- static enum protoCmd render (Map &m, const char *tile_dir, char *xmlname, projection &prj, int x, int y, int z, char * outputFormat)
317- {
318- char filename[PATH_MAX];
319- char tmp[PATH_MAX];
320- double p0x = x * 256.0 ;
321- double p0y = (y + 1 ) * 256.0 ;
322- double p1x = (x + 1 ) * 256.0 ;
323- double p1y = y * 256.0 ;
324-
325- tiling.fromPixelToLL (p0x, p0y, z);
326- tiling.fromPixelToLL (p1x, p1y, z);
327-
328- prj.forward (p0x, p0y);
329- prj.forward (p1x, p1y);
330-
331- mapnik::box2d<double > bbox (p0x, p0y, p1x, p1y);
332- bbox.width (bbox.width () * 2 );
333- bbox.height (bbox.height () * 2 );
334- m.zoomToBox (bbox);
335-
336- mapnik::image_32 buf (RENDER_SIZE, RENDER_SIZE);
337- mapnik::agg_renderer<mapnik::image_32> ren (m, buf);
338- ren.apply ();
339-
340- xyz_to_path (filename, sizeof (filename), tile_dir, xmlname, x, y, z);
341-
342- if (mkdirp (filename)) {
343- return cmdNotDone;
344- }
345-
346- snprintf (tmp, sizeof (tmp), " %s.tmp" , filename);
347-
348- mapnik::image_view<mapnik::image_data_32> vw (128 , 128 , 256 , 256 , buf.data ());
349- g_logger (G_LOG_LEVEL_DEBUG, " Render %i %i %i %s" , z, x, y, filename)
350- mapnik::save_to_file (vw, tmp, outputFormat);
351-
352- if (rename (tmp, filename)) {
353- perror (tmp);
354- return cmdNotDone;
355- }
356-
357- return cmdDone; // OK
358- }
359- #endif // METATILE
360-
361310
362311void render_init (const char *plugins_dir, const char * font_dir, int font_dir_recurse)
363312{
@@ -449,7 +398,6 @@ void *render_thread(void * arg)
449398
450399 if (item) {
451400 struct protocol *req = &item->req ;
452- #ifdef METATILE
453401 // At very low zoom the whole world may be smaller than METATILE
454402 unsigned int size = MIN (METATILE, 1 << req->z );
455403
@@ -501,13 +449,6 @@ void *render_thread(void * arg)
501449 request_exit ();
502450 }
503451 }
504-
505- #else // METATILE
506- ret = render (maps[i].map , maps[i].tile_dir , req->xmlname , maps[i].prj , req->x , req->y , req->z , maps[i].output_format );
507- #ifdef HTCP_EXPIRE_CACHE
508- cache_expire (maps[i].htcpsock , maps[i].host , maps[i].xmluri , req->x , req->y , req->z );
509- #endif
510- #endif // METATILE
511452 } else {
512453 g_logger (G_LOG_LEVEL_WARNING, " Received request for map layer %s is outside of acceptable bounds z(%i), x(%i), y(%i)" ,
513454 req->xmlname , req->z , req->x , req->y );
0 commit comments