Variable polyline buffer
Description
variable_polyline_buffer is a Python library for calculating a buffer around a polyline, defining the contours of a line with variable thickness. This function supports various applications in geographical information systems, computer graphics, and spatial analysis where dynamic line thickness is required.
Installation
To install this package, use pip:
pip install variable_polyline_buffer
Usage
Here is a simple example of how to use Variable-Polyline-Buffer:
from variable_polyline_buffer import generate_polyline_buffer
import matplotlib.pyplot as plt
# Example data: coordinates of polyline points and distance for each segment
points = [(0, 0), (2, 0.5), (3, -0.5), (4, 1)]
distances = [1, 0.5, 0.2] # Thickness of the individual segments
# Generate contours
left_contour, right_contour = generate_polyline_buffer(points, distances)
# Plot the contours
plt.plot([p[0] for p in points], [p[1] for p in points], "C0")
plt.plot([p[0] for p in left_contour], [p[1] for p in left_contour], "k--")
plt.plot([p[0] for p in right_contour], [p[1] for p in right_contour], "k--")
plt.axis("equal")
Replace points and dists with your polyline data and corresponding thicknesses.
Via supplying tuples as dists, one can also generate different thicknesses on the curve's two sides:
points = [(0, 0), (2, 0.5), (3, -0.5), (4, 1)]
distances = [(0.1, 1), (0.1, 0.5), 0.2]
By supplying False as distance, one can taper between segments with different widths:
points = [(0, 0), (1, 0), (2, 0), (3, 0)]
distances = [(0.5, 0), (False, 0), (0.2, 0)]
Requirements
Variable-Polyline-Buffer requires the following Python libraries:
- NumPy
License
This project is licensed under the MIT License.
Metadata
Release files for variable-polyline-buffer 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| variable_polyline_buffer-0.1.7.tar.gz | 4.1 kB | Without provenance | Details for variable_polyline_buffer-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| variable_polyline_buffer-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for variable_polyline_buffer-0.1.7-py3-none-any.whl |
Total release size: 8.6 kB
Release files / variable_polyline_buffer-0.1.7.tar.gz
| Download URL | variable_polyline_buffer-0.1.7.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3932cc7cba618716b815579c7a5aee103be4acb765cae3470d586e778cadc704
|
|
BLAKE2b-256 checksum How to use checksums |
a36c36db03ff74820489ba09bac38ae7328d88f5c35c150df3519bf9c5401ec6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|
Release files / variable_polyline_buffer-0.1.7-py3-none-any.whl
| Download URL | variable_polyline_buffer-0.1.7-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
652d38b4f4c01cf81306d88c98586fbf370946cebfb7eb9054528760590c1f0c
|
|
BLAKE2b-256 checksum How to use checksums |
8085049fc7e6197c8caf4bdc2aba215105daf251dee71065698765932a41667c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|
Security for variable-polyline-buffer 0.1.7
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.