Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a high resolution etopo background in matplotlib Basemap?

The etopo background pic's resolution is very low in default. How can I get a high resolution background ?

like image 999
Zipo Avatar asked Dec 25 '13 03:12

Zipo


3 Answers

I just came into some similar things! At first I thought maybe I should go to GMT. But finally I found this:

http://basemaptutorial.readthedocs.org/en/latest/backgrounds.html

I used the arcgisimage() in Basemap. Once you decide the corresponding epsg number of place of interest, and set the range of plotting, you are likely to get a nice picture. (EPSG number is important.) Here is my code. (POI: LA)

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

map = Basemap(llcrnrlon=-118.5,llcrnrlat=33.15,urcrnrlon=-117.15,urcrnrlat=34.5, epsg=4269)
#http://server.arcgisonline.com/arcgis/rest/services
#EPSG Number of America is 4269

map.arcgisimage(service='ESRI_Imagery_World_2D', xpixels = 2000, verbose= True)
plt.show()

If you want etopo background, you can just use 'ESRI_Imagery_World_2D', which looks very similar. And from the script you can see the region is less than one degree wide and long.(in lat and lon)

And there are many service to choose from! (I am not advertising.(。・`ω´・) )

Some figure I've drawn. enter image description hereenter image description hereenter image description here

like image 83
Temy Avatar answered Nov 03 '22 10:11

Temy


With the function warpimage() you can use any custom image as a map background. The image must be global, covering the world in lat/lon coordinates from the international dateline eastward and the South Pole northward.

like image 25
Skyler Avatar answered Nov 03 '22 11:11

Skyler


You can use the .etopo() method directly.

like image 1
gerrit Avatar answered Nov 03 '22 11:11

gerrit