teehr.LocationTable#
- class teehr.LocationTable(ev)[source]#
Bases:
BaseTable
Access methods to locations table.
Methods
distinct_values
Return distinct values for a column.
Get the location fields enum.
fields
Return table columns as a list.
filter
Apply a filter.
Import geometry data.
order_by
Apply an order_by.
query
Run a query against the table with filters and order_by.
Return GeoPandas DataFrame.
Return Pandas DataFrame for Location Table.
to_sdf
Return PySpark DataFrame.
validate
Validate the dataset table against the schema.
- load_spatial(in_path: Path | str, field_mapping: dict | None = None, pattern: str = '**/*.parquet', **kwargs)[source]#
Import geometry data.
- Parameters:
in_path (
Union[Path
,str]
) – The input file or directory path. Any file format that can be read by GeoPandas.field_mapping (
dict
, optional) – A dictionary mapping input fields to output fields. Format: {input_field: output_field}pattern (
str
,optional (default
:"**/*.parquet"
)
) – The pattern to match files. Only used when in_path is a directory.**kwargs – Additional keyword arguments are passed to GeoPandas read_file().
File is first read by GeoPandas, field names renamed and
then validated and inserted into the dataset.
Notes
The TEEHR Location Crosswalk table schema includes fields:
id
name
geometry