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://your-docs-url-here

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

genplanner-1.0.0-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.0-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.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: genplanner-1.0.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dd6d9857538f536fe67612f07ac041ed06d54f1a0cd3643f74057b62533f3deb
MD5 4ecbd150adcad57ab6128adc433891af
BLAKE2b-256 e88493cd7db5e959966f224d0906b080d082c4603507f88b60a7b67379b0e64e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for genplanner-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7dd401fec32685cbc980ec49499fb4b167d5bcd317d1e1bb8453c6dd7b2b1c7d
MD5 ee08efe2c7837b5aae1c003492c78992
BLAKE2b-256 b025418a553b0aacb09f0aeb25d4fa9672f4819d4a8df7f32583c9df80742a18

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for genplanner-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d9c0e141a08a080e7fa2c3b823ad646619cb44607939f7f855b3b717d7df2e1
MD5 b3fecb781366073de2c47417f6b5b9d4
BLAKE2b-256 a67af291dc0aef1c54e1378268c15cf6a8717f1665b8a033bdcbedb028d4c5cc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: genplanner-1.0.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 29b1e46fc1e885b061e451f200cf29bfc010887b3cdfa4099cf15d40df309dd8
MD5 5c65bdc565a6b26541c4d61436f5baf2
BLAKE2b-256 76ea1dc775ad787fa5091ab95d2cca15d75d59804a12fd20eac629797564e7d6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for genplanner-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9018a2ef8ae661a2bf77babf93a9e8ecbcd0f552f9c210b85d2c2c48043cba9a
MD5 c535ea387b311c1621736a6d349c9ba7
BLAKE2b-256 1126ab3b6aa6cfba4487ce150e9ec8ce3962cc0d835c98ea2422c2d8e60554ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for genplanner-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b44cde42de96d68dcdfdadc4a589e364a0792856071c0b7b9e642c481b68dd79
MD5 ed5e699c493fa4d9994beaeae877dce6
BLAKE2b-256 6d4ccabc18bfa44edf0b699e33ba0b835b6034895948ebcdb0acb7b2e9dcd502

See more details on using hashes here.

Provenance

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