## Wednesday, November 26, 2014

### Basemap Tutorial

Basemap is a great tool for creating maps using python in a simple way. It's a matplotlib <http://matplotlib.org/>_ extension, so it has got all its features to create data visualizations, and adds the geographical projections and some datasets to be able to plot coast lines, countries, and so on directly from the library.

Basemap has got some documentation <http://matplotlib.org/basemap/index.html>_, but some things are a bit more difficult to find. I started a readthedocs page to extend a little the original documentation and examples, but it grew a little, and now covers many of the basemap possibilities.

 Some of the examples from the tutorial

The tutorial can be found at http://basemaptutorial.readthedocs.org/, and all the examples and its source code, at GitHub and it's available for sharing or being modified by adding the attribution.

The tutorial covers:
I would really appreciate some feedback, the comments are open!

1. This comment has been removed by the author.

2. This is really cool, you are helping me with a homework assignment, thanks so much! If I have any useful feedback I'll post here but wanted to say how thankful I am that someone has extended the cryptic documentation. Thanks!

1. I'm glad that you find it useful!

3. Very helpful tutorials.I am trying to find the coordinates: llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat for London. Can you please tell me how to find them?

1. Hi,

You can either look on Google Maps the locations you want to show or, if you want to show London in the center, use the lon_0 and lat_0 plus the map size.
The three options are shown here: https://basemaptutorial.readthedocs.io/en/latest/basemap.html#passing-the-bounding-box

4. Hi Roger, I've benefited a lot from your tutorials and online docs. Basemap has been a fun tool for me to learn and use, so thanks!

I'm starting a project now that involves some 3d plotting. I've looked a bit here:
and this is very useful.

The question I still have though, is how to add a shapefile to a 3D map. Is this currently possible with Basemap?

Thanks!

1. Hi Alex,
Yes, just use the same steps as in https://basemaptutorial.readthedocs.io/en/latest/shapefile.html
to load the shapefile and draw the 3d map like in the example

5. I am working with WRF output using GDAL and learned a lot from your tutorial. Thanks so much!
One thing that was not explained in the examples from WRF -or at least I could not find it- is how to get the start date and timesteps and other global attributes from the WRF output file using the GDAL library, or in some other way.
I tried to get the Times as gdal dataset, like the other variables, but that did not work.