oneworld.StaticMap.add_shp
- StaticMap.add_shp(shp_file, subset=None, subset_key='GEOID', color=cartopy.feature.COLORS.land, crs='PlateCarree', **kwargs)
Add polygons from a shapefile.
All polygons on the shapefile will have the same characteristics. Alternatively, a subset of polygons matching a certain criteria can be selected for plotting, leaving the rest unplotted. If set, only those polygons which subset_key attribute value matches that specified in subset will be added to the map.
- Parameters:
shp_file (str) – Full path name of the shapefile.
subset (str or None) – If set, only those polygons which subset_key attribute value matches that specified in subset will be added to the map (Default: None).
subset_key (str) – Attribute that will be used to identify which polygons to plot, in case subset is defined (Default: “GEOID”).
color (str) – Color of the area of the polygons (Default: ‘#efefdb’).
crs (str) – Coordinate reference system on which polygon geometries are specified. See https://scitools.org.uk/cartopy/docs/latest/crs/index.html for a full list of supported crs (Default: ‘PlateCarree’).
kwargs – Extra arguments for the plotting funtcion.
See also