Skip to content

Commit

Permalink
mini tweaks to the doc (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Nov 4, 2016
1 parent 8b20ed0 commit cf07635
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/examples/plot_googlestatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@

# read the shapefile and use its extent to define a ideally sized map
shp = salem.read_shapefile(get_demo_file('rgi_kesselwand.shp'))
# I you need to do a lot of maps you might want
# to use an API key and set it here with key='YOUR_API_KEY'
g = GoogleVisibleMap(x=[shp.min_x, shp.max_x], y=[shp.min_y, shp.max_y],
maptype='satellite') # try out: 'terrain'
maptype='satellite') # try out also: 'terrain'

# the google static image is a standard rgb image
ggl_img = g.get_vardata()
ax1.imshow(ggl_img)
ax1.set_title('Google static map')

# make a map of the same size as the image
sm = Map(g.grid, factor=1)
# make a map of the same size as the image (no country borders)
sm = Map(g.grid, factor=1, countries=False)
sm.set_shapefile(shp) # add the glacier outlines
sm.set_rgb(ggl_img) # add the background rgb image
sm.visualize(ax=ax2) # plot it
Expand Down
1 change: 1 addition & 0 deletions salem/sio.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ def open_xr_dataset(file):
ds = xr.Dataset()
ds.attrs['pyproj_srs'] = geo.grid.proj.srs
ds['data'] = da
ds['data'].attrs['pyproj_srs'] = geo.grid.proj.srs
return ds

# otherwise rely on xarray
Expand Down

0 comments on commit cf07635

Please sign in to comment.