overpass-api-ruby 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -4
- data/lib/overpass_api_ruby.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f28fde0a54e7bffb2da747dfa1f87689c177bffc
|
4
|
+
data.tar.gz: 37d9d7dde9b1e1f70620d19f512fd9d3586c58dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa749e20aab41869d30184485ea0d67caa1cd6016e09c2ae5e3d6605a2a96f6a4061bbebaece1f106da9dcd98313975bce511dc38f7bc5fc686d9eacac33b7df
|
7
|
+
data.tar.gz: 8c8e55d5ecb3846ead1ce6c3ed4c5dbe60f50d33a6d1c71ab8ca3022c71da0109048ca74d42939a03c8b21bcc45af2f5d750256052bdba68253b075b5628af74
|
data/README.md
CHANGED
@@ -19,7 +19,8 @@ require 'overpass_api_ruby'
|
|
19
19
|
ba_query = "<union><query type='relation'><has-kv k='route' v='subway'/></query>" <<
|
20
20
|
"</union><union><item/><recurse type='down'/></union>"
|
21
21
|
|
22
|
-
options={:bbox => {:s => -34.705448
|
22
|
+
options={:bbox => {:s => -34.705448, :n => -34.526562,
|
23
|
+
:w => -58.531471, :e => -58.335159},
|
23
24
|
:timeout => 900,
|
24
25
|
:element_limit => 1073741824,
|
25
26
|
:json => true}
|
@@ -32,11 +33,13 @@ Options on instantiation
|
|
32
33
|
------------------------
|
33
34
|
```
|
34
35
|
bbox Hash. Global bounding box.
|
35
|
-
endpoint String.
|
36
|
+
endpoint String.
|
37
|
+
Defaults to http://overpass-api.de/api/interpreter
|
36
38
|
timeout Integer.
|
37
39
|
element_init Integer.
|
38
|
-
json Boolean. API response is in JSON format, so parse to hash
|
39
|
-
parse_nokogiri method.
|
40
|
+
json Boolean. API response is in JSON format, so parse to hash
|
41
|
+
doesn't use the private parse_nokogiri method.
|
42
|
+
Default: false.
|
40
43
|
cache_expiration_time Integer. Default: 7200.
|
41
44
|
```
|
42
45
|
See [Overpass API](http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide)
|
data/lib/overpass_api_ruby.rb
CHANGED
@@ -5,12 +5,12 @@ require 'json'
|
|
5
5
|
require 'nokogiri'
|
6
6
|
|
7
7
|
class OverpassAPI
|
8
|
-
VERSION=0.1
|
8
|
+
VERSION='0.1.1'
|
9
9
|
DEFAULT_ENDPOINT='http://overpass-api.de/api/interpreter?data='
|
10
10
|
|
11
11
|
def initialize(args={})
|
12
12
|
bbox = args[:bbox]
|
13
|
-
bbox(bbox[:s],bbox[:n],bbox[:w],bbox[:e])
|
13
|
+
bbox(bbox[:s],bbox[:n],bbox[:w],bbox[:e]) if bbox
|
14
14
|
|
15
15
|
cache_expiration_time = args[:cache_expiration_time] || 7200
|
16
16
|
@cache = Diskcached.new('/tmp/cache',cache_expiration_time,true)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overpass-api-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Salerno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpi
|