GeoJSON tile view for Django
Project description
A simple Django view to serve GeoJSON tiles from a GeoDjango model
Description
The view will return a GeoJSON FeatureCollection for each tile. Each feature corresponds to a row of the model.
Setup
pip install django-geojson-tiles
Add the following to your urls.py:
from geojson_tiles.views import GeoJSONTile from your_app import GeometryModel urlpatterns = patterns('', url(r'^your_endpoint/(?P<z>\d+)/(?P<x>\d+)/(?P<y>\d+).json$', GeoJSONTile(GeometryModel, geometry_field='geometry_field', trim_to_boundary=True)) )
Notes
geometry_field='geometry_field' specifies the geometry to use in the feature. If no geometry_field is specified: the first GeometryField in the model’s field set is used.
trim_to_boundary=True will result in GeoJSON tiles with geometries trimmed to the tile boundary
properties=[...] can be used to limit the feature’s properties that are serialized
properties={'field_name': 'property name'} will limit the feature’s properties and map field names (keys) to property names (values).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-geojson-tiles-0.0.9.tar.gz
.
File metadata
- Download URL: django-geojson-tiles-0.0.9.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c914082c0ea17d8d84233e4f5ab9da6b12afd524a469f7e7942e6276c1c342de |
|
MD5 | fdaaa42789c34f6d501b109d4052abb6 |
|
BLAKE2b-256 | 5e4829d10f0e193f3901f9a742f791b548a86c54016a2ee68bf55772a1ad63a8 |