laser.measles.demographics.shapefiles
laser.measles.demographics.shapefiles
laser.measles.demographics.shapefiles.add_dotname(path, dot_name_fields, dotname_symbol=':', append_suffix='dotname', inplace=False, field_name='DOTNAME')
Add a DOTNAME to the shapefile.
laser.measles.demographics.shapefiles.check_field(path, field_name)
Check whether a shapefile contains a named attribute field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to the |
required |
field_name
|
str
|
Field name to look for (e.g. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
laser.measles.demographics.shapefiles.get_shapefile_dataframe(shapefile_path)
Get a DataFrame containing the shapefile data with DOTNAME and shape columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shapefile_path
|
str | Path
|
The path to the shapefile. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
A DataFrame with DOTNAME and shape columns. |
laser.measles.demographics.shapefiles.plot_shapefile_dataframe(df, ax=None, plot_kwargs=None)
Render shapefile polygons onto a matplotlib axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
DataFrame returned by |
required |
ax
|
Axes | None
|
Matplotlib axes. A new figure is created if |
None
|
plot_kwargs
|
dict | None
|
Additional keyword arguments forwarded to
|
None
|
Returns:
| Type | Description |
|---|---|
Figure
|
The matplotlib |