[OSM-dev] mod_tile in other projections?

Jason Lee jaslee.st at gmail.com
Thu Aug 15 11:23:47 UTC 2013


Hi,
I downloaded the latest mod_tile source code with the projections support
and manually added a BNG projection config in "gen_tile.cpp" as follows:-

======================
    else if (strcmp(srs, "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717
+x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs") ==
0) {
        syslog(LOG_DEBUG, "Using bng projection settings");
        prj = (struct projectionconfig *)malloc(sizeof(struct
projectionconfig));
        prj->bound_x0 = 0.0;
        prj->bound_y0 = 0.0;
        prj->bound_x1 = 700000.0;
        prj->bound_y1 = 1300000.0;
        prj->aspect_x = 1;
        prj->aspect_y = 2;
  }
======================

This doesn't give me the expected map when I view the top tile 0/0/0.png it
just shows the bottom southwest tip of GB.

I am trying to replicate the same top map tiles as OSM-GB project's given
here:-
http://lgosmgb2.nottingham.ac.uk:8080/geoserver/gwc/service/tms/1.0.0/OSM-GB:__all__@EPSG:27700@png/0/0/0.png
http://lgosmgb2.nottingham.ac.uk:8080/geoserver/gwc/service/tms/1.0.0/OSM-GB:__all__@EPSG:27700@png/0/0/1.png

..but my mod_tile returns a 404 for tile 0/0/1.png - is it because it
always expects 1 top tile at zoom 0?


On 2 April 2013 12:36, Jason Lee <jaslee.st at gmail.com> wrote:

> Kai and all other respondents,
> This is great response to my query and I will definitely continue to look
> into using the latest mod_tile/renderd code to work - in my specific case -
> with British National Grid projection, 27700.
>
> Jason
>
>
> On 26 March 2013 04:44, Kai Krueger <kakrueger at gmail.com> wrote:
>
>> On 03/07/2013 08:36 AM, Jason Lee wrote:
>>
>>> Hi all,
>>> It might seem an odd question but I'll give it a shot - would
>>> mod_tile/renderd support the dynamic generation of map tiles in a map
>>> projection other than web mercator? If not, then would it be possible/how
>>> difficult would it be to modify the code to support it?
>>>
>> In case you are still interested, I have now refactored the code a bit to
>> make it easier to support different projections. Supporting new projections
>> now should be as simple as adding 6 numbers, (the boundaries in projected
>> coordinates and the map aspect ratio). For the moment you still need to
>> recompile renderd after changing / adding those numbers, but in the future
>> that might change.
>>
>> At the moment it supports spherical mercator and plate carree out of the
>> box and they can be mixed in the same rendering server. You configure those
>> by changing the srs of the mapnik style sheet to the appropriate values.
>>
>> Also it is now possible to configure the size of the tiles in
>> renderd.conf and it is no longer hard coded to be 256 px. (You still need
>> to change the mapnik stylesheet for the appropriate PPI though).
>>
>> Kai
>>
>>
>>> The only other thing I can think of is using MapProxy with Mapnik
>>> backend but I'm not sure the scalabilty/performance compared to mod_tile.
>>>
>>> Thanks and regards,
>>> Jason
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20130815/a460066e/attachment.html>


More information about the dev mailing list