Geographic Datasets (dataset)

dataset.geonames

class GeoName(geonameid, name, asciiname, alt_names, lat, lon, feature_class, feature_code, country_code, alt_country_code, admin1_code, admin2_code, admin3_code, admin4_code, population, elevation, dem, timezone, modification_date)
admin1_code

Alias for field number 10

admin2_code

Alias for field number 11

admin3_code

Alias for field number 12

admin4_code

Alias for field number 13

alt_country_code

Alias for field number 9

alt_names

Alias for field number 3

asciiname

Alias for field number 2

country_code

Alias for field number 8

dem

Alias for field number 16

elevation

Alias for field number 15

feature_class

Alias for field number 6

feature_code

Alias for field number 7

geonameid

Alias for field number 0

lat

Alias for field number 4

lon

Alias for field number 5

modification_date

Alias for field number 18

name

Alias for field number 1

population

Alias for field number 14

timezone

Alias for field number 17

class GeoName2(name, asciiname, lat, lon, population, feature_code)
asciiname

Alias for field number 1

feature_code

Alias for field number 5

lat

Alias for field number 2

lon

Alias for field number 3

name

Alias for field number 0

population

Alias for field number 4

download_file(fn, dirpath)[source]
positive_region(region)[source]
ascii_str(u)[source]
load(zfn, fn, minpop=1000000, region=None)[source]
load_all_keep(zfn, fn, minpop=1000000, region=None, exclude=())[source]
get_cities_region(region=None, minpop=0)[source]
get_cities_by_name(name)[source]
get_cities(lat, lon, radius, minpop=0)[source]

dataset.gshhg

class Polygon(gshhg_file, offset, *attr)[source]

Representation of a GSHHG polygon.

points

Points of the polygon as Nx2 as [:,[lat,lon]]

Return type:numpy.ndarray
is_land()[source]

Check if the polygon is land.

Return type:bool
is_lake()[source]

Check if the polygon is a lake.

Return type:bool
is_island_in_lake()[source]

Check if the polygon is an island in a lake.

Return type:bool
is_pond_in_island_in_lake()[source]

Check if the polygon is pond on an island in a lake.

Return type:bool
is_antarctic_icefront()[source]

Check if the polygon antarctic icefront.

Return type:bool
is_antarctic_grounding_line()[source]

Check if the polygon is antarctic grounding line. :rtype: bool

contains_point(point)[source]

Check if the polygon contains a single point

Parameters:point (tuple) – (lat, lon) of size 2
Return type:bool
contains_points(points)[source]

Check if the polygon contains a points

Parameters:points – Array of of size Nx2
Return type:bool
class GSHHG(gshhg_file)[source]
Holding the Global Self-consistent Hierarchical High-resolutions
Geography Database (GSHHG)

The class offers methods to select Polygon s and crop/validate single points and point-clouds.

get_polygons_at(lat, lon)[source]

Get all polygons that intersect with a point.

Parameters:
  • lat (float) – Latitude in [deg]
  • lat – Longitude in [deg]
Returns:

List of Polygon

Return type:

list

get_polygons_within(west, east, south, north)[source]

Get all polygons that intersect with a bounding box.

Parameters:
  • west (float) – Western boundary in decimal degree
  • east (float) – Eastern boundary in decimal degree
  • north (float) – Northern boundary in decimal degree
  • south (float) – Southern boundary in decimal degree
Returns:

List of Polygon

Return type:

list

is_point_on_land(lat, lon)[source]

Check whether a point is on land. Consquently lakes are excluded.

Parameters:
  • lat (float) – Latitude in [deg]
  • lon (float) – Latitude in [deg]
Return type:

bool

get_land_mask(points)[source]
Get a landmask respecting lakes, and ponds in island in lake
as water
Parameters:points (numpy.ndarray of shape Nx2) – List of lat, lon pairs
Returns:Boolean land mask
Return type:numpy.ndarray of shape N
classmethod full()[source]

Return the full-resolution GSHHG database

classmethod high()[source]

Return the high-resolution GSHHG database

classmethod intermediate()[source]

Return the intermediate-resolution GSHHG database

classmethod low()[source]

Return the low-resolution GSHHG database

classmethod crude()[source]

Return the crude-resolution GSHHG database