0

I'm trying to produce a map showing water bodies like oceans/rivers/lakes polygons for purposes of plotting vessel voyages using cartopy. Ultimately I'm looking to create a sea mesh grid using the water polygons. However i'm stuck at the first step in generating the polygons for the water bodies. My marine polys look alright but my lakes rivers centerlines look like the polgons are clipped. Does anyone know how I can fix this? I'm pretty sure the rectangularish lakes are incorrectly displayed. My code in python is as follows:

ax = plt.axes(label = 'main_geoaxes',projection=ccrs.PlateCarree()) rivers_lake_centerlines = cf.NaturalEarthFeature(category='physical', name='rivers_lake_centerlines', scale='ne_10m',facecolor='b') ax.add_feature(rivers_lake_centerlines,zorder=1)

Lakes Rivers Centrelines Marine Polys

  • 1
    I've found out that the river lake centerlines map actually comprises LINES not polygons. The clipped areas are caused by setting facecolor of the lines (when I should be setting the edgecolor instead). My amended line of code below solved the problem. rivers_lake_centerlines = cf.NaturalEarthFeature(category='physical', name='rivers_lake_centerlines', scale='ne_10m',facecolor='none',edgecolor='b') – Winston Tan Jul 26 '18 at 14:05
  • 1
    Please consider posting your solution as an answer to the question, so that others can benefit from the learning (and so that there aren't "unanswered" questions on the cartopy tag when they are really answered). – pelson Jul 30 '18 at 9:11
  • You might also like to reference the answer at stackoverflow.com/a/51494198/741316 which was asked 3 weeks ago. – pelson Jul 30 '18 at 9:12
1

For clarity's sake and upon request I have posted my code snippet .I've changed the map as of this posting so it is not identical to the two maps I've posted for above. Thank for you your replies!

    # Get cartopy features for plotting
    rivers_lake_centerlines = cf.NaturalEarthFeature(category = 'physical', name = 'rivers_lake_centerlines',
    scale = 'ne_10m', facecolor = 'none', edgecolor = 'blue')

    marine_polys = cf.NaturalEarthFeature(category='physical', name='geography_marine_polys', scale='ne_10m',
                                          facecolor='blue')
    graticules_1 = cf.NaturalEarthFeature(category='physical', name='graticules_5', scale='ne_10m', edgecolor='black')

    self.fig, self.ax = plt.subplots(subplot_kw={'projection': ccrs.PlateCarree()}, figsize=(30, 30))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.