GIS Annotator

class GISAnnotator(shape_files: List[str], columns: List[str], crs='EPSG:4326')[source]

Geographic Annotator adds columns to a provided data frame containing latitude and longitude (or other CRS) with labels coming from provided shape files, such as zip codes or county names (or FIPS codes)

Create the Annotator

Parameters:
  • shape_files – list of paths to shape files

  • columns – List of columns to be added by the annotator

  • crs – Coordinate reference system (CRS) used by the input data

join(df: DataFrame, x='longitude', y='latitude') DataFrame[source]

Adds columns with the labels to the data

Parameters:
  • df – Incoming data frame

  • x – A column, containing longitude

  • y – A column, containing latitude

Returns:

data frame with added annotations

static matches(columns: List[str], pattern: str) Optional[str][source]