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.3.tar.gz (3.5 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.3-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tolbi_gis-1.0.3.tar.gz
  • Upload date:
  • Size: 3.5 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.3.tar.gz
Algorithm Hash digest
SHA256 c78d7a11773b252e59d1dd3d3d52b5cc73a91b6d2f71617426391049328f9877
MD5 da5522b9a654e466b1827e3631b89038
BLAKE2b-256 dab425d03d1dabb8d7715dedeb20d7c944424b884769545b43fffb57902e1efe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tolbi_gis-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6092a35e72a30b229deab36389cfa2ffff80cfe27ea88ac684d875e4777eb761
MD5 71c4b1e0fe549ca10d2f0970aada1b38
BLAKE2b-256 9372d4c44e71ad58af6063a4a13474dea8310d1cff8251e14d059f4b134f7148

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