BoundarySet

A BoundarySet is a group of geographic regions, like districts or wards.

/boundary-sets
Get metadata for all BoundarySets.
/boundary-sets/{{boundaryset.slug|urlencode}}
Get metadata for one BoundarySet, the one named {{boundaryset.slug|urlencode}}.

The metadata fields of a BoundarySet are largely user-supplied strings.

{% for name, field in models.BoundarySet %} {% endfor %}
{{name}} {{field.help_text}} {% if field.null %}(Optional.){% endif %}

Boundary

A Boundary is a single district. It is stored as a MultiPolygon internally, which means the district may be made up of multiple geographically disjoint parts. All coordinates are in the WGS 84 (EPSG:4326) spatial reference system.

/boundaries
Get metadata for all Boundary records, in all BoundarySets.
/boundaries/{{boundaryset.slug|urlencode}}
Get metadata for all Boundary records in a particular BoundarySet, here the {{boundaryset.slug}} BoundarySet.
/boundaries/{{boundaryset.slug|urlencode}}/{{boundary.slug|urlencode}}
Get metadata for a particular Boundary — here the {{boundary.slug}} Boundary in the {{boundaryset.slug}} BoundarySet.
/boundaries/{{boundaryset.slug|urlencode}}/?contains={{boundary.centroid.coords.1|floatformat:-3}},{{boundary.centroid.coords.0|floatformat:-3}}
Find Boundaries that contain a given lat/lng coordiate.
/boundaries/{{boundaryset.slug|urlencode}}/?touches={{boundaryset.slug|urlencode}}/{{boundary.slug|urlencode}}
Find Boundaries in a particular BoundarySet that touch a given Boundary (named by the BoundarySet and Boundary slugs). Leave out the BoundarySet in the path part of the URL (see the intersects example next) to search across all BoundarySets.
/boundaries/?intersects={{boundaryset.slug|urlencode}}/{{boundary.slug|urlencode}}
Find Boundaries across the whole database that intersects a given Boundary (named by the BoundarySet and Boundary slugs). Specify a BoundarySet slug in the path part of the URL (see the touches example above) to search in a particular BoundarySet.
/boundaries/{{boundaryset.slug|urlencode}}/{{boundary.slug|urlencode}}/shape?format=wkt
Get the actual shape of a Boundary — here in WTK format for the {{boundary.slug}} Boundary in the {{boundaryset.slug}} BoundarySet. You will always get back a MultiPolygon. You may also specify format=json or format=kml.
/boundaries/{{boundaryset.slug|urlencode}}/{{boundary.slug|urlencode}}/simple_shape?format=wkt
Same as above but retrieves simplified geometry. The degree of simplification depends on site settings but the default is to eliminate features smaller than 0.0002 of a degree.

The metadata fields of a Boundary are:

{% for name, field in models.Boundary %} {% endfor %}
{{name}} {{field.help_text}} {% if field.null %}(Optional.){% endif %}