Skip to main content

Welcome to LinkingLines!

status DOI PyPI ReadtheDocs License

Read the Full documentation on ReadtheDocs!

1. Introduction

Welcome to the documentation for our Python module that performs the Hough Transform on lines from geospatial data, clusters it using Agglomerative Clustering. This module also includes custom plotting scripts and feature extraction methods to help you analyze and visualize your data effectively.

This code was used to create the results published in Kubo Hutchison et al., 2023. Initially, it was designed to link together mapped dike segments in Cartesian space to find their true lengths. This code can be applied to any linear features including roads, fractures, and other types of linear data.

  • Data Clustering: Apply Agglomerative Clustering to group similar data points, this can be used for data reduction, analysis, and mapping.

  • Data Visualization: Custom plotting scripts help you visualize and analyze your data, making it easier to identify patterns and anomalies.

  • Feature Extraction: Extract meaningful features from clustered data to perform further analysis, such as linear or radial type features.

Full documentation can be found on ReadTheDocs

2. Installation

To use this module, make sure you have Python installed (preferably Python 3.x). You can install the required packages using pip:

pip install linkinglines

3. Quick Start

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import linkinglines as ll

data=ll.readFile('path/to/data')

dtheta=2 #degrees
drho=500 #meters

dikeset, Z=ll.AggCluster(data)
lines,evaluation=examineCluster(data)
fig,ax=DotsLines(lines, ColorBy='AvgTheta')

We have three examples:

  1. In-depth tutorial with Hough transform, clustering, and feature extraction using Spanish Peaks Data CSV file.
  2. Hough Transform and feature extraction on Venus lineament data shape file.
  3. Hough Transform on fracture data geoJSON.

Data from:

  1. https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2022GC010842
  2. https://pubs.usgs.gov/sim/3121/
  3. https://doi.org/10.5281/zenodo.7919843

4. Contributing Guidelines

If you find bugs or issues please open up an issues. We also welcome requests for additional features.

If you would like to contribute code please do so in a separate branch and open up an issue describing your contribution.

git clone git@github.com:USER/LinkingLines.git
git checkout my-development-branch

We recommend using a virtual environment to manage packages. We use poetry to manage dependencies and building. See more about poetry.

pipx install poetry # you may need to install pipx first

cd linkinglines # go to the repo

poetry install --with test,dev # install in editable mode

# add your code

poetry run pytest  # test code locally

Before submitting your pull request please verify the following:

  1. Code is documented in NumPy Docstring Style
  2. Code is tested and passes test
    • To run the tests please go to "/tests" and run poetry run pytest or pytest
    • Add your test code to any file with the name test
    • More here on pytest and testing practices
  3. Open an issue and pull request
  4. After your pull request the code will be reviewed by maintainer (namely @aikubo).
  5. After passing review and automated tests it will be added to the next release and published to pypi.

Metadata

Release files for linkinglines 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for linkinglines 2.1.2
File Size Uploaded Provenance Actions
linkinglines-2.1.2.tar.gz 54.8 kB Without provenance Details for linkinglines-2.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for linkinglines 2.1.2
File Interpreter ABI Platform Actions
linkinglines-2.1.2-py3-none-any.whl Python 3 none any Details for linkinglines-2.1.2-py3-none-any.whl

Total release size: 113.3 kB

Release files / linkinglines-2.1.2.tar.gz

Download URL linkinglines-2.1.2.tar.gz
Size 54.8 kB
Tags Source
SHA-256 checksum
How to use checksums
581609aed7ae6eb1e660b0578a4fd2a80d9d80af95b1f247ad49b348d5389571
BLAKE2b-256 checksum
How to use checksums
e1e2913c5cc0c64ee0fb3447593a4851d7239b8e66429fef3e02db7fe276fbe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.2.6-76060206-generic

Release files / linkinglines-2.1.2-py3-none-any.whl

Download URL linkinglines-2.1.2-py3-none-any.whl
Size 58.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47ade577d823b75bbc8e810f61c296bfc5de641bef997fb47e75ca4db8f09acd
BLAKE2b-256 checksum
How to use checksums
c6bfb477bdc3253bb6dadb2a1b4acc6e9bd7baa507a21152607e1e546fd3f392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.12 Linux/6.2.6-76060206-generic

Security for linkinglines 2.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page