def test_gmap_transformed(): dem = GeoTiff(get_demo_file('hef_srtm.tif')) dem.set_subset(margin=-100) dem = mercator_grid(center_ll=(10.76, 46.798444), extent=(10000, 7000)) i, j = dem.ij_coordinates g = GoogleVisibleMap(x=i, y=j, crs=dem, size_x=500, size_y=400) img = g.get_vardata() m = Map(dem, countries=False) with pytest.raises(ValueError): m.set_data(img) m.set_lonlat_contours(interval=0.025) m.set_shapefile(get_demo_file('Hintereisferner.shp'), linewidths=2, edgecolor='darkred') m.set_rgb(img, g.grid) fig, ax = plt.subplots(1, 1) m.visualize(ax=ax, addcbar=False) plt.tight_layout() return fig
def test_gmap_llconts(): # This was because some problems were left unnoticed by other tests g = GoogleCenterMap(center_ll=(11.38, 47.26), zoom=9) m = Map(g.grid) m.set_rgb(g.get_vardata()) m.set_lonlat_contours(interval=0.2) fig, ax = plt.subplots(1, 1) m.visualize(ax=ax, addcbar=False) plt.tight_layout() return fig
def test_gmap(): g = GoogleCenterMap(center_ll=(10.762660, 46.794221), zoom=13, size_x=640, size_y=640) m = Map(g.grid, countries=False, factor=1) m.set_lonlat_contours(interval=0.025) m.set_shapefile(get_demo_file('Hintereisferner.shp'), linewidths=2, edgecolor='darkred') m.set_rgb(g.get_vardata()) fig, ax = plt.subplots(1, 1) m.visualize(ax=ax, addcbar=False) plt.tight_layout() return fig