Skip to main content

django-sld

A django library that generates SLD documents from geographic models.

Requirements

  • django Required for models and spatial fields.

  • python-sld Required for reading and generating SLD XML files.

  • pysal Required for classification algorithms.

To install these requirements, you may use pip to install these packages (except for django) with this command:

> sudo pip install -r requirements.txt

Installation

> easy_install django-sld

OR

> pip install django-sld

Usage

This library implements a single module named “generator” that contains all the methods of interacting with the classification algorithms. Assuming that you have a geographic model in geodjango, you may classify your distribution with by constructing a queryset, and feeding it to the generator.

Assuming you have a spatial model named MySpatialModel, with a data field of population, you can classify all your data into 10 quantile classes with:

from djsld import generator

qs = MySpatialModel.objects.all() sld = generator.as_quantiles(qs, ‘population’, 10)

You may also any queryset to generate classes, such as a filtered queryset:

qs = MySpatialModel.objects.filter(owner__name = ‘David’) sld = generator.as_quantiles(qs, ‘population’, 10)

If your spatial model has a different geometry column name other than ‘geom’, you may specify that field as the geofield keyword:

sld = generator.as_quantiles(qs, ‘population’, 10, geofield=’state’)

The data field may also be distantly related to the queryset in question. For this example, assume that MySpatialModel has a foreign key to a model named Route, and that the data value you would like to classify is a field of the Route model:

sld = generater.as_quantiles(qs, ‘route__traffic’, 10)

Support

If you have any problems, questions, or comments, please visit the django-sld project on github: https://github.com/azavea/django-sld/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sld-1.0.6.tar.gz (10.7 kB view details)

Uploaded Source

Built Distributions

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

django_sld-1.0.6-py3.2.egg (18.8 kB view details)

Uploaded Egg

django_sld-1.0.6-py2.7.egg (23.4 kB view details)

Uploaded Egg

django-sld-1.0.6.linux-x86_64.tar.gz (15.1 kB view details)

Uploaded Source

File details

Details for the file django-sld-1.0.6.tar.gz.

File metadata

  • Download URL: django-sld-1.0.6.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-sld-1.0.6.tar.gz
Algorithm Hash digest
SHA256 af846eb3c5b3340dd20515e306488272dd677de913bf63e92f64bec6f921146a
MD5 4b0887f2a9581d657dcb98b637550e94
BLAKE2b-256 7fe99b41c75656dc8ba0e16b3e96d1261939cd7968c2d3d7fb700c01c11ad510

See more details on using hashes here.

File details

Details for the file django_sld-1.0.6-py3.2.egg.

File metadata

File hashes

Hashes for django_sld-1.0.6-py3.2.egg
Algorithm Hash digest
SHA256 0b12478c2c9a561f6576fed70adc95a051b647e8d1a62f9b880d5a36bf7e8ac6
MD5 681ae6fb5e8a40f48687d1b9a247c94a
BLAKE2b-256 6c48e76b4159711a082153de4667d5eefbf34522b9f01a3e757c3aed2d53f451

See more details on using hashes here.

File details

Details for the file django_sld-1.0.6-py2.7.egg.

File metadata

File hashes

Hashes for django_sld-1.0.6-py2.7.egg
Algorithm Hash digest
SHA256 56f81e89690b707927108598040c2ae9bcef20efa9e872f02a28a1e98a9478b5
MD5 26b52efe1f2d96bd9e76239ce0442887
BLAKE2b-256 97520dd196ac13a7d0cf49d97b273b81c4d26c00198b98d2932bf4996c731f03

See more details on using hashes here.

File details

Details for the file django-sld-1.0.6.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for django-sld-1.0.6.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 ba87c904bae9d0494e57467c97b8b01d094e15c058472db5dbeda171199a8976
MD5 4231c7db410a2a10fe88fdc7cdfda1d3
BLAKE2b-256 33d02194608a0abeb722a2e50d72d0df68f50f2bb979a11fc5968edfda8d269a

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