GeoJSON tile view for Django
Project description
# Django GeoJSON Tiles
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
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', trim_to_boundary=True))
)
## Notes
1. `trim_to_boundary=True` will result in GeoJSON tiles with geometries trimmed to the tile boundary
1. `properties`=[...] can be used to limit the feature's properties that are serialized
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
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', trim_to_boundary=True))
)
## Notes
1. `trim_to_boundary=True` will result in GeoJSON tiles with geometries trimmed to the tile boundary
1. `properties`=[...] can be used to limit the feature's properties that are serialized
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
Close
Hashes for django-geojson-tiles-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2d7e278bfb9434ae90a6a8931fb5c9b24ef044b19ea3ecc7a9d5d147ca99261 |
|
MD5 | 0d25667eb6e5316154e9ef13cd241d3c |
|
BLAKE2b-256 | b4a3719fef9ecf50e36ff4e234f99e10997d3356c4749e47180c13ac055e3c2f |