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.0.tar.gz (3.2 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.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tolbi_gis-1.0.0.tar.gz
  • Upload date:
  • Size: 3.2 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.0.tar.gz
Algorithm Hash digest
SHA256 52dc81fcec93b07be36b8486e6ddc714509c684d96c5eee8d9a015798d38dcf2
MD5 e95691429480bf55cef36accb197687c
BLAKE2b-256 e96bf1f6f36ff03c09a17caf164ee42662eb0e600d9c9942bcf53093613c6dfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tolbi_gis-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bf15a855021d7171e63c953bb074445ee532bd197368f07abcc3bd8e8eb6df1
MD5 aed1b5fbe9ca5631fd63bb6b1ab55c23
BLAKE2b-256 4c2b8aec11487cd76ad8e0a49caa096211a1e4c0a522df386b04c6f4c2339957

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