|
1 |
| -Q: It takes a long time to make a plot with the 'intermediate' or |
2 |
| -'high' resolution coastlines, how can I speed it up? |
| 1 | +Q: It takes a long time to make a plot with the 'intermediate' or 'high' |
| 2 | +resolution coastlines, how can I speed it up? |
3 | 3 |
|
4 |
| -A: There is a overhead in processing boundary datasets when |
5 |
| -a Basemap class in created, and this overhead can be significant |
6 |
| -for the higher resolution boundaries. If you are makeing many maps |
7 |
| -for the same region, you only need to create you Basemap class instance |
8 |
| -once, then re-use it for each plot. If the plots are being created by |
9 |
| -different scripts, you can save the Basemap class instance to a Pickle on |
10 |
| -disk, then read it in whatever script needs it (it's much faster to read |
11 |
| -a pickle from disk than it is to create the Basemap instance originally). |
12 |
| -The ireland.py example illustrates how to do this. |
| 4 | +A: There is a overhead in processing boundary datasets when a Basemap |
| 5 | +class in created, and this overhead can be significant for the higher |
| 6 | +resolution boundaries. If you are makeing many maps for the same region, |
| 7 | +you only need to create you Basemap class instance once, then re-use it |
| 8 | +for each plot. If the plots are being created by different scripts, you |
| 9 | +can save the Basemap class instance to a Pickle on disk, then read it in |
| 10 | +whatever script needs it (it's much faster to read a pickle from disk than |
| 11 | +it is to create the Basemap instance originally). The ireland.py example |
| 12 | +illustrates how to do this. |
13 | 13 |
|
14 |
| -Q: I have my own boundary dataset that I would like to use, how do I |
15 |
| -use it in place of (or in addition to) the built-in basemap boundary datasets? |
| 14 | +Q: I have my own boundary dataset that I would like to use, how do I use |
| 15 | +it in place of (or in addition to) the built-in basemap boundary datasets? |
16 | 16 |
|
17 |
| -A: If your dataset is in ESRI shapefile format, this is relatively easy. |
| 17 | +A: If your dataset is in ESRI shapefile format, this is relatively easy. |
18 | 18 | Just create your Basemap class instance, then call the 'readshapefile'
|
19 |
| -method on that instance to import your data. Setting 'drawbounds=True' will |
20 |
| -draw the boundaries in the shapefile. The fillstates.py example |
| 19 | +method on that instance to import your data. Setting 'drawbounds=True' |
| 20 | +will draw the boundaries in the shapefile. The fillstates.py example |
21 | 21 | shows how to do this.
|
22 | 22 |
|
23 |
| -Q: How do I specify the map projection region if I don't know what the latitude and |
24 |
| -longitudes of the corners are? |
| 23 | +Q: How do I specify the map projection region if I don't know what the |
| 24 | +latitude and longitudes of the corners are? |
25 | 25 |
|
26 |
| -A: As an alternative to specifying the lat/lon values for the upper-right and |
27 |
| -lower-left corners of the projection domain (using the llcrnrlat, llcrnrlon, |
28 |
| -urcrnrlat and urcrnrlon keywords) you can specify the center of the map projection |
29 |
| -domain (using the lat_0 and lon_0 keywords) and the width and height of the domain |
30 |
| -in map projection coordinates (meters) using the width and height keywords. |
31 |
| -Basemap will then calculate the corresponging values of llcrnrlat, llcrnrlon, |
32 |
| -urcrnrlat and urcrnrlon. Examples of this are given in the garp.py and setwh.py |
33 |
| -examples. |
| 26 | +A: As an alternative to specifying the lat/lon values for the upper-right |
| 27 | +and lower-left corners of the projection domain (using the llcrnrlat, |
| 28 | +llcrnrlon, urcrnrlat and urcrnrlon keywords) you can specify the center of |
| 29 | +the map projection domain (using the lat_0 and lon_0 keywords) and the |
| 30 | +width and height of the domain in map projection coordinates (meters) |
| 31 | +using the width and height keywords. Basemap will then calculate the |
| 32 | +corresponging values of llcrnrlat, llcrnrlon, urcrnrlat and urcrnrlon. |
| 33 | +Examples of this are given in the garp.py and setwh.py examples. |
0 commit comments