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