pat 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +38 -32
- data/VERSION +1 -1
- data/pat.gemspec +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,55 +1,61 @@
|
|
1
|
-
=
|
1
|
+
= Pat
|
2
2
|
|
3
|
-
|
3
|
+
An extremely simple, lightweight way of requesting the Geolocation (lat, long, easting, northing) for any UK Postcode, as well as district and ward details.
|
4
4
|
|
5
|
-
|
5
|
+
= Get information on a UK postcode
|
6
6
|
|
7
|
-
|
7
|
+
Requirements
|
8
8
|
|
9
|
-
|
9
|
+
* Ruby
|
10
|
+
* Rubygems
|
10
11
|
|
11
|
-
|
12
|
+
Install the gem
|
12
13
|
|
13
|
-
|
14
|
+
sudo gem sources -a http://gemcutter.org
|
15
|
+
sudo gem install pat
|
14
16
|
|
15
|
-
|
17
|
+
Include the gem in your project
|
16
18
|
|
17
|
-
|
19
|
+
require 'pat'
|
18
20
|
|
19
|
-
|
21
|
+
Request a postcode
|
20
22
|
|
21
|
-
|
23
|
+
@postcode = Pat.get("N1 1AA")
|
22
24
|
|
23
|
-
|
25
|
+
Use the results (returned as a hash)
|
24
26
|
|
25
|
-
puts @postcode["geo"]["
|
27
|
+
puts @postcode["geo"]["lat"]
|
28
|
+
puts @postcode["geo"]["lng"]
|
29
|
+
puts @postcode["geo"]["easting"]
|
30
|
+
puts @postcode["geo"]["northing"]
|
31
|
+
puts @postcode["geo"]["geohash"]
|
32
|
+
puts @postcode["administrative"]
|
33
|
+
puts @postcode["administrative"]["district"]
|
34
|
+
puts @postcode["administrative"]["district"]["title"]
|
35
|
+
puts @postcode["administrative"]["district"]["uri"]
|
36
|
+
puts @postcode["administrative"]["ward"]
|
37
|
+
puts @postcode["administrative"]["ward"]["title"]
|
38
|
+
puts @postcode["administrative"]["ward"]["uri"]
|
39
|
+
puts @postcode["postcode"]
|
26
40
|
|
27
|
-
|
41
|
+
== Try it out
|
28
42
|
|
29
|
-
|
43
|
+
irb -r rubygems -r pat
|
30
44
|
|
31
|
-
|
45
|
+
p = Pat.get("<your postcode here>")
|
32
46
|
|
33
|
-
|
47
|
+
p["geo"]
|
34
48
|
|
35
|
-
|
49
|
+
p["administrative"]
|
36
50
|
|
37
|
-
|
51
|
+
== Thanks to
|
38
52
|
|
39
|
-
|
53
|
+
* UK-Postcodes by Pezholio http://github.com/pezholio/UK-Postcodes
|
54
|
+
* Timely Information Project by Dave Harte: http://daveharte.com
|
55
|
+
* Adrian Short for the idea http://twitter.com/adrianshort
|
40
56
|
|
41
|
-
|
42
|
-
|
43
|
-
puts @postcode["postcode"]
|
44
|
-
|
45
|
-
|
46
|
-
# Try it out
|
47
|
-
|
48
|
-
irb -r rubygems -r pat
|
49
|
-
|
50
|
-
p = Pat.get(<your postcode>)
|
51
|
-
p["geo"]
|
52
|
-
p[""]
|
57
|
+
* Ordance Survey for seeing the light and making UK Postcode data available
|
58
|
+
http://www.ordnancesurvey.co.uk/oswebsite/opendata/
|
53
59
|
|
54
60
|
== Note on Patches/Pull Requests
|
55
61
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/pat.gemspec
CHANGED