Skip to main content

A Django middleware to explode GeoJSON files in requests.

Project description

Django GeoJSON Explode Middleware

A Django middleware that automatically explodes GeoJSON geometries in POST requests.

Installation

pip install tolbi-gis

Usage

  1. Add the middleware to your settings.py:

    MIDDLEWARE = [
        # ... other middleware ...
        'tolbi.middleware.GeoExplodeMiddleware',
        # ... other middleware ...
    ]
    
  2. Send GeoJSON data in your POST requests:

    The middleware will process POST requests content-type: multipart/form-data.

What it does

This middleware intercepts incoming POST requests and checks for GeoJSON file (.geojson). If found, it uses GeoPandas to "explode" multi-part geometries (e.g., MultiPolygon, MultiLineString) into individual geometries. The exploded GeoJSON is then made available in the request data, simplifying the processing of complex geospatial data in your Django views.

Dependencies

  • Django (>= 3.2)
  • geopandas

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT License

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

tolbi_gis-1.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

tolbi_gis-1.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file tolbi_gis-1.0.1.tar.gz.

File metadata

  • Download URL: tolbi_gis-1.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for tolbi_gis-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9c0ac672c9519437a4bf6bc820c5a963e4c15f1ad96bc3146bd24462c8ff1c51
MD5 c16e47a52e209dae83169c569057465a
BLAKE2b-256 4a2db1a05d1bf350e0bc6fa1aed0814b3c9577a5129cd94d5b35127522d1b8db

See more details on using hashes here.

File details

Details for the file tolbi_gis-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: tolbi_gis-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for tolbi_gis-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 899eb7b4ee21dec2f99c4019ea6a412e88e07c63a391eb946ccc13e7ae272b19
MD5 a03350b94b37f8329770c659f0501ede
BLAKE2b-256 f708ed8419133d8fa237fe3e436b4564040eb351f6d4993a0c539a83c777acff

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