Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linref-1.0.0.tar.gz (98.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linref-1.0.0-py3-none-any.whl (107.7 kB view details)

Uploaded Python 3

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

Hashes for linref-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b65507c277daee1df401c52218a34f37ad8b512824e872fe415cca6ac3be3d6d
MD5 856bdc5ea693658cf4a8ca56569d1093
BLAKE2b-256 4bc30ce13dfbcd8403fd5878ff59eacb60b1404cd28401c74b65007ee9ae91fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for linref-1.0.0.tar.gz:

Publisher: ci.yml on tariqshihadah/linref

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for linref-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 582410427349e5f231a1f29afb65fb8b89026419371146f985b0d586494b8a20
MD5 58dc1ef5853024d15e7514581b6c8501
BLAKE2b-256 2ed20654b090f8390681e73bfe3b8ff3d7c480f57061ca8be752e41ae608ab04

See more details on using hashes here.

Provenance

The following attestation bundles were made for linref-1.0.0-py3-none-any.whl:

Publisher: ci.yml on tariqshihadah/linref

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page