Malaren lake by Matplotlib Basemap

kkondo wrote:

Dear Jeff

Thank you for your reply.

I have found that the "resolution='f'" in basemap crashes when drawing
the Japanese Isles. Is it another flaw in GSHHS?

Kentaro: I cannot reproduce this crash. What version of the GEOS library
do you have? I am using 3.1.1.

-Jeff

P.S. cc'ing the matplotlib mailing list.

···

% python japanese_isles.py
GEOS_ERROR: TopologyException: side location conflict
(130.468,32.5594,32.5594)
Bus error
% cat japanese_isles.py
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
m = Basemap(llcrnrlon=121.,llcrnrlat=23.,urcrnrlon=152.,urcrnrlat=48.,
resolution='f',projection='tmerc',lon_0=135.,lat_0=35.)
m.drawcoastlines()
plt.show()
$ python
Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.3.0'
>>> import mpl_toolkits.basemap
>>> mpl_toolkits.basemap.__version__
'0.99.4'

P.S. "resolution='f'" works fine for the British Isles:
m = Basemap(llcrnrlon=-10.5,llcrnrlat=49.5,urcrnrlon=3.5,urcrnrlat=59.5,
resolution='f',projection='tmerc',lon_0=-4.36,lat_0=54.7)

Sincerely,
Kentaro Kondo

On 2009/10/25, at 22:40, Jeff Whitaker wrote:

kkondo wrote:

Hello

I want to get the shoreline of Malaren lake as
http://en.wikipedia.org/wiki/File:La3-demis-malaren.png. But I find
that the following Matplotlib-Basemap program does not draw its
shoreline but its islands. Is it the flaw of GSHHS?

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
m = Basemap(width=180000,height=90000,
resolution='f',projection='tmerc',lon_0=17.5,lat_0=59.5)
plt.clf()
m.drawcoastlines()
m.fillcontinents(color='coral',lake_color='aqua')
m.drawmapboundary(fill_color='aqua')
m.drawrivers(color='b')
plt.show()

Sincerely,
Kentaro Kondo

Kentaro: Apparently it's a flaw in GSHHS. I tried the online line map
creator at http://www.aquarius.geomar.de/cgi-bin/map-cgi.pl (which
uses GMT, which is the source of GSSHS) and got the same thing. It's
possible that it's fixed in the latest version of GSHHS (1.10) - I'll
take a look and let you know.

-Jeff

---------------------------------------------------------------
富士通(株)
次世代IT・ITSプロジェクト室
インフラ協調プロジェクト
近藤 kkondo@...2839...
(044)754-8513 fax (044)754-3292
〒211-8588 神奈川県川崎市中原区上小田中4-1-1