milton_maps package
Subpackages
Submodules
milton_maps.cli module
Usage: milton_maps CMD …
- Arguments:
CMD
- Options:
-h –help
milton_maps.logging_config module
milton_maps.milton_maps module
- milton_maps.milton_maps.make_choropleth_style_function(df: DataFrame, attr: str, colormap: str, navalue='None')[source]
- milton_maps.milton_maps.plot_map(gdf: GeoDataFrame, column: str, categorical: bool = True, axis_scale: float = 1, legend_shift: float = 1, figsize: Tuple[int, int] = (20, 20), markersize: float = 0.01, legend: bool = True, title: str | None = None, cmap: str = 'gist_earth', fig=None, ax=None, **style_kwds)[source]
Generic function to plot maps from GeoDataFrame.
- Args:
gdf (geopandas.GeoDataFrame): the GeoDataFrame we want to plot map from. column (str): column name that we want to use in the plot. categorical (bool):
Trueif the column should be treated as a categorical variable,`False`` if not. Defaults toTrue. axis_scale (float): the scale to enlarge or shrink the axis. Defaults to1(no size adjustments). legend_shift (float): how much to shift the legend box to the right. Defaults to1. Larger number will shift the legend box further to the right. This parameter is used to prevent overlap of the legend box and the map. figsize (tuple): the size of the figure. Defaults to(20, 20). markersize (float): the size of the marker, only useful for GeoDataFrame that contains point geometries. Defaults to0.01. title (str): the title of the figure. Defaults toNone, in which case no title will be set. cmap (str): the color map to use in the map plot. Defaults to'gist_earth'. The color maps available in matplotlib can be found here: https://matplotlib.org/3.1.0/tutorials/colors/colormaps.html ax: (matplotlib.axes._subplots.AxesSubplot) matplotlib axis object to add plot to- Returns:
matplotlib.axes._subplots.AxesSubplot: matplotlib plot.
- milton_maps.milton_maps.transform_use_codes(use_codes: Series) Series[source]
Standardizes use codes by extracting first three digits and looking up description
USE_CODE – state three-digit use code with optional extension digit to accommodate the four-digit codes commonly used by assessors. If the codes contain a four-digit use code, because the meaning of the fourth digit varies from community-to-community, the standard requires a lookup table. See the end of this Section for more details on this look-up table.
milton_maps.process_assessor_db module
Usage: milton_maps process_assessor_db INPUT LAYER OUTPUT
- Arguments:
INPUT path to GDB file containing assessor DB in layer LAYER LAYER layer within GDB file containing asessor DB OUTPUT output path to write processed Assessor DB as a pickled dataframe
milton_maps.process_crash_data module
milton_maps.process_openspace module
Usage: milton_maps process_openspace INPUT OUTPUT
- Arguments:
INPUT path to SHP file containing assessor DB in layer LAYER OUTPUT output path to write processed Assessor DB as a pickled dataframe
milton_maps.process_tax_parcels module
Usage: milton_maps process_tax_parcels TAX_PARCELS ASSESSOR_DBS OUTPUT
- Arguments:
TAX_PARCELS comma separated list of paths to SHP files containing tax parcels for towns ASSESSOR_DBS comma separated list of paths to pkl files containing cleaned assessor DB dataframes for towns OUTPUT output path to write processed Assessor DB as a pickled dataframe
milton_maps.process_town_boundaries module
Usage: milton_maps process_town_boundaries INPUT OUTPUT
- Arguments:
INPUT path to GDB file containing assessor DB OUTPUT output path to write processed Assessor DB as a pickled dataframe
Module contents
Top-level package for milton_maps