Flo,

wow, way cool, upside down world!

re: contributing to the wiki - I would love help. I figured adding/refactoring 
this page would be the place to start:

http://trac.mapnik.org/wiki/Troubleshooting

I'm thinking this page because people need a place to land when data looks odd 
and there can be a number of reasons (though all tied up with proj4).

Ideally we'd also have a place for people to read about projections to know 
what to do from the start, but... who does that? ;) Though we do have: 
http://trac.mapnik.org/wiki/IntroductionToGIS

Ultimately I would like a write a python tool that parses your XML and 
identifies/makes recommendations. In this case this python tool could:

1) find all 'srs' values in the map xml and warn if any do not contain +over
2) calculate the full extent of all layers (using the robust 16 point 
transform) and then recommend using the cumulative value for the map 
maximum-extent
3) find any blank 'srs' parameters and inspect the data to auto-detect the best 
guess projection (using the ogr "osr" module)
4) lots more....

Dane

On May 25, 2011, at 4:57 PM, Flo Ledermann wrote:

> 
> 
> On 05/25/2011 03:16 PM, Dane Springmeyer wrote:
>> On May 25, 2011, at 3:00 AM, Flo Ledermann wrote:
> 
>>> I was experiencing some truncation of polygons towards the borders
>>> in non-rectangular projections (like for example Robinson 
>>> projection) in Mapnik 0.7.0
>> 
>> By this do you mean the seemingly straight lines along the dateline
>> on the right? I think reason that the left edge looks properly curved
>> is that the shapefile has a high density of vertexes on the left side
>> of the ocean polygons. The remaining edges (including the right side)
>> lack vertexes, so when reprojected they continue to look straight.
> 
> Excellent advice, that was indeed the case!
> 
>>> Much to my surprise *it got much worse* in the trunk version,
>>> truncating polygons heavily on both sides of the globe.
>> 
>> Yes, this is because the move to clipping by the map extent means
>> that you have one place (the map srs/bounds) to fix/handle out of
>> bounds issues,  but left unhandled very small bbox queries may be
>> sent to the layer datasources which leads to very reduced features. I
>> realize that you did not expect to have to "fix" them when upgrading
>> and that this regression may be annoying, but I feel like it is an
>> improvement both for reprojected and non-reprojected cases.
> 
> Absolutely, no problem with that. If there's any wiki page or else where
> I could contribute to documenting this, I'd be happy to write down what
> I learned.
> 
>> And there are three solutions to quickly fix:
>> 
>> 1) As you noticed you can set the map.maximum_extent. But this extent
>> must be in the bounds of the map srs. So, in your case you need to
>> do:
>> 
>> robinson_bounds = _get_projected_bounds(output_projection,
>> bounds=bounds) mmap.maximum_extent = robinson_bounds 
>> mmap.zoom_to_box(robinson_bounds)
> 
> OK, that worked great for me.
> 
>> 2) Still, there is an even easier solution (which I need to document
>> on the wiki better). It is that you can request that proj4 do sane
>> things when out of bounds coordinates are passed and properly wrap
>> them. Do do this add the:
>> 
>> +over
>> 
>> parameter to your proj4 string. This should fix things even without
>> the use of maximum_extent. 
> 
> OK, good to know, thanks for the hint.
> 
>> 3) The third option is to apply this patch:
>> http://trac.mapnik.org/ticket/751. But, I do not wish to use this, at
>> least for the mainline rendering in feature_style_processor.hpp,
>> because it can slow down multithreaded servers slightly. Can you tell
>> top performance is on my mind?
> 
> I came across this but I don't see the need for it right now - solution
> #1 worked great for me.
> 
>> So, I would recommend #2, and then the mapnik2 image should render
>> just like mapnik 0.7.x (but a bit faster if it were being rendered
>> under high load).
> 
> I'm going for the #1 option now, using the properly projected
> maximum_extent. Together with a refined polygon edge it works like a
> charm, thanks!
> 
> New image attached, using the cool new +axis=esu parameter of Proj.4
> trunk on the way to put the world upside down ;) !
> 
> Best,
> 
> Flo
> 
> <world_robinson_.png>

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to