{% load url from future %}

lookup by point

URL:
  • /point/[SRID]/[x],[y]
  • /point/[SRID]/[x],[y]/box
Parameters:

SRID is a unique number referring to a particular co-ordinate system; {% if country == 'GB' %} the ones you probably are interested in are 27700 for British National Grid, 4326 for WGS84 lon/lat, and 29902 for the Irish National Grid. {% else %} the one you probably are interested in is 4326 for WGS84 normal lon/lat. {% endif %}

x and y are the co-ordinates of the point in the co-ordinate system; note that x,y means longitude,latitude.

Optional query parameters:
  • type, to restrict results to a particular area type or types (multiple types separated by commas);
  • generation, to return results for a previous generation.
  • min_generation, to return results since that generation.
Returns:

A hash of the areas that the point is contained within. If the /box version is used, only the area bounding boxes are considered.

Example:
{% if country == 'GB' %}
Example of areas containing (400000,300000).
{% endif %} {% if country == 'NO' %}
Example of areas containing (59,10).
{% endif %} {% if country == 'Global' %}
Example of areas containing (47.366667,8.55).
{% endif %}
{% ifnotequal country 'Global' %}

lookupnearest postcode

URL:
/nearest/[SRID]/[x],[y]
Parameters:
Same as for by point.
Returns:
The postcode closest to the particular point.
Example
{% if country == 'GB' %}
Example of postcode nearest to (400000,300000).
{% endif %} {% if country == 'NO' %}
Example of postcode nearest to (59,10).
{% endif %} {% if country == 'Global' %}
Example of postcode nearest to (47.366667,8.55).
{% endif %}
{% endifnotequal %}