pyincore_data

censusutil

censusviz

class censusviz.CensusViz

Utility methods for Census data and visualization

static create_choro_data_from_pd(pd, key)

Create choropleth choro-data from dataframe.

Parameters:
  • pd (object) – an Input dataframe.

  • key (str) – a string for dictionary key

Returns:

A dictionary of dataframe

Return type:

obj

static create_choropleth_layer(geo_data, choro_data, name)

Create ipyleaflet layer for choropleth map.

Parameters:
  • geo_data (object) – dictionary from geodataframe

  • choro_data (object) – choropleth data from geodataframe

  • name (str) – name for the layer

Returns:

An ipyleaflet layer

Return type:

obj

static create_dislocation_folium_map_from_gpd(in_gpd)

Create folium dislocation map for geodataframe.

Parameters:

in_gpd (object) – Geodataframe of the dislocation.

Returns:

A folium map for dislocation

Return type:

obj

static create_dislocation_ipyleaflet_map_from_gpd(in_gpd, zoom_level=10)

Create ipyleaflet dislocation map for geodataframe.

Parameters:
  • in_gpd (object) – Geodataframe of the dislocation.

  • zoom_level (int) – default zoom level for the map

Returns:

An ipyleaflet map for dislocation

Return type:

obj

static create_ipyleafletmap_from_geodataframe(gpd, zoom_level=100)

Create base ipyleaflet map from geodataframe.

Parameters:
  • gpd (object) – Geodataframe of the dislocation.

  • zoom_level (int) – default zoom level for the map

Returns:

An ipyleaflet map for dislocation

Return type:

obj

static save_dislocation_map_to_html(folium_map, programname, savefile)

Save folium dislocation map to html.

Parameters:
  • folium_map (object) – Folium map object.

  • programname (str) – Name of the program.

  • savefile (str) – Name of the file to save.

datautil

class utils.datautil.DataUtil
static convert_dislocation_gpd_to_geopackage(in_gpd, programname, savefile)

Create shapefile of dislocation geodataframe.

Parameters:
  • in_gpd (object) – Geodataframe of the dislocation.

  • programname (str) – Output directory name.

  • savefile (str) – Output shapefile name.

static convert_dislocation_gpd_to_shapefile(in_gpd, programname, savefile)

Create shapefile of dislocation geodataframe.

Parameters:
  • in_gpd (object) – Geodataframe of the dislocation.

  • programname (str) – Output directory name.

  • savefile (str) – Output shapefile name.

static convert_dislocation_pd_to_csv(in_pd, save_columns, programname, savefile)

Create csv of dislocation dataframe using the column names.

Parameters:
  • in_pd (object) – Geodataframe of the dislocation.

  • save_columns (list) – A list of column names to use.

  • programname (str) – Output directory name.

  • savefile (str) – Output csv file name.