/
index.html
244 lines (206 loc) · 10.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
{% extends "mapit/base.html" %}
{% load url from future %}
{% load static from staticfiles %}
{% block fulltitle %}
MapIt : map postcodes and geographical points to administrative areas
{% endblock %}
{% block content %}
<!-- Main header -->
<header class="header homepage">
{% if country == 'GB' %}
<a class="mapit-cross-sell global" href="http://global.mapit.mysociety.org/">
<img src="{% static "mapit/img/global-cross_sell.png" %}" alt="Now Available: MapIt Global" width="146" height="32">
</a>
{% else %}
<a class="mapit-cross-sell uk" href="http://mapit.mysociety.org/">
<img src="{% static "mapit/img/uk-cross_sell.png" %}" alt="also Available MapIt UK">
</a>
{% endif %}
<h1>Map<em>It</em><em class="mapit-type">: {% include "mapit/country.html" %}</em></h1>
<p>
{% if country == 'GB' %}
MapIt is a service that maps UK postcodes and geographical points to
administrative areas. It’s useful for anyone who has a postcode or
co-ordinates of a point in the UK, and needs to find out what region,
constituency, or council it lies within. It’s also great for looking up
the shapes of all those boundaries.
{% endif %}
{% if country == 'NO' %}
MapIt is a service that maps postcodes and geographical points to
administrative areas. It’s useful for anyone who has a postcode or
co-ordinates of a point in Norway, and needs to find out what fylke,
kommune, or more it lies within. It’s also great for looking up
the shapes of all those boundaries.
{% endif %}
{% if country == 'ZA' %}
MapIt is a service that maps geographical points to
administrative areas. It’s useful for anyone who has
co-ordinates of a point in South Africa, and needs to find out what
Ward, Municipality and Province it lies within. It’s also great for
looking up the shapes of all those boundaries.
{% endif %}
{% if country == 'Global' %}
MapIt is a service that maps geographical points to administrative areas.
This edition is based on source data from the totally amazing
<a href="http://www.openstreetmap.org/">OpenStreetMap</a> project,
so add your boundaries there if they’re missing.
If you’re in the UK our <a href="http://mapit.mysociety.org/">MapIt UK</a>
with open Ordnance Survey data will probably be more useful.
</p><p>
MapIt is useful for anyone who has the co-ordinates of a point on Earth, and
who needs to find out what country, region, city, constituency, or state it
lies within. It’s also great for looking up the shapes of all those
boundaries.
{% endif %}
</p>
<p>Charitable, low volume use of this service is free –
<a href="/licensing">read more</a>.<br>You can
<a href="https://github.com/mysociety/mapit">download the source
on Github</a>.<br>Need a licence?
<a href="/licensing">Read more</a> or
<a href="mailto:enquiries@mysociety.org">get in touch</a>.</p>
{% if country == 'NO' %}
<p id="donate">NUUG is a member organisation for people interested in free
software, open standards and UNIX-like operating systems. Please
<a href="http://www.nuug.no/innmelding.shtml">become a member</a> if you want
to keep NUUG going.
{% endif %}
</header>
<!-- Try out MapIt postcode bar -->
<div id="try-mapit">
<form method="post" action="{% url "mapit_index" %}{% if postcodes_available %}postcode{% else %}point{% endif %}/">
<label for="try-mapit-pc">
{% if postcodes_available %}Try it out, enter a postcode:
{% else %}Try it out, enter a lat,lon:{% endif %}
</label>
<input type="text" name="pc" id="try-mapit-pc"{% if not postcodes_available %} placeholder="latitude,longitude"{% endif %}>
<input class="btn" type="submit" value="Look up">
</form>
</div>
<article id="api-docs">
<header>
<h2>MapIt API</h2>
<nav class="toc">
<p>Lookups</p>
<ol>
{% if postcodes_available %}
<li><a href="#api-by_postcode">Postcode</a></li>
<li><a href="#api-by_partial_postcode">Partial postcode</a></li>
{% endif %}
<li><a href="#api-by_point">Point</a></li>
{% if postcodes_available %}
<li><a href="#api-nearest">Nearest postcode</a></li>
{% endif %}
<li><a href="#api-by_area_id">Area</a></li>
<li><a href="#api-related_areas">Related areas</a></li>
<li><a href="#api-multiple_areas">Multiple areas</a></li>
<li><a href="#api-generations">Generations</a></li>
</ol>
<p>Information</p>
<ul>
<li><a href="#general">General information</a></li>
<li><a href="#about-mapit">About MapIt</a></li>
<li><a href="#usage-licence">Usage & licence</a></li>
<li><a href="https://github.com/mysociety/mapit">Source code</a></li>
{% if country == 'GB' %}
<li><a href="{% url 'mapit_changelog' %}">Changelog</a></li>
{% endif %}
</ul>
</nav>
</header>
{% include "mapit/api/intro.html" %}
{% if postcodes_available %}
{% include "mapit/api/postcode.html" %}
{% endif %}
{% include "mapit/api/point.html" %}
{% include "mapit/api/area.html" %}
{% include "mapit/api/areas.html" %}
{% include "mapit/api/generations.html" %}
<section id="general">
<h3>General information</h3>
<dl>
<dt>Format</dt>
<dd>
<p>All calls return JSON, you can generally get an HTML representation
by sticking .html on the end.</p>
<p>Whenever an area is returned from MapIt, it is as a
dictionary with the following keys: id, name, country, type,
parent_area, generation_low, generation_high, codes.</p>
</dd>
<dt>Historical areas</dt>
<dd>By default, calls will return active areas; for some calls
you may specify a previous generation to look up instead.
{% if country == 'GB' %}
The
main difference in generation 12 is that it contains the
pre-2010 England and Wales Parliamentary constituencies;
generation 14 contains the pre-2011 Scottish Parliament
constituencies. Only current Northern Ireland constituencies
are present; if you need pre-2010 UK Parliament NI
constituencies, or pre-2011 Northern Ireland Assembly
constituencies, you can work it out from the wards and the 2003
SNAC file in the data/ directory.
{% endif %}
</dd>
{% if country == 'GB' %}
<dt>Technical queries</dt>
<dd>If you have any technical queries with the API, please
contact us at <a href="mailto:mapit@mysociety.org">mapit@mysociety.org</a>.
{% endif %}
</dl>
</section>
<section id="about-mapit">
<h3>About MapIt</h3>
<p>MapIt was written back in 2003 as a postcode lookup to power the
original <a href="http://www.mysociety.org/">mySociety</a> sites
such as <a href="http://www.writetothem.com/">WriteToThem</a>. Over
time it gained features such as point lookup (for
<a href="http://www.fixmystreet.com/">FixMyStreet</a>), and when
Ordnance Survey data became freely available in 2010, it was
rewritten and made public for the whole UK.
{% if country == 'GB' %}
Versions have appeared in other countries, such as
<a href="http://mapit.nuug.no/">Norway</a>, and in 2012 we released a
<a href="http://global.mapit.mysociety.org/">global version</a> based on OpenStreetMap data.
{% endif %}{% if country == 'NO' %}
Versions have appeared in other countries, such as
this one in Norway, and in 2012 we released a
<a href="http://global.mapit.mysociety.org/">global version</a> based on OpenStreetMap data.
{% endif %}{% if country == 'Global' %}
Versions have appeared in other countries, such as
<a href="http://mapit.nuug.no/">Norway</a>, and in 2012 we released this
global version based on OpenStreetMap data.
{% endif %}
</p>
</section>
<section id="usage-licence">
<h3>Usage & Licence</h3>
{% if country != 'NO' %}
<p>As a UK registered charity our legal status only allows this
service to be used free of charge by other registered charities, or
individuals working unpaid on non-profit projects. The free usage
limit for non-profit users is 50,000 calls to the API per year. All
other uses need to acquire a licence.</p>
<p><a href="/licensing">Find out if you need a licence</a> or <a
href="mailto:enquiries@mysociety.org">get in touch</a> so we
can discuss how we can provide you with the service you require.</p>
<p>To maintain quality of service for our own websites, as well as our
API users, this service is rate limited to an average of 1 call per
second in a rolling 3 minute period.</p>
<p>If you use this service, you must attribute
{% if country == 'GB' %}
OS/RM/ONS
{% elif country == 'ZA' %}
Municipal Demarcation Board (www.demarcation.org.za)
{% else %}
OpenStreetMap
{% endif %}
as
per their licences. We also ask that all non-profit users attribute
MapIt at the point of use on sites or apps. Attribution should use
the text “Powered by MapIt”, with a link back to this page.
{% endif %}
</p>
</section>
</article>
{% endblock %}