Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

random-points-on-polygon-0.0.3.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

random_points_on_polygon-0.0.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file random-points-on-polygon-0.0.3.tar.gz.

File metadata

File hashes

Hashes for random-points-on-polygon-0.0.3.tar.gz
Algorithm Hash digest
SHA256 05834746a81c5511ddb24ed3055e56364c551ec0d9c0190b7333206a6b6bfe3b
MD5 7619e9f1c43473077a4698f67d33650f
BLAKE2b-256 0d72b4a0d8057ee191ebe51d4bfd1ad1cc3d138fbc1cddd21096686dce467317

See more details on using hashes here.

File details

Details for the file random_points_on_polygon-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for random_points_on_polygon-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e918c9111fc752982bc26e6044f200f5bac636d2fe926761fa4b9e9ba81193bb
MD5 b8b579898c21b67325cb1e6a488a555a
BLAKE2b-256 e4176f4ef69b77c0e1f6d106e1ff7a1ed04dd0edbdfb6598f27816e17b72d74a

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