Skip to main content

Python Geological Lineament extraction package

Project description

PyLineament

PyLineament is a Python-based, open-source toolkit for automatic and regional-scale lineament extraction from Digital Elevation Models (DEMs) and remote sensing imagery.

It is designed for geological and geomorphological analysis — providing a fully automated, reproducible, and scalable workflow for extracting, reducing, and mapping lineaments across local to regional scales.


Installation

pip install pylineament

Or from source:

git clone https://github.com/epokus/pylineament.git
cd pylineament
pip install -e .

Quick Start (Command Line)

Once installed, simply open your terminal or command prompt and run:

pylineament

Key Features

  • Interactive UI — Run pylineament in the terminal to open the GUI.
  • Automated Workflow — Full end-to-end lineament extraction.
  • Customizable Parameters — Control edge detection thresholds, segment length, and merging distance.
  • Multi-Resolution Support — Works with various DEM/image resolutions.
  • Scalable — Efficient for large-area or regional-scale mapping.
  • Reproducible — Transparent parameters and open-source implementation.

Core Functions

Function Description
read_raster() Reads and preprocesses a raster (DEM or image).
extract_lineament_points() Detects lineament-like edge points using gradient filters.
convert_points_to_line() Converts clustered edge points into connected line segments.
reduce_lines() Simplifies and merges overlapping or redundant lineaments.
hillshade() Generates a hillshade image for visualization.
dem_to_line() Extracts lineaments directly from a DEM file.
dem_to_shp() Full workflow: extract + merge + export to shapefile.

Example Workflow

  • Input your DEM or satellite image.
  • Optionally apply hillshade() or downscale for efficiency.
  • Extract edge points using extract_lineament_points().
  • Convert points to lines and merge them with reduce_lines().
  • Save as shapefile using dem_to_shp() or merge_lines_csv_to_shp().

example how to use this Library with CLI or python

from pylineament import dem_to_shp
dem_to_shp("data/srtm_sample.tif", shp_name= "lineamentsExtract")

shp file will be saved in "lineamentsExtract" folder. see more examples in example folder PyLineament UI Preview

Parameters Overview

Parameter Description Typical Range
eps Edge detection sensitivity 0.8 – 2.0
thresh Edge detection threshold 20 – 80
z_multip Vertical exaggeration factor 0.5 – 2.0
min_dist Minimum distance between merged lines 5 – 20 pixels
seg_len Minimum segment length 5 – 20 pixels
split_size DEM/image tile size for processing 250 – 1000 pixels

Why PyLineament?

Typical “automatic” lineament extraction tools are limited by:

  • Fixed image resolution and poor scalability,
  • Heavy preprocessing requirements,
  • Loss of geological meaning across scales,
  • Slow performance in large regions.

PyLineament addresses these by providing:

  • Automated but parameter-controllable extraction,
  • Multi-resolution and downscaling support,
  • Robust reduction and merging algorithms,
  • Compatibility with both small-area (detailed) and large-area datasets (regional mapping).

Citation

If you use PyLineament in your research, please cite: Prasetya Kusumah, E. (2025). PyLineament: A Python Toolkit for Regional-Scale Lineament Extraction. Version 1.0. https://github.com/epokus/pylineament

License

This project is licensed under the MIT License — see the LICENSE file for details.

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

pylineament-1.0.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

pylineament-1.0.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file pylineament-1.0.1.tar.gz.

File metadata

  • Download URL: pylineament-1.0.1.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for pylineament-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5bd3b1fef175b86ce2495141f9ce471f2bc221eb2f32b7c7733656bd99adca1d
MD5 1fba54f182857984194f7da0eea711f9
BLAKE2b-256 67295833b6e815696f5fcda3826850f098901387d3006119e48cd173a13a37f4

See more details on using hashes here.

File details

Details for the file pylineament-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pylineament-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for pylineament-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5bdf210f99686c4b6c5499eda9f391f557535cb4d00c0d26ab0ab7365d161a
MD5 5dbf670466b1f327f48d287e8000b573
BLAKE2b-256 0ec7c2afd4bfb8e7b354d79b85cc746c3cafeae7d57e41b2a16a159d3da9d9ce

See more details on using hashes here.

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