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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

genplanner-1.0.2-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.2-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.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: genplanner-1.0.2-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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 799c0c97bcaa71db91ede51ec5e9d89a8d641b32f968406f19c90dee53ac9fb0
MD5 473580b2f05bdc9a64f8733a98dfc22c
BLAKE2b-256 405037c4d2eb5eb2497d586f41b0c57c2fe41b362b70d7db77b078342af32e3c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for genplanner-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 861d9de10d2686a988700b4d6d43ab628ce94a4ba50b4096eb4047c9367103d8
MD5 39e3d5edbb752df977e1f5b031d6c9d2
BLAKE2b-256 95658d58a63f9a29d6b8a8ca2074ee065010dd9388fb1a0afd5a85fa6d16b02c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for genplanner-1.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8981e9cc6c09a980c847efc9ef265807fc5bd8e7af0fec46812ead680eb7a2f9
MD5 54fa33611272af239b5c9789a25e7417
BLAKE2b-256 b89b2e2babddf50265a4831f777cb3162e47df07282c75cabf0b7a0f09001b8f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: genplanner-1.0.2-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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 42c5f69c8d12f3c64064680cd81afd719f6b25a0f885931fc547fd4a028d891d
MD5 51c5c38768e078a1d9c87d9f30da53f3
BLAKE2b-256 d82a199c336b49abfe951b13c42cff5cb89d49f56366fc280c1496d864e02a71

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for genplanner-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b52ae7e75de4f72266e794dc73c657fa86abd602a2e9ed8cc98245b278d1121e
MD5 21df7fe4cb5712efe0007fd0760db7db
BLAKE2b-256 d4a51d50e327ae9eaef80fbfb7b38077868d6ebb5df96a26a7add7dce12102c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for genplanner-1.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9dfa8f5fad1649ccd8d6e6b612ac246ef95cf56edc4f34177072ccd48f66e115
MD5 1565598fb9f62b054de216174a0a5548
BLAKE2b-256 6387018c6ae8e23f603dc203eeb9da92cadc0c055908ebd0ab8e735294940eec

See more details on using hashes here.

Provenance

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