All Projects → fitodic → Centerline

fitodic / Centerline

Licence: mit
Calculate the polygon's centerline

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Centerline

Grim
Grab images from a Wayland compositor
Stars: ✭ 533 (+467.02%)
Mutual labels:  cli, screenshot
Fiona
Fiona reads and writes geographic data files
Stars: ✭ 787 (+737.23%)
Mutual labels:  cli, gis
Imgur Screenshot
Take screenshot selection, upload to imgur. + more cool things
Stars: ✭ 540 (+474.47%)
Mutual labels:  cli, screenshot
Fmm
Fast map matching, an open source framework in C++
Stars: ✭ 359 (+281.91%)
Mutual labels:  gis, shapefile
Leaflet Geoman
🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
Stars: ✭ 1,088 (+1057.45%)
Mutual labels:  polygon, gis
Blendergis
Blender addons to make the bridge between Blender and geographic data
Stars: ✭ 4,642 (+4838.3%)
Mutual labels:  gis, shapefile
Slop
slop (Select Operation) is an application that queries for a selection from the user and prints the region to stdout.
Stars: ✭ 639 (+579.79%)
Mutual labels:  cli, screenshot
covid hospitals demographics
COVID-19 relevant data on hospital location / capacity, nursing home location / capacity, county demographics
Stars: ✭ 21 (-77.66%)
Mutual labels:  gis, shapefile
Foxshot
Capture web page screenshots using headless Firefox!
Stars: ✭ 52 (-44.68%)
Mutual labels:  cli, screenshot
Shapefile.jl
Parsing .shp files in Julia
Stars: ✭ 40 (-57.45%)
Mutual labels:  gis, shapefile
Slurp
Select a region in a Wayland compositor
Stars: ✭ 350 (+272.34%)
Mutual labels:  cli, screenshot
Page2image
📷 page2image is a npm package for taking screenshots which also provides CLI command
Stars: ✭ 66 (-29.79%)
Mutual labels:  cli, screenshot
Singlefile
Web Extension for Firefox/Chrome/MS Edge and CLI tool to save a faithful copy of an entire web page in a single HTML file
Stars: ✭ 4,417 (+4598.94%)
Mutual labels:  cli, screenshot
Ffcast
Run command on rectangular screen regions
Stars: ✭ 478 (+408.51%)
Mutual labels:  cli, screenshot
GeoConvert
Converting between Geojson and GIS file formats
Stars: ✭ 32 (-65.96%)
Mutual labels:  gis, shapefile
Python Mss
An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
Stars: ✭ 582 (+519.15%)
Mutual labels:  cli, screenshot
pyGISS
📡 A lightweight GIS Software in less than 100 lines of code
Stars: ✭ 114 (+21.28%)
Mutual labels:  gis, shapefile
shapefile-rs
Rust library to read & write shapefiles
Stars: ✭ 38 (-59.57%)
Mutual labels:  gis, shapefile
Maup
The geospatial toolkit for redistricting data.
Stars: ✭ 35 (-62.77%)
Mutual labels:  gis, shapefile
Geotools
Official GeoTools repository
Stars: ✭ 1,109 (+1079.79%)
Mutual labels:  gis, shapefile

Centerline

.. image:: https://travis-ci.org/fitodic/centerline.svg?branch=master :target: https://travis-ci.org/fitodic/centerline :alt: Build

.. image:: https://readthedocs.org/projects/centerline/badge/?version=latest :target: http://centerline.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

.. image:: https://coveralls.io/repos/github/fitodic/centerline/badge.svg?branch=master :target: https://coveralls.io/github/fitodic/centerline?branch=master :alt: Coverage

.. image:: https://img.shields.io/pypi/v/centerline.svg :target: https://pypi.python.org/pypi/centerline :alt: Version

.. image:: https://pepy.tech/badge/centerline :target: https://pepy.tech/project/centerline :alt: Downloads

.. figure:: docs/images/example.png :align: center

Roads, rivers and similar linear structures are often represented by long and complex polygons. Since one of the most important attributes of a linear structure is its length, extracting that attribute from a polygon can prove to be more or less difficult.

This library tries to solve this problem by creating the the polygon's centerline using the Voronoi diagram <https://en.wikipedia.org/wiki/Voronoi_diagram>. For more info on how to use this package, see the official documentation <http://centerline.readthedocs.io/>.

Features ^^^^^^^^

  • A command-line script for creating centerlines from a vector source file and saving them into a destination vector file: create_centerlines

.. code:: bash

$ create_centerlines input.shp output.geojson
  • The Centerline class that allows integration into your own workflow.

.. code:: python

>>> from shapely.geometry import Polygon
>>> from centerline.geometry import Centerline

>>> polygon = Polygon([[0, 0], [0, 4], [4, 4], [4, 0]])
>>> attributes = {"id": 1, "name": "polygon", "valid": True}

>>> centerline = Centerline(polygon, **attributes)
>>> centerline.id == 1
True
>>> centerline.name
'polygon'
>>> centerline.geoms
<shapely.geometry.base.GeometrySequence object at 0x7f7d24116210>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].