[OSM-dev] mod_tile svn's project variables 1)hardcoded 2)in many files

Jonathan-David SCHRODER jonathan.schroder at gmail.com
Thu Jan 21 18:32:21 GMT 2010


Hello,
for our project (Geopard) which does indoor & outdoor mapping, we need zoom
levels up to 24 or so.
mod_tile's svn's render_config.h defines a constand #define MAX_ZOOM 18 (and
also MIN_ZOOM)
but this constant is used in only 2 or so files and the rest of max zoom
values are hardcoded (just grep for 18 in the svn and you will find them)...

so I changed the code a little so that all harcoded max_zoom values are
MAX_ZOOM instead...

the executables are such that the maxZoom variable can be reset to something
different than 18 (but that must be still lower than 18 (= harcoded
max_zoom))...

there's still minimum zoom values hardcoding (value is 0) in several
files...

I have no svn write access. Quite frankly, I know that I could look for all
hardcoded values that should refer to defines in render_config.h though..
that's not a sufficient step... it would nice to just edit renderd.conf or
override that with Apache mod_tile's mod_tile.conf options, instead of
having to recompile the full mod_tile directory.

I could implement code changes so that the executables effectively rely on
only .conf files max, min zoom (and maybe other) parameters, and have a
fallback .conf file for default values that can't be found and are removed
from render_config.h such as mod_tile.conf.defaults and
renderd.conf.defaults.... maybe there could be a compile option that enables
or disables use render_config.h's #define'd constants / use of .conf files
(with their .defaults counterpart when user forgets to provide vital
options).

I have to rush for now to provide a prototype, so will just the
render_config.h #define MAX_ZOOM <nb greater than 18> 's way to recompile
mod_tile for now.

Take care,

Jonathan

On Fri, Jan 15, 2010 at 4:11 PM, Jonathan-David SCHRODER <
jonathan.schroder at gmail.com> wrote:

> in renderd.conf we a same thing as in render_config.h ;
> ------------- renderd.conf------------
> [mapnik]
> plugins_dir=/usr/local/lib64/mapnik/input
> font_dir=/usr/local/lib64/mapnik/fonts
> font_dir_recurse=1
> ------------------------------------------------
>
> ------------------ render_config.h ----------
> // Mapnik input plugins (will need to adjust for 32 bit libs)
>
> #define MAPNIK_PLUGINS "/usr/local/lib64/mapnik/input"
>
> // Default directory to search for fonts. Recursion can be enabled if
> desired.
>
> #define FONT_DIR "/usr/local/lib64/mapnik/fonts"
> #define FONT_RECURSE 1
> ----------------------------------------------------------------
>
> I guess the .h file just helps putting default values in the mod_tile
> library/executable, overridden by what's in the .conf file...
> It would be nice to have a script generating this in both files or just in
> the .conf file (and make .conf validate for mod_tile to work).
>
>
> It would be nice to have a ./boostrap script that changes the lib64 in lib
> on 32 bit machines in the files ... and why not detects where mapnik's
> /input/ folder is...
>
> Jonathan
>
> On Fri, Jan 15, 2010 at 3:26 PM, Jonathan-David SCHRODER <
> jonathan.schroder at gmail.com> wrote:
>
>> Hello,
>> this relates to a feature request as to mod tile concerning path
>> variables.
>>
>> I stumbled upon this because I need to edit several files before starting
>> to compile.
>>
>> In mod_tiles from
>> http://svn.openstreetmap.org/applications/utils/mod_tile
>> many paths are hardcoded in separate files
>> it would be nice:
>> a) to have them written in a single file...
>> b) have them loaded at runtime by mod_tile so as to be able to change them
>> and restart mod_tile/apache to work on new paths (eg. just in the
>> mod_tile.conf or a mod_tile_more_config.conf file).
>>
>> Take care
>>
>> Jonathan
>>
>> root at domU-12-31-39-00-5D-87:~/mod_tile# grep "#define" * -R | grep "\"/"
>> daemon.c:#define PIDFILE "/var/run/renderd/renderd.pid"
>> mysql2file.c:#define WWW_ROOT "/var/www/html"
>> mysql2file.c:#define TILE_PATH "/osm_tiles2"
>> protocol.h:#define RENDER_SOCKET "/tmp/osm-renderd"
>> render_config.h:#define HASH_PATH "/var/lib/mod_tile"
>> render_config.h://#define TILE_PATH "/var/www/html/osm_tiles2"
>> render_config.h:#define RENDERD_CONFIG "/etc/renderd.conf"
>> render_config.h:#define MAPNIK_PLUGINS "/usr/local/lib64/mapnik/input"
>> render_config.h:#define FONT_DIR "/usr/local/lib64/mapnik/fonts"
>> render_config.h:#define PLANET_TIMESTAMP "/planet-import-complete"
>> render_config.h.mine:#define HASH_PATH "/var/lib/mod_tile"
>> render_config.h.mine://#define TILE_PATH "/var/www/html/osm_tiles2"
>> render_config.h.mine:#define RENDERD_CONFIG "/etc/renderd.conf"
>> render_config.h.mine:#define MAPNIK_PLUGINS "/usr/local/lib/mapnik/input"
>> render_config.h.mine:#define FONT_DIR "/usr/local/lib32/mapnik/fonts"
>> render_config.h.mine:#define PLANET_TIMESTAMP "/planet-import-complete"
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20100121/3ef2c2a5/attachment.html>


More information about the dev mailing list