'PGA (g), 10% probability of exceedance in 50 yr', format='%.2f', spacing='uniform', ticks=contour_levels, tick_labels=tick_labels) grd_style = lbm.GridStyle(color_map_theme, contour_levels=contour_levels, contour_labels=contour_labels, line_style=line_style, colorbar_style=colorbar_style) layer = lbm.MapLayer(grd_data, grd_style) layers.append(layer) ## Coastlines coastline_style = lbm.LineStyle(line_color="k", line_width=1) data = lbm.BuiltinData("coastlines") layer = lbm.MapLayer(data, coastline_style) layers.append(layer) ## Provinces gis_file = r"D:\seismo-gis\collections\Bel_administrative_ROB\TAB\Bel_provinces.TAB" data = lbm.GisData(gis_file) style = lbm.PolygonStyle(line_color="k", line_width=0.5, fill_color=None) layer = lbm.MapLayer(data, style) layers.append(layer) ## Regions gis_file = r"D:\seismo-gis\collections\Bel_administrative_ROB\TAB\Bel_regions.TAB" data = lbm.GisData(gis_file) style = lbm.LineStyle(line_color="k", line_width=0.75) layer = lbm.MapLayer(data, style)
#colorbar_style = None #hillshade_style = lbm.HillshadeStyle(azimuth=45,elevation_angle=30, scale=0.1, color_map="copper") hillshade_style = None cmap, norm = lbm.cm.from_cpt_city(r"td/DEM_poster") #cmap = "gist_earth" tsc = lbm.ThematicStyleColormap(color_map=cmap, vmin=0, vmax=700) #tsc.color_map = None style = lbm.GridStyle(color_map_theme=tsc, colorbar_style=colorbar_style, line_style=None, pixelated=True, hillshade_style=hillshade_style) #layer = lbm.MapLayer(wcs_data, style) layer = lbm.MapLayer(gdal_data, style) layers.append(layer) ## Country borders data = lbm.BuiltinData("countries") country_style = lbm.LineStyle(line_color="r", line_width=2, line_pattern='--') layer = lbm.MapLayer(data, country_style) layers.append(layer) ## Coastlines coastline_style = lbm.LineStyle(line_color="r", line_width=2) data = lbm.BuiltinData("coastlines") layer = lbm.MapLayer(data, coastline_style) layers.append(layer) map = lbm.LayeredBasemap(layers, title, projection, region=region) map.plot()
import datetime import mapping.layeredbasemap as lbm region = (-180, 180, -90, 90) origin = (0, 0) projection = "moll" title = "Hello World from LayeredBasemap" resolution = "c" graticule_interval = (60, 30) layers = [] ## BlueMarble image bm_style = None data = lbm.BuiltinData("bluemarble") layer = lbm.MapLayer(data, bm_style) #layers.append(layer) ## Continents continent_style = lbm.PolygonStyle(fill_color="cornsilk", line_pattern=None, line_width=0) continent_style.bg_color = "powderblue" data = lbm.BuiltinData("continents") layer = lbm.MapLayer(data, continent_style) layers.append(layer) ## Coastlines coastline_style = lbm.LineStyle(line_color="burlywood", line_width=2) data = lbm.BuiltinData("coastlines") layer = lbm.MapLayer(data, coastline_style) layers.append(layer)