A simple Python library based on Shapely to generate random points on Polygon or MultiPolygon
Project description
random-points-on-polygon
A simple Python library based on Shapely to generate random points on Polygon or MultiPolygon
Installation
From PyPI directly:
pip install random-points-on-polygon
Examples
Generate 10 random points on a polygon
from random_points_on_polygon import PointsGenerator
from random_points_on_polygon.samples import POLYGON_SAMPLE_1
pg: PointsGenerator = PointsGenerator(POLYGON_SAMPLE_1)
pg.generate(10)
Get Polygon (or MultiPolygon) including generated points as GeoJSON.
geojson_output: dict = pg.geojson()
Get generated points as GeoJSON
geojson_output: dict = pg.points_as_geojson()
Get Polygon (or MultiPolygon) as GeoJSON
geojson_output: dict = pg.polygon_as_geojson()
Graphically view the result
You can copy and paste the geojson_output content into geojson.io to graphically view the result
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file random-points-on-polygon-0.0.3.tar.gz.
File metadata
- Download URL: random-points-on-polygon-0.0.3.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05834746a81c5511ddb24ed3055e56364c551ec0d9c0190b7333206a6b6bfe3b
|
|
| MD5 |
7619e9f1c43473077a4698f67d33650f
|
|
| BLAKE2b-256 |
0d72b4a0d8057ee191ebe51d4bfd1ad1cc3d138fbc1cddd21096686dce467317
|
File details
Details for the file random_points_on_polygon-0.0.3-py3-none-any.whl.
File metadata
- Download URL: random_points_on_polygon-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e918c9111fc752982bc26e6044f200f5bac636d2fe926761fa4b9e9ba81193bb
|
|
| MD5 |
b8b579898c21b67325cb1e6a488a555a
|
|
| BLAKE2b-256 |
e4176f4ef69b77c0e1f6d106e1ff7a1ed04dd0edbdfb6598f27816e17b72d74a
|