Skip to main content

GenPlanner python+rust library

Project description

https://img.shields.io/badge/code%20style-black-000000.svg https://img.shields.io/pypi/v/genplanner.svg https://github.com/DDonnyy/GenPlanner-lib/actions/workflows/release.yml/badge.svg https://github.com/DDonnyy/GenPlanner-lib/actions/workflows/docs.yml/badge.svg https://img.shields.io/badge/docs-GitHub%20Pages-blue https://img.shields.io/badge/license-BSD--3--Clause-blue.svg
GenPlanner logo

GenPlanner is a territorial zoning engine for generating spatially consistent territorial zones (and optionally blocks) from polygonal territories.

It combines:

  • ratio-based functional zoning

  • adjacency constraints via relation matrices

  • optional spatial anchor points

  • integration of existing zones

  • road-based splitting

  • MILP-based multi-feature allocation

  • geometric optimization via Voronoi splitting

Installation

pip install genplanner

Quick Example

import geopandas as gpd
from genplanner import GenPlanner
from genplanner.zones import basic_func_zone

territory = gpd.read_file("territory.geojson")

gp = GenPlanner(features_gdf=territory)

zones, roads = gp.features2terr_zones(
    funczone=basic_func_zone
)

Generate blocks:

blocks, roads = gp.features2terr_zones2blocks(
    funczone=basic_func_zone
)

Example with relation constraints

zones, roads = gp.features2terr_zones(
    relation_matrix="default"
)

Example with spatial anchors

from shapely.geometry import Point
from genplanner.zones import default_terr_zones

fix_points = gpd.GeoDataFrame(
    {
        "fixed_zone": [default_terr_zones.residential_terr],
        "geometry": [Point(30.1, 59.9)],
    },
    crs=territory.crs,
)

zones, roads = gp.features2terr_zones(
    terr_zones_fix_points=fix_points
)

Documentation

Full documentation is available at:

https://ddonnyy.github.io/GenPlanner-lib/

Core modules:

  • GenPlanner

  • Zones

  • Zone Relations

  • Errors

Design Philosophy

GenPlanner is built around a small set of composable primitives:

  • Zones define what spatial program should be achieved.

  • Relations define which zones may be adjacent.

  • The planner orchestrates preprocessing, validation and optimization.

  • Errors are explicit and structured.

The goal is deterministic, reproducible zoning with clear constraints and explicit spatial control.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

genplanner-1.0.1-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

genplanner-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

genplanner-1.0.1-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

genplanner-1.0.1-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

genplanner-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

genplanner-1.0.1-cp311-cp311-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file genplanner-1.0.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: genplanner-1.0.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for genplanner-1.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 40dfd010369d99a221aa937e3448044bf57e5a55b495c29a2ee04ad0790b6f25
MD5 6befb7ed66d10f1f98979a41d4eed991
BLAKE2b-256 b2c2b172b203af0c6077b1e92a04904b5094ddb08195b545300c5378f6d79c98

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.1-cp312-cp312-win_amd64.whl:

Publisher: release.yml on DDonnyy/GenPlanner-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genplanner-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for genplanner-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7da37fcc6107850e56ed8a4e8839c7fe46a1267e2b1191fedacbdfdbae7275eb
MD5 214095de02941e3dd2a8b842aff96e7f
BLAKE2b-256 d0445fc6ca76aa79631cc54e80277ffdfa2c02567383e6dd49e109a218c4c1ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on DDonnyy/GenPlanner-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genplanner-1.0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for genplanner-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2b70825fa2e28af6b4ad23dc08b7ad39c7d7563ff8665d821f20fd2946ac5a91
MD5 bb2e414751fb8bfcb2e01ed6abe57814
BLAKE2b-256 d378a42180d6dca35ad0e8c87593cd976473bd35edd9cc815353951f5df84071

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on DDonnyy/GenPlanner-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genplanner-1.0.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: genplanner-1.0.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for genplanner-1.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ae956003107c63458aea3461225bf2c75645133045e728cda5974eda6e1c0f20
MD5 4eb57b9cc7d6bd82db897d8416f440f5
BLAKE2b-256 e0c825548ec4bc9192e735b21e45bc703addd0afbba5c590d9414089bf31e12c

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.1-cp311-cp311-win_amd64.whl:

Publisher: release.yml on DDonnyy/GenPlanner-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genplanner-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for genplanner-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 34eec86d89e314ba251002fb1bb4a3faf29b44240fc10fe4c873bd54e53f0070
MD5 db3d80cbb922228733cb29b9b45b8f1c
BLAKE2b-256 b58cc2511be78cfc6a73958f4816d1a04d4a72f6a6c0225230c583e6fd774a24

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on DDonnyy/GenPlanner-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genplanner-1.0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for genplanner-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2e69b451ddfb7334c0cf6eadf113f57d2bbd298ecbc7948c34922389b04e5bc
MD5 e4d7f395e6a7072edd076d9e89bbd7cf
BLAKE2b-256 21f05ba2f59570db0829c5e5320f221585553c10bac1ff5a9c529f816353991b

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on DDonnyy/GenPlanner-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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