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-Non--Commercial-red.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.

License

This project is licensed under a Proprietary Non-Commercial License.

Russian version available in LICENSE_RU.txt.

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.3-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

genplanner-1.0.3-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.3-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

genplanner-1.0.3-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.3-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.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: genplanner-1.0.3-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.12

File hashes

Hashes for genplanner-1.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 74d8e2a27c986690e38e882825c60bf5c6028bed7e787caadfb80a38b335be84
MD5 ea6188a2aa15ec44d246ebc46a607985
BLAKE2b-256 603684ae48b593c4670b7a6dfb3936a5bbd47e4834ebec22864d5169c9528fc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.3-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.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for genplanner-1.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d6207518f150dc45d1da6d0b2e46f575fc046cf411642cad529823b5407efcb
MD5 df1cbcfc8017b21d5618472dc3d2e1d3
BLAKE2b-256 6d3b203e4702740e5f63227a5c072e2d552eb50179f9884a66088e4e561ab2ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.3-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.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for genplanner-1.0.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9503993894a4f50c5833e283354571480ddfd10f8a97c500bc12250f539baaa
MD5 9194d558994c60fcbe0e0615a228e408
BLAKE2b-256 1bae5e184fb73373092c3a7b9fb6f8baa93d4a7873d456718ec9dfee8dd38979

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.3-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.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: genplanner-1.0.3-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.12

File hashes

Hashes for genplanner-1.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d194fffe646a6b33244ff696b78b98817f08293db5ff2eb554e1e9e3fd8887e3
MD5 108b595b26a807dd86f311ac2b6dbd61
BLAKE2b-256 d6dd6a836ab3a1a0d9151f79870f8df222081069a5b1fc7be08a9eb7396dd70c

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.3-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.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for genplanner-1.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 834b52cbaef2d298e2301f82d9bdfa2060c60e1007554a46d1366317ec76194a
MD5 dd9590b283190288564f0fabafb30e4f
BLAKE2b-256 85960a0a7bd6ff6eae37572a813d0cde65f91503de4cf95379342318d37efbb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.3-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.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for genplanner-1.0.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0a00f35e82670bb37a4bab1ce6ed13e7e8c2b90c7a5ceec1f8acd35871972da
MD5 bf9d20334a8344e82d5f550ec4e379cb
BLAKE2b-256 c8327b87383528111ead6320970d8f6cbcf0e120c11048b4aacb76faf70f2f3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for genplanner-1.0.3-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