Skip to content

Instantly share code, notes, and snippets.

@crooksey
Last active December 7, 2017 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crooksey/c0a4dfb6b6daee1cc091af196a4767b1 to your computer and use it in GitHub Desktop.
Save crooksey/c0a4dfb6b6daee1cc091af196a4767b1 to your computer and use it in GitHub Desktop.
Plotting map using bounding box
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