Hm, no responses. Perhaps I need an easier question? :)

How about a simpler case -- how can I render a simple latlon projection
centered around an arbitrary dateline?

Using the world borders shapefile, I tried the following projection on the
mapnik Map object:

+proj=latlon +datum=WGS84 +pm=180
[full code: http://pastebin.com/f4e2b8fa1 ]

This draws the eastern hemisphere on the left side of the image, with the
right side blank. If I extend the bounds, I can see that the rest of the
world is just clipped off to the left hand side. No good.

So I used ogr2ogr to reproject the file to the new meridian:

ogr2ogr -t_srs '+proj=latlong +datum=WGS84 +pm=180' world_shift.shp
world.shp

And tried rendering again. However, this doesn't work either.

Any pointers? Am I missing something obvious here? How can I get the world
to wrap around a different meridian?

Thanks!



On Sun, Jan 11, 2009 at 10:14 PM, Filipe Fortes <[email protected]> wrote:

> I'm trying to use mapnik to render a Robinson projection centered in the
> pacific ocean (example [1]). However, I've run into some issues trying to
> get a correct rendering.
>
> I started off with the tm_world_borders shapefile [2], and re-projected it
> into the robinson projection with ogr2ogr:
>
> ogr2ogr -t_srs '+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84
> +datum=WGS84 +units=m +no_defs +over' robin_world_borders.shp
> tm_world_bounders.shp
>
> Using the following script: http://pastebin.com/f7f3b0784 -- I get a
> partially correct rendering [3], due to the known issue of antarctica
> (although I'm not sure why it doesn't work), so I removed antarctica using
> the following ogr2ogr command:
>
> ogr2ogr -sql "select * from robin_world_borders where Name <> 'Antarctica'"
> robin_sans_antarctica.shp robin_world_borders.shp
>
> Using this file, I can now get a correct rendering with a greenwich center
> (sans Antarctica, of course), however I cannot get a correct rendering
> centered on the dateline. I tried the following:
>
> 1. Specify lon_0=180 on the map's projection, as shown here:
> http://pastebin.com/fc2f26a5
>
> This only shows the eastern hemisphere: http://i42.tinypic.com/16h1e6h.png
> (shows western only if I use lon_0=-180)
>
> 2. Reproject the shapefile using ogr2ogr:
>
> ogr2ogr -t_srs '+proj=robin +lon_0=180 +x_0=0 +y_0=0 +ellps=WGS84
> +datum=WGS84 +units=m +no_defs +over' robin_sans_antarctica.shp
> robin_sans_antarctica_shifted.shp
>
> This produces a stranger result, where countries that span the prime
> meridian are all drawn incorrectly: http://i41.tinypic.com/12542o4.png
>
> (code used: http://pastebin.com/f59e42e0c )
>
>
> Any tips on where I've gone wrong here?
>
> Also, if anyone knows hows to render Antarctica in the Robinson projection
> that'd be great as well :)
>
> Thanks!
>
> filipe
>
>
> [1] http://commons.wikimedia.org/wiki/File:BlankMap-World-162E.svg
> [2] http://thematicmapping.org/downloads/world_borders.php
> [3] http://i40.tinypic.com/2e4m8f5.png
>
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to