georeferencer 0.1.3 → 0.1.4
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c36acb7c922b9cdde371dcd61b912997564086240eedcb9d1424760ce6411ab
|
4
|
+
data.tar.gz: c936576f11136ba034ee89c579927616ec3a39f9302220d1254c46d8832edac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bde55a400962aa06bf64b1c0e1a2177ceeb540f04f8b6883a22c16a2c87ce257a7a635b0c1c8e633275844bd3942b1245057c041eb15344f5c4283961f97a03
|
7
|
+
data.tar.gz: f55550f2005005905e6ca2249291c22520daad23fb33e6491d6ffb479517b59edcf891657929f73ec2f3320f37fa34c7fe9183e9a500d68e28d3f3be9a8bf66e
|
@@ -4,9 +4,11 @@ module Georeferencer
|
|
4
4
|
# Add custom UA String
|
5
5
|
env[:request_headers]["User-Agent"] = Georeferencer.configuration.user_agent
|
6
6
|
|
7
|
+
query = Faraday::Utils.parse_query(env.url.query) || {}
|
8
|
+
query["format"] = 'json'
|
7
9
|
|
8
10
|
# Fix url-encoded percent signs
|
9
|
-
env.url.query =
|
11
|
+
env.url.query = Faraday::Utils.build_query(query).gsub(/%25/,'%')
|
10
12
|
|
11
13
|
@app.call(env)
|
12
14
|
end
|
@@ -6,10 +6,6 @@ module Georeferencer
|
|
6
6
|
collection_path "display"
|
7
7
|
resource_path "maps/:id"
|
8
8
|
|
9
|
-
default_scope -> {
|
10
|
-
where(format: 'json')
|
11
|
-
}
|
12
|
-
|
13
9
|
scope :unreferenced, -> {
|
14
10
|
where(state: 'waiting')
|
15
11
|
}
|
@@ -17,17 +13,14 @@ module Georeferencer
|
|
17
13
|
def centroid
|
18
14
|
# Data from the collection endpoint doesn't include the bounding box, so we need to check we have the full data,
|
19
15
|
# or reload (which hits the resource endpoint) if not
|
20
|
-
|
21
|
-
|
22
|
-
else
|
23
|
-
(wlng, slat, elng, nlat) = reload.bbox
|
24
|
-
end
|
16
|
+
(wlng, slat, elng, nlat) = respond_to?(:bbox) ? bbox : reload.bbox
|
17
|
+
|
25
18
|
{lat: (slat+nlat)/2, lng: (wlng+elng)/2}
|
26
19
|
end
|
27
20
|
|
28
21
|
def url(width=200,height=nil)
|
29
22
|
[image[:url],'full',"#{width},#{height}",0,'default.jpg'].join("/")
|
30
|
-
|
31
23
|
end
|
24
|
+
|
32
25
|
end
|
33
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: georeferencer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Jones
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-03-
|
12
|
+
date: 2019-03-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|