Home | Trees | Index | Help |
|
---|
Package whois :: Module geomap |
|
whois Python module ------------------- Geographical localisation of countries thanks to a longitude and latitude database. Querying coordinates of a single country: >>> whois.geomap.getLongLat('SPAIN') (40.0, -4.0) Drawing the world map with circles at given countries: >>> from pylab import show >>> whois.geomap.world({'CANADA': 48, 'FRANCE': 4, 'INDIA': 570}) >>> show()
Function Summary | |
---|---|
Returns the country longitude and latitude, 'None' if country not found. | |
Loads the file of country longitudes and latitudes. | |
Loads the file of whois country to geos country translation. | |
Converts a string longitude or latitude to a float number. | |
Draws the world map with circles at country location. |
Variable Summary | |
---|---|
str |
__ModulePath__ = '/home/jm/dev/lib/whois'
|
Function Details |
---|
getLongLat(Country)Returns the country longitude and latitude, 'None' if country not found.
>>> Coords = getLongLat(Country)
Input:
|
loadCountryLocations()Loads the file of country longitudes and latitudes.
>>> loadCountryLocations()
|
loadCountryTranslation()Loads the file of whois country to geos country translation.
>>> loadCountryTranslation()
|
strCoord2Num(StrValue)Converts a string longitude or latitude to a float number.
>>> Coord = strCoord2Num(StrValue)
Input:
|
world(CountryStats, smin=200.0, coeff=1.0, func=None, noticks=True, c='b', marker='o', cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, faceted=True, **kwargs)Draws the world map with circles at country location. The circles surface is proportional to a function of input data for each country (see below).
>>> ScatterObj = world(CountryStats, smin=200.0, coeff=1.0, func=None, noticks=True, c='b', marker='o', cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, faceted=True, **kwargs)
Important note: saving a map as PNG significantly decreases circle surface. Input:
>>> whois.geomap.world({'CANADA': 50, 'FRANCE': 34, 'INDIA': 67})
The circle surface is computed this way: S = map(func, coeff * array(CountryStats.values()) + smin) |
Variable Details |
---|
__ModulePath__
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Mar 31 22:33:24 2007 | http://epydoc.sf.net |