matryoshka_view 0.2.1 → 0.2.2
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.rb +2 -2
- data/lib/matryoshka_view/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 476ae7b97b8e58275a75bf20579bd1b4ccfc2dfb
|
4
|
+
data.tar.gz: cebc94aadd756d91487a6dac9a876ab8f7b4689c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3626af9dc3a4925a637770f4f5de89c0c6b2523ff667cea8d1bcd196b0428e742864fca5a4ca88c519678ecc27a13deae1f630e426a9394f2c2900913848a8d7
|
7
|
+
data.tar.gz: 7991ff9f1db8b738d5ee2274e7c0d4d85e2b9228a699b9dda9362b2173bc1865cb01390bb7c4078822aa00156dedd86cb23cb28e01cfcebfc08e6f0d66286a6f
|
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("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
|
50
|
+
Record.where("ST_Contains(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("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
|
52
|
+
Record.where("ST_Contains(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
|