Skip to content

Commit

Permalink
Removed useless comments.
Browse files Browse the repository at this point in the history
Added documentation for output format.
  • Loading branch information
timautin committed Feb 15, 2021
1 parent 4ce7486 commit 2c98ff0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/config/renderd/renderd.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ XML=/var/www/example-map/mapnik.xml
;** config options used by mod_tile, but not renderd **
;MINZOOM=0
;MAXZOOM=18
;TYPE=png image/png
;TYPE=png image/png png256 ; Values are: <extension> <mime-type> <output-format> (for more information about output format see https://github.com/mapnik/mapnik/wiki/Image-IO)
;DESCRIPTION=This is a description of the tile layer used in the tile json request
;ATTRIBUTION=&copy;<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> and <a href=\"http://wiki.openstreetmap.org/wiki/Contributors\">contributors</a>, <a href=\"http://opendatacommons.org/licenses/odbl/\">ODbL</a>
;SERVER_ALIAS=http://localhost/
Expand All @@ -62,7 +62,7 @@ XML=/var/www/example-map/mapnik.xml
;** config options used by mod_tile, but not renderd **
;MINZOOM=0
;MAXZOOM=22
;TYPE=png image/png
;TYPE=png image/png png256 ; Values are: <extension> <mime-type> <output-format> (for more information about output format see https://github.com/mapnik/mapnik/wiki/Image-IO)
;DESCRIPTION=This is a description of the tile layer used in the tile json request
;ATTRIBUTION=&copy;<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> and <a href=\"http://wiki.openstreetmap.org/wiki/Contributors\">contributors</a>, <a href=\"http://opendatacommons.org/licenses/odbl/\">ODbL</a>
;SERVER_ALIAS=http://localhost/
Expand Down
17 changes: 7 additions & 10 deletions src/gen_tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; If not, see http://www.gnu.org/licenses/.
*/
Expand Down Expand Up @@ -111,7 +111,7 @@ struct xmlmapconfig {
int minzoom;
int maxzoom;
int ok;
parameterize_function_ptr parameterize_function;
parameterize_function_ptr parameterize_function;
xmlmapconfig() :
map(256,256) {}
};
Expand Down Expand Up @@ -271,9 +271,9 @@ static enum protoCmd render(struct xmlmapconfig * map, int x, int y, int z, char

mapnik::image_32 buf(render_size_tx*map->tilesize, render_size_ty*map->tilesize);
try {
Map map_parameterized = map->map;
if (map->parameterize_function)
map->parameterize_function(map_parameterized, options);
Map map_parameterized = map->map;
if (map->parameterize_function)
map->parameterize_function(map_parameterized, options);
mapnik::agg_renderer<mapnik::image_32> ren(map_parameterized,buf,map->scale);
ren.apply();
} catch (std::exception const& ex) {
Expand All @@ -292,7 +292,6 @@ static enum protoCmd render(struct xmlmapconfig * map, int x, int y, int z, char
#else
mapnik::image_view<mapnik::image_data_32> vw(xx * map->tilesize, yy * map->tilesize, map->tilesize, map->tilesize, buf.data());
#endif
//tiles.set(xx, yy, save_to_string(vw, "png256"));
tiles.set(xx, yy, save_to_string(vw, map->output_format));
}
}
Expand Down Expand Up @@ -330,10 +329,9 @@ static enum protoCmd render(Map &m, const char *tile_dir, char *xmlname, project

mapnik::image_view<mapnik::image_data_32> vw(128, 128, 256, 256, buf.data());
//std::cout << "Render " << z << " " << x << " " << y << " " << filename << "\n";

//mapnik::save_to_file(vw, tmp, "png256");

mapnik::save_to_file(vw, tmp, outputFormat);

if (rename(tmp, filename)) {
perror(tmp);
return cmdNotDone;
Expand Down Expand Up @@ -505,4 +503,3 @@ void *render_thread(void * arg)
}
return NULL;
}

0 comments on commit 2c98ff0

Please sign in to comment.