On 9/15/12 8:05 AM, Joachim Saul wrote:
> Hi there,
>
> in basemap coastlines are apparently (always?) drawn as closed polygons not 
> exceeding the map boundary, i.e. when the coastline intersects with the map 
> boundary the polygon is continued along the map boundary until the next 
> intersection point. The somewhat annoying side effect of this is a map 
> boundary that appears thicker where it crosses landmasses. See for instance 
> on http://matplotlib.org/basemap/users/examples the example "Plot hurricane 
> tracks from a shapefile" where clearly the upper and left map boundaries are 
> thicker where they cross the western U.S. or northern Canada. Another example 
> where this effect is particularly pronounced is the example "Draw great 
> circle between NY and London" on the same page. The effect gets worse if 
> running these examples without antialiasing. Apparently only the upper and 
> left boundaries are affected, whereas the lower and right boundaries are 
> plotted properly.
>
> It looks to me as if this might simply be a bug due to the coastline not 
> aligning perfectly with the map boundary, perhaps because of some roundoff 
> error. Is there a way to avoid this? Wouldn't it be better to draw the 
> coastlines not as closed polygons but as collections of line segments?
>
> Cheers,
> Joachim
>

Joachim: I've noticed this myself, but have not found any solution. I 
suppose I could add an option to treat coastlines as line segments, but 
then you would not be able to use the fillcontinents method.  Here's 
what happens now when a Basemap instance is created:

1) the intersection between the coastline polygons and the map boundary 
is computed using the geos C library.
2) the coastline polygons are clipped at the map boundary
3) the coordinates of the coastline polygons are transformed to map 
projection coordinates

Then, when the drawcoastlines or fillcontinents methods are called only 
the polygons inside the map projection region are drawn.  This saves  *a 
lot* of time when you're using high-resolution coastlines in a small map 
region.  There is a similar process for political boundaries, but since 
they are line segments you don't see the "thickening" around the map edges.

Maybe one solution would be to clip the polygons to a region slightly 
larger than the actual map projection region.

-Jeff


------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to