Linearly referenced data management, manipulation, and operations
Project description
Overview
The linref library builds on tabular and geospatial libraries pandas and geopandas to provide powerful features for linearly referenced data management, manipulation, and analysis. Using a modern pandas accessor pattern (.lr), linref seamlessly extends DataFrames with linear referencing capabilities while maintaining full compatibility with existing pandas/geopandas workflows.
At its core, linref uses:
LRS (Linear Referencing System) objects to define the schema of your linearly referenced data
EventsData as the underlying computational engine for efficient linear operations
DataFrame accessor pattern (.lr) for intuitive, pandas-like syntax
Optimized implementations powered by numpy, shapely, and scipy
Some of the main features of this library include:
Event data engineering - Merge consecutive events with df.lr.dissolve(), create uniform segments with df.lr.resegment(), and project point and linear data onto linearly referenced data
Data conflation operations - Create relationships between datasets with df.lr.relate() and aggregate data by attributes, counts, and more using count and length-weighted methods
Geometry operations - Generate geometries from mile markers, extract mile markers from geometries, and perform spatial linear referencing operations
Integration - Combine multiple event datasets into unified linearly referenced frameworks
Prepare and run in-depth analyses - Built-in support for advanced analyses such as high-injury networks, intersection influence areas, and more through simple, well-documented methods
Getting Started
Installation
Install linref using pip:
pip install linref
Basic Concepts
Linear Referencing System (LRS)
An LRS defines the schema of your linearly referenced data by specifying which columns represent:
Key columns key_col - One or more unique route identifier or grouping columns (e.g., ‘Route’, ‘County’)
Chain column chain_col - An optional column for chain indices that identify contiguous geometry groups within each route, extending standard key columns to avoid non-contiguous groups
Measure columns - For point events use loc_col (e.g., ‘Milepost’), for linear events beg_col and end_col (e.g., ‘Begin_Milepost’, ‘End_Milepost’)
Geometry columns - For spatial data geom_col and for spatial data that is m-enabled geom_m_col (generally m-enabled geometries are prepared and managed by linref)
Closure type closed - How range endpoints are handled: ‘left’, ‘right’, ‘both’, ‘neither’, or ‘left_mod’/’right_mod’
Documentation
Examples: See the examples section for step-by-step Jupyter notebook tutorials
API Reference: See the API reference for detailed class and method documentation
Release Notes: See the changelog for detailed version history
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linref-1.0.0.tar.gz.
File metadata
- Download URL: linref-1.0.0.tar.gz
- Upload date:
- Size: 98.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b65507c277daee1df401c52218a34f37ad8b512824e872fe415cca6ac3be3d6d
|
|
| MD5 |
856bdc5ea693658cf4a8ca56569d1093
|
|
| BLAKE2b-256 |
4bc30ce13dfbcd8403fd5878ff59eacb60b1404cd28401c74b65007ee9ae91fa
|
Provenance
The following attestation bundles were made for linref-1.0.0.tar.gz:
Publisher:
ci.yml on tariqshihadah/linref
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linref-1.0.0.tar.gz -
Subject digest:
b65507c277daee1df401c52218a34f37ad8b512824e872fe415cca6ac3be3d6d - Sigstore transparency entry: 2138459341
- Sigstore integration time:
-
Permalink:
tariqshihadah/linref@5e746136c0cba247d1cf9e85242585b7eda3fe4c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/tariqshihadah
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5e746136c0cba247d1cf9e85242585b7eda3fe4c -
Trigger Event:
push
-
Statement type:
File details
Details for the file linref-1.0.0-py3-none-any.whl.
File metadata
- Download URL: linref-1.0.0-py3-none-any.whl
- Upload date:
- Size: 107.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
582410427349e5f231a1f29afb65fb8b89026419371146f985b0d586494b8a20
|
|
| MD5 |
58dc1ef5853024d15e7514581b6c8501
|
|
| BLAKE2b-256 |
2ed20654b090f8390681e73bfe3b8ff3d7c480f57061ca8be752e41ae608ab04
|
Provenance
The following attestation bundles were made for linref-1.0.0-py3-none-any.whl:
Publisher:
ci.yml on tariqshihadah/linref
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
linref-1.0.0-py3-none-any.whl -
Subject digest:
582410427349e5f231a1f29afb65fb8b89026419371146f985b0d586494b8a20 - Sigstore transparency entry: 2138459352
- Sigstore integration time:
-
Permalink:
tariqshihadah/linref@5e746136c0cba247d1cf9e85242585b7eda3fe4c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/tariqshihadah
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5e746136c0cba247d1cf9e85242585b7eda3fe4c -
Trigger Event:
push
-
Statement type: