Basemap - fillcontinents fills entire map region in some cases

I am creating projections centered around various locations:

m = Basemap(width=best_width, height=best_height, lon_0=centerLon
lat_0=centerLat, resolution='c',area_thresh=10000.,projection='laea')

For every location, i have the same code to fill the regions:

m.fillcontinents(color='#997766',lake_color='#99ffff',zorder=1)

m.drawcoastlines(color='#000000', zorder=3)
m.drawcountries(color="0.75", zorder=2)
m.drawmapboundary(fill_color='#99ffff', zorder=0)

For most regions, this results in the expected plot (
http://www.nabble.com/file/p23451317/good.png good.png )
However, whenever the region includes South America/Antarctica,
fillcontinents will color the entire map (
http://www.nabble.com/file/p23451317/bad.png bad.png )

Is this a known issue, and is there a way to circumvent it?

Thanks,
Jon

···

--
View this message in context: http://www.nabble.com/Basemap---fillcontinents-fills-entire-map-region-in-some-cases-tp23451317p23451317.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

jtamir wrote:

I am creating projections centered around various locations:

m = Basemap(width=best_width, height=best_height, lon_0=centerLon
lat_0=centerLat, resolution='c',area_thresh=10000.,projection='laea')

For every location, i have the same code to fill the regions:
m.fillcontinents(color='#997766',lake_color='#99ffff',zorder=1)
  

m.drawcoastlines(color='#000000', zorder=3)
m.drawcountries(color="0.75", zorder=2)
m.drawmapboundary(fill_color='#99ffff', zorder=0)

For most regions, this results in the expected plot (
http://www.nabble.com/file/p23451317/good.png good.png )
However, whenever the region includes South America/Antarctica,
fillcontinents will color the entire map (
http://www.nabble.com/file/p23451317/bad.png bad.png )

Is this a known issue, and is there a way to circumvent it?

Thanks,
Jon

Jon: It's a know issue. From the KNOWN_BUGS file:

* The fillcontinents method doesn't always do the right thing. Matplotlib
always tries to fill the inside of a polygon. Under certain situations,
what is the inside of a coastline polygon can be ambiguous, and the
outside may be filled instead of the inside. To trigger this,
run the garp.py example with lon=-71,lat=-33 (Santiago, Chile).
Workaround - mask the land areas with the drawlsmask method instead of
filling the coastline polygons.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

Thanks for the response. drawlsmask gets the job done.

Jon

···


View this message in context: http://www.nabble.com/Basemap---fillcontinents-fills-entire-map-region-in-some-cases-tp23451317p23454957.html
Sent from the matplotlib - users mailing list archive at Nabble.com.