Last active
December 7, 2017 08:59
-
-
Save crooksey/c0a4dfb6b6daee1cc091af196a4767b1 to your computer and use it in GitHub Desktop.
Plotting map using bounding box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
central_lat = sum(lats)/len(lats) | |
central_lng = sum(lngs)/len(lngs) | |
bbox = BoundingBox(coords) | |
map = Basemap( | |
llcrnrlon=bbox.minx,llcrnrlat=bbox.miny, | |
urcrnrlon=bbox.maxx,urcrnrlat=bbox.maxy, | |
resolution='i', projection='tmerc', | |
lat_0 = central_lat, lon_0 = central_lng) | |
map.drawmapboundary(fill_color='aqua') | |
map.fillcontinents(color='coral',lake_color='aqua') | |
map.drawcoastlines() | |
x,y = map(lngs, lats) | |
map.plot(x, y, 'ro-') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment