spatial_features 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca9589fa4acf1bb8c8d5c4a915891628c298b80c
|
4
|
+
data.tar.gz: b450b7c37ffa34bfd87731493916f3a20210b414
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbdd1f67b29366a08858491b4d8c3c0deaeab2e8feebfd335b07c7d90ca38908b5d750834c9dc46336c038bb77cb2ef60a47405029ad412ddf4c7b87387c583e
|
7
|
+
data.tar.gz: 7c03e44c03b576eec2bd88c5524f3925b7e78579b9d927fa6aa79ead01c7e92425c012a8c63e3f3bd8cacfc1727b69bf9c66908ac3f3c0b9cdb219a5aa6bccbf
|
@@ -13,12 +13,12 @@ module SpatialFeatures
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def tables
|
16
|
-
fusion_tables_service.list_tables.items
|
16
|
+
fusion_tables_service.list_tables(max_results: 10000).items || []
|
17
17
|
end
|
18
18
|
|
19
19
|
def create_table(name, columns = [], table_options = {})
|
20
20
|
table_object = {:name => name, :columns => columns, :is_exportable => true}.merge(table_options)
|
21
|
-
fusion_tables_service.insert_table(table_object, :fields => 'table_id')
|
21
|
+
fusion_tables_service.insert_table(table_object, :fields => 'table_id').table_id
|
22
22
|
end
|
23
23
|
|
24
24
|
def delete_table(table_id)
|
@@ -34,15 +34,15 @@ module SpatialFeatures
|
|
34
34
|
|
35
35
|
def fusion_table_id_cache
|
36
36
|
@fusion_table_id_cache ||= Hash.new {|hash, table_name| hash[table_name] = API.find_or_create_table(table_name) }
|
37
|
-
.
|
37
|
+
.merge(API.tables.collect {|table| [table.name, table.table_id] }.to_h) # Warm the cache
|
38
38
|
end
|
39
39
|
|
40
40
|
private
|
41
41
|
|
42
42
|
def fusion_table_groups(only: [], except: [])
|
43
43
|
groups = all.group_by(&:fusion_table_id)
|
44
|
-
groups.select! {|fusion_table_id| Array.wrap(only).include?(fusion_table_id) } if only.present?
|
45
|
-
groups.select! {|fusion_table_id| !Array.wrap(except).include?(fusion_table_id) } if except.present?
|
44
|
+
groups.select! {|fusion_table_id, _| Array.wrap(only).include?(fusion_table_id) } if only.present?
|
45
|
+
groups.select! {|fusion_table_id, _| !Array.wrap(except).include?(fusion_table_id) } if except.present?
|
46
46
|
groups.each do |fusion_table_id, records|
|
47
47
|
yield fusion_table_id, records, features.where(:spatial_model_id => records)
|
48
48
|
end
|