matryoshka_view 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/lib/matryoshka_view/version.rb +1 -1
- data/lib/matryoshka_view.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: f9abe733adeec7a0d632b300437a8c83682915b6
|
4
|
+
data.tar.gz: 4d8cd1d651217606ac0530d673053eae7ec0ab70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb4f27953d68e3d8017889afa92ea2bb1c8865b0fdfcce5b084b5d70477ea975bf522b532c450446020efc41c45f705c6e534ad0870213478d7bc0197cf25d46
|
7
|
+
data.tar.gz: 05fbc48cbeeb69736d5fdb8f7ef1554b495e144c9b3d9bca7cac3d50ea8716c7055b57ccbea787a7f0988ffb7d6cd290965c1487b4091feb712c507d88d531db
|
data/CHANGELOG
CHANGED
data/lib/matryoshka_view.rb
CHANGED
@@ -47,9 +47,9 @@ class MatryoshkaView
|
|
47
47
|
def lookup(geom_source: nil, the_geom_geojson: nil)
|
48
48
|
# FIXME move to Record class method
|
49
49
|
hit = if geom_source
|
50
|
-
Record.where("
|
50
|
+
Record.where("ST_Expand(the_geom, 0.00001) && (SELECT the_geom FROM #{geom_source.class.quoted_table_name} WHERE id = #{quote(geom_source.id)}) AND ST_Contains(ST_Buffer(the_geom, 0.00001), (SELECT the_geom FROM #{geom_source.class.quoted_table_name} WHERE id = #{quote(geom_source.id)}))").order("ST_Area(the_geom, false) ASC").first
|
51
51
|
elsif the_geom_geojson
|
52
|
-
Record.where("
|
52
|
+
Record.where("ST_Expand(the_geom, 0.00001) && ST_SetSRID(ST_GeomFromGeoJSON(#{quote(the_geom_geojson)}), 4326) AND ST_Contains(ST_Buffer(the_geom, 0.00001), ST_SetSRID(ST_GeomFromGeoJSON(#{quote(the_geom_geojson)}), 4326))").order("ST_Area(the_geom, false) ASC").first
|
53
53
|
else
|
54
54
|
raise "expecting geom_source or the_geom_geojson"
|
55
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matryoshka_view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seamus Abshere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|