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.5.tar.gz (10.5 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.5-py2.7.egg (21.6 kB view details)

Uploaded Egg

django_sld-1.0.5-py2.6.egg (21.6 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for django-sld-1.0.5.tar.gz
Algorithm Hash digest
SHA256 1e73bedf8475dfce2873909d1a80db9c84ac940a4f0ec451772dc83168bee5cf
MD5 473494a391ef7ddc2213dcaa7b3466a6
BLAKE2b-256 263a92b499393a02e26f01cab81cfa32c03cfa048f7f1c066491fdc7bbc9ed1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_sld-1.0.5-py2.7.egg
  • Upload date:
  • Size: 21.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django_sld-1.0.5-py2.7.egg
Algorithm Hash digest
SHA256 d9944f6679e191768fc354de81c0dc9f50427a327f5f5c918737facfd4227af6
MD5 6b96673914f62d5453f0abdeda7efa9a
BLAKE2b-256 1802428f275ea62a39505857a8c6981c8fbd01539ef1ed7864468271b6339fb8

See more details on using hashes here.

File details

Details for the file django_sld-1.0.5-py2.6.egg.

File metadata

  • Download URL: django_sld-1.0.5-py2.6.egg
  • Upload date:
  • Size: 21.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django_sld-1.0.5-py2.6.egg
Algorithm Hash digest
SHA256 899a565059db55a580502c97d113817e0efa8649c36c348d3b961f3733830ec7
MD5 0d1a3e9c005b630ae44ae3e5171be277
BLAKE2b-256 15a623d755fcfc1ea7816452c52be243a310aac33db59e0fb1a8437205c0d176

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