cartocss_helper 1.2.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/cartocss_helper.rb +56 -71
- data/lib/cartocss_helper/configuration.rb +84 -37
- data/lib/cartocss_helper/data_file_handling.rb +32 -35
- data/lib/cartocss_helper/git.rb +17 -27
- data/lib/cartocss_helper/heuristic.rb +39 -41
- data/lib/cartocss_helper/image_generator.rb +36 -38
- data/lib/cartocss_helper/notes_downloader.rb +46 -0
- data/lib/cartocss_helper/overpass_downloader.rb +42 -0
- data/lib/cartocss_helper/overpass_query_generator.rb +248 -0
- data/lib/cartocss_helper/renderer_handler.rb +116 -0
- data/lib/cartocss_helper/style_specific/default_osm_style.rb +722 -546
- data/lib/cartocss_helper/style_specific/style_specific.rb +4 -3
- data/lib/cartocss_helper/tag_lister.rb +136 -112
- data/lib/cartocss_helper/util/filehelper.rb +1 -1
- data/lib/cartocss_helper/util/generic_cached_downloader.rb +49 -0
- data/lib/cartocss_helper/util/generic_downloader.rb +65 -0
- data/lib/cartocss_helper/util/logger.rb +30 -0
- data/lib/cartocss_helper/util/rest-client_wrapper.rb +53 -0
- data/lib/cartocss_helper/util/systemhelper.rb +55 -0
- data/lib/cartocss_helper/validator.rb +142 -81
- data/lib/cartocss_helper/visualise_changes_diff_from_images.rb +36 -34
- data/lib/cartocss_helper/visualise_changes_image_generation.rb +72 -100
- data/lib/data/testing_locations.rb +17 -15
- data/readme.md +34 -9
- metadata +140 -39
- data/lib/cartocss_helper/downloader.rb +0 -301
- data/lib/cartocss_helper/tilemill_handler.rb +0 -38
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative 'visualise_changes_diff_from_images'
|
2
2
|
require_relative 'git'
|
3
|
-
require_relative '
|
3
|
+
require_relative 'renderer_handler'
|
4
|
+
require_relative 'overpass_query_generator'
|
4
5
|
require_relative 'util/filehelper'
|
5
6
|
|
6
7
|
module CartoCSSHelper
|
@@ -9,9 +10,9 @@ module CartoCSSHelper
|
|
9
10
|
@@jobs = []
|
10
11
|
|
11
12
|
def self.enable_job_pooling
|
12
|
-
#it results in avoiding loading the same database mutiple times
|
13
|
-
#useful if the same database will be used multiple times (for example the same place in multiple comparisons)
|
14
|
-
#use run_jobs function to run jobs
|
13
|
+
# it results in avoiding loading the same database mutiple times
|
14
|
+
# useful if the same database will be used multiple times (for example the same place in multiple comparisons)
|
15
|
+
# use run_jobs function to run jobs
|
15
16
|
@@job_pooling = true
|
16
17
|
end
|
17
18
|
|
@@ -20,28 +21,23 @@ module CartoCSSHelper
|
|
20
21
|
end
|
21
22
|
|
22
23
|
class MapGenerationJob
|
23
|
-
attr_reader :filename
|
24
|
+
attr_reader :filename
|
24
25
|
def initialize(filename, latitude, longitude, zlevels, header, new_branch, old_branch, download_bbox_size, image_size)
|
25
|
-
@filename = filename
|
26
26
|
@latitude = latitude
|
27
27
|
@longitude = longitude
|
28
28
|
@zlevels = zlevels
|
29
29
|
@header = header
|
30
30
|
@old_branch = old_branch
|
31
31
|
@new_branch = new_branch
|
32
|
-
@download_bbox_size = download_bbox_size
|
33
32
|
@image_size = image_size
|
34
|
-
@
|
33
|
+
@filename = filename
|
34
|
+
@data_source = CartoCSSHelper::VisualDiff::FileDataSource.new(@latitude, @longitude, download_bbox_size, @filename)
|
35
35
|
end
|
36
|
+
|
36
37
|
def run_job
|
37
|
-
|
38
|
-
return
|
39
|
-
end
|
40
|
-
print
|
41
|
-
source = CartoCSSHelper::VisualDiff::FileDataSource.new(@latitude, @longitude, @download_bbox_size, @filename)
|
42
|
-
CartoCSSHelper::VisualDiff.visualise_changes_for_given_source(@latitude, @longitude, @zlevels, @header, @new_branch, @old_branch, @image_size, source)
|
43
|
-
@active = false
|
38
|
+
CartoCSSHelper::VisualDiff.visualise_for_given_source(@latitude, @longitude, @zlevels, @header, @new_branch, @old_branch, @image_size, @data_source)
|
44
39
|
end
|
40
|
+
|
45
41
|
def print
|
46
42
|
puts "#{@filename.gsub(Configuration.get_path_to_folder_for_cache, '#')} [#{@latitude};#{@longitude}], z: #{@zlevels}, text: #{@header}, '#{@old_branch}'->'#{@new_branch}', bbox:#{@download_bbox_size}, #{@image_size}px"
|
47
43
|
end
|
@@ -52,45 +48,48 @@ module CartoCSSHelper
|
|
52
48
|
new_job = MapGenerationJob.new(filename, latitude, longitude, zlevels, header, new_branch, old_branch, download_bbox_size, image_size)
|
53
49
|
new_job.print
|
54
50
|
|
55
|
-
raise "#{filename} does not exists" unless File.
|
56
|
-
raise "#{latitude} is not a number" unless latitude.
|
57
|
-
raise "#{longitude} is not a number" unless longitude.
|
51
|
+
raise "#{filename} does not exists" unless File.exist?(filename)
|
52
|
+
raise "#{latitude} is not a number" unless latitude.is_a? Numeric
|
53
|
+
raise "#{longitude} is not a number" unless longitude.is_a? Numeric
|
58
54
|
raise "#{zlevels} is not a range" unless zlevels.class == Range
|
59
55
|
raise "#{header} is not a string" unless header.class == String
|
60
56
|
raise "#{new_branch} is not a string" unless new_branch.class == String
|
61
57
|
raise "#{old_branch} is not a string" unless old_branch.class == String
|
62
|
-
raise "#{download_bbox_size} is not a number" unless download_bbox_size.
|
63
|
-
raise "#{image_size} is not a integer" unless image_size.
|
58
|
+
raise "#{download_bbox_size} is not a number" unless download_bbox_size.is_a? Numeric
|
59
|
+
raise "#{image_size} is not a integer" unless image_size.is_a? Integer
|
64
60
|
|
65
61
|
@@jobs.push(new_job)
|
66
62
|
end
|
67
63
|
|
68
64
|
def self.run_jobs
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
65
|
+
new_job_array = []
|
66
|
+
return if @@jobs == []
|
67
|
+
@@jobs[0].run_job
|
68
|
+
for x in 1..@@jobs.length - 1
|
69
|
+
if @@jobs[0].filename == @@jobs[x].filename
|
70
|
+
# requires loading the same file as just run job
|
71
|
+
# it may be safely run without reloading database
|
72
|
+
@@jobs[x].run_job
|
73
|
+
else
|
74
|
+
new_job_array << @@jobs[x].filename
|
77
75
|
end
|
78
76
|
end
|
79
|
-
@@jobs =
|
77
|
+
@@jobs = new_job_array
|
80
78
|
end
|
81
79
|
|
82
80
|
def self.shuffle_jobs(seed)
|
83
81
|
@@jobs.shuffle!(random: Random.new(seed))
|
84
82
|
end
|
85
83
|
|
86
|
-
def self.
|
87
|
-
tags = VisualDiff.remove_magic_from_tags(tags)
|
84
|
+
def self.make_header(tags, type, on_water)
|
88
85
|
on_water_string = ''
|
89
|
-
if on_water
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
86
|
+
on_water_string = ' on water' if on_water
|
87
|
+
return "#{VisualDiff.tag_dict_to_string(tags)} #{type}#{on_water_string}"
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.visualise_on_synthethic_data(tags, type, on_water, zlevel_range, new_branch, old_branch)
|
91
|
+
header = make_header(tags, type, on_water)
|
92
|
+
puts "visualise_on_synthethic_data <#{header}> #{old_branch} -> #{new_branch}"
|
94
93
|
Git.checkout(old_branch)
|
95
94
|
old = VisualDiff.collect_images_for_synthethic_test(tags, type, on_water, zlevel_range)
|
96
95
|
Git.checkout(new_branch)
|
@@ -98,23 +97,12 @@ module CartoCSSHelper
|
|
98
97
|
VisualDiff.pack_image_sets old, new, header, new_branch, old_branch, 200
|
99
98
|
end
|
100
99
|
|
101
|
-
def self.remove_magic_from_tags(tags)
|
102
|
-
magicless_tags = Hash.new
|
103
|
-
tags.each {|key, value|
|
104
|
-
if value == :any
|
105
|
-
value = 'any tag value'
|
106
|
-
end
|
107
|
-
magicless_tags[key]=value
|
108
|
-
}
|
109
|
-
return magicless_tags
|
110
|
-
end
|
111
|
-
|
112
100
|
def self.collect_images_for_synthethic_test(tags, type, on_water, zlevel_range)
|
113
101
|
collection = []
|
114
|
-
zlevel_range.each
|
102
|
+
zlevel_range.each do |zlevel|
|
115
103
|
scene = Scene.new(tags, zlevel, on_water, type)
|
116
104
|
collection.push(ImageForComparison.new(scene.get_image_filename, "z#{zlevel}"))
|
117
|
-
|
105
|
+
end
|
118
106
|
return collection
|
119
107
|
end
|
120
108
|
|
@@ -129,7 +117,7 @@ module CartoCSSHelper
|
|
129
117
|
end
|
130
118
|
|
131
119
|
def load
|
132
|
-
|
120
|
+
unless @loaded
|
133
121
|
DataFileLoader.load_data_into_database(@data_filename)
|
134
122
|
puts "\tgenerating images"
|
135
123
|
@loaded = true
|
@@ -137,45 +125,40 @@ module CartoCSSHelper
|
|
137
125
|
end
|
138
126
|
|
139
127
|
def get_timestamp
|
140
|
-
return
|
128
|
+
return GenericCachedDownloader.new.get_cache_timestamp(@data_filename)
|
141
129
|
end
|
142
130
|
end
|
143
131
|
|
144
|
-
def self.
|
145
|
-
#special support for following tag values: :any_value
|
146
|
-
header_prefix = "#{
|
132
|
+
def self.visualise_on_overpass_data(tags, type, wanted_latitude, wanted_longitude, zlevels, new_branch, old_branch = 'master')
|
133
|
+
# special support for following tag values: :any_value
|
134
|
+
header_prefix = "#{VisualDiff.tag_dict_to_string(tags)} #{type} [#{wanted_latitude}, #{wanted_longitude}] -> "
|
147
135
|
target_location = '[?, ?]'
|
148
136
|
header_sufix = " #{old_branch}->#{new_branch} #{zlevels}"
|
149
|
-
puts "
|
137
|
+
puts "visualise_on_overpass_data <#{header_prefix}#{header_sufix}> #{old_branch} -> #{new_branch}"
|
150
138
|
begin
|
151
|
-
latitude, longitude =
|
139
|
+
latitude, longitude = OverpassQueryGenerator.locate_element_with_given_tags_and_type tags, type, wanted_latitude, wanted_longitude
|
152
140
|
target_location = "[#{latitude}, #{longitude}]"
|
153
|
-
rescue
|
141
|
+
rescue OverpassQueryGenerator::NoLocationFound, OverpassDownloader::OverpassRefusedResponse
|
154
142
|
puts 'No nearby instances of tags and tag is not extremely rare - no generation of nearby location and wordwide search was impossible. No diff image will be generated for this location.'
|
155
143
|
return false
|
156
144
|
end
|
157
|
-
|
158
|
-
visualise_changes_for_location(latitude, longitude, zlevels, header_prefix+target_location+header_sufix, new_branch, old_branch, download_bbox_size)
|
145
|
+
visualise_for_location(latitude, longitude, zlevels, header_prefix + target_location + header_sufix, new_branch, old_branch)
|
159
146
|
return true
|
160
147
|
end
|
161
148
|
|
162
|
-
def self.
|
163
|
-
filename =
|
164
|
-
|
149
|
+
def self.visualise_for_location(latitude, longitude, zlevels, header, new_branch, old_branch, download_bbox_size = 0.4, image_size = 400)
|
150
|
+
filename = OverpassQueryGenerator.get_file_with_downloaded_osm_data_for_location(latitude, longitude, download_bbox_size)
|
151
|
+
visualise_for_location_from_file(filename, latitude, longitude, zlevels, header, new_branch, old_branch, download_bbox_size, image_size)
|
165
152
|
end
|
166
153
|
|
167
|
-
def self.
|
154
|
+
def self.visualise_for_location_from_file(filename, latitude, longitude, zlevels, header, new_branch, old_branch, download_bbox_size = 0.4, image_size = 400)
|
168
155
|
prefix = ''
|
169
|
-
if @@job_pooling
|
170
|
-
prefix = 'pool <- '
|
171
|
-
end
|
156
|
+
prefix = 'pool <- ' if @@job_pooling
|
172
157
|
add_job(filename, latitude, longitude, zlevels, header, new_branch, old_branch, download_bbox_size, image_size, prefix)
|
173
|
-
|
174
|
-
run_jobs
|
175
|
-
end
|
158
|
+
run_jobs unless @@job_pooling
|
176
159
|
end
|
177
160
|
|
178
|
-
def self.
|
161
|
+
def self.visualise_for_given_source(latitude, longitude, zlevels, header, new_branch, old_branch, image_size, source)
|
179
162
|
Git.checkout old_branch
|
180
163
|
old = VisualDiff.collect_images_for_real_data_test(latitude, longitude, zlevels, source, image_size)
|
181
164
|
Git.checkout new_branch
|
@@ -183,56 +166,45 @@ module CartoCSSHelper
|
|
183
166
|
VisualDiff.pack_image_sets old, new, header, new_branch, old_branch, image_size
|
184
167
|
end
|
185
168
|
|
186
|
-
def self.scale(zlevel, reference_value, reference_zlevel)
|
187
|
-
diff = zlevel - reference_zlevel
|
188
|
-
rescaler = 2.0**diff
|
189
|
-
return reference_value*rescaler
|
190
|
-
end
|
191
|
-
|
192
169
|
def self.get_render_bbox_size(zlevel, wanted_image_size, latitude)
|
193
170
|
longitude_equator_rendered_length_in_pixels = 256 * 2**zlevel
|
194
|
-
longitude_size = 360*wanted_image_size.to_f/longitude_equator_rendered_length_in_pixels
|
195
|
-
latitude_size = longitude_size * Math.cos(latitude*Math::PI/180)
|
171
|
+
longitude_size = 360 * wanted_image_size.to_f / longitude_equator_rendered_length_in_pixels
|
172
|
+
latitude_size = longitude_size * Math.cos(latitude * Math::PI / 180)
|
196
173
|
return [latitude_size, longitude_size]
|
197
174
|
end
|
198
175
|
|
199
|
-
def self.collect_images_for_real_data_test(latitude, longitude, zlevels, source, image_size=400)
|
176
|
+
def self.collect_images_for_real_data_test(latitude, longitude, zlevels, source, image_size = 400)
|
200
177
|
collection = []
|
201
|
-
zlevels.each
|
178
|
+
zlevels.each do |zlevel|
|
202
179
|
render_bbox_size = VisualDiff.get_render_bbox_size(zlevel, image_size, latitude)
|
203
|
-
|
204
|
-
|
205
|
-
if !File.exists?(filename)
|
180
|
+
filename = "#{latitude} #{longitude} #{zlevel}zlevel #{image_size}px #{source.get_timestamp} #{source.download_bbox_size}.png"
|
181
|
+
unless RendererHandler.image_available_from_cache(latitude, longitude, zlevel, render_bbox_size, image_size, filename)
|
206
182
|
source.load
|
207
|
-
TilemillHandler.run_tilemill_export_image(latitude, longitude, zlevel, render_bbox_size, image_size, filename)
|
208
183
|
end
|
209
|
-
|
210
|
-
|
184
|
+
file_location = RendererHandler.request_image_from_renderer(latitude, longitude, zlevel, render_bbox_size, image_size, filename)
|
185
|
+
collection.push(ImageForComparison.new(file_location, "z#{zlevel}"))
|
186
|
+
end
|
211
187
|
return collection
|
212
188
|
end
|
213
189
|
|
214
190
|
def self.pack_image_sets(old, new, header, new_branch, old_branch, image_size)
|
215
|
-
old_branch = FileHelper
|
216
|
-
new_branch = FileHelper
|
217
|
-
header_for_filename = FileHelper
|
218
|
-
filename_sufix = "#{
|
219
|
-
filename = CartoCSSHelper::Configuration.get_path_to_folder_for_output + "#{header_for_filename} #{filename_sufix} #{image_size}px.png"
|
191
|
+
old_branch = FileHelper.make_string_usable_as_filename(old_branch)
|
192
|
+
new_branch = FileHelper.make_string_usable_as_filename(new_branch)
|
193
|
+
header_for_filename = FileHelper.make_string_usable_as_filename(header)
|
194
|
+
filename_sufix = "#{old_branch} -> #{new_branch}"
|
195
|
+
filename = CartoCSSHelper::Configuration.get_path_to_folder_for_output + "#{header_for_filename} #{filename_sufix} #{image_size}px #{RendererHandler.renderer_marking}.png"
|
220
196
|
diff = FullSetOfComparedImages.new(old, new, header, filename, image_size)
|
221
197
|
diff.save
|
222
198
|
end
|
223
199
|
|
224
|
-
def self.
|
200
|
+
def self.tag_dict_to_string(dict)
|
225
201
|
result = ''
|
226
|
-
dict.to_a.each
|
227
|
-
if result != ''
|
228
|
-
result << '; '
|
229
|
-
end
|
202
|
+
dict.to_a.each do |tag|
|
203
|
+
result << '; ' if result != ''
|
230
204
|
value = "'#{tag[1]}'"
|
231
|
-
if tag[1] == :any_value
|
232
|
-
value = '{any value}'
|
233
|
-
end
|
205
|
+
value = '{any value}' if tag[1] == :any_value
|
234
206
|
result << "#{tag[0]}=#{value}"
|
235
|
-
|
207
|
+
end
|
236
208
|
return result
|
237
209
|
end
|
238
210
|
end
|
@@ -1,17 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
[
|
5
|
-
[
|
6
|
-
[
|
7
|
-
[
|
8
|
-
[
|
9
|
-
[
|
10
|
-
|
11
|
-
#
|
1
|
+
module CartoCSSHelper
|
2
|
+
def self.get_list_of_testing_locations
|
3
|
+
return [
|
4
|
+
[50.1, 19.9], # Krakow
|
5
|
+
[53.2, -1.8], # rural uk
|
6
|
+
[36.1, 140.7], # Japan
|
7
|
+
[54.8, 31.7], # Russia
|
8
|
+
[21.3, 39.5], # Mecca
|
9
|
+
[41.4, 44.5], # Georgia
|
10
|
+
[51.5, -0.1], # London
|
11
|
+
# TODO: solve problems with response too big to store in memory
|
12
|
+
# [52.09, 5.11], #Utrecht
|
12
13
|
|
13
|
-
#http://overpass-turbo.eu/s/ar4
|
14
|
-
#capital locations
|
14
|
+
# http://overpass-turbo.eu/s/ar4
|
15
|
+
# capital locations
|
15
16
|
[-41.2887639, 174.7772239],
|
16
17
|
[37.9841493, 23.7279843],
|
17
18
|
[46.0498650, 14.5068921],
|
@@ -19,7 +20,7 @@ def get_list_of_testing_locations
|
|
19
20
|
[28.6138967, 77.2159562],
|
20
21
|
[33.6945756, 73.0643744],
|
21
22
|
[48.2083537, 16.3725042],
|
22
|
-
#[48.8565056, 2.3521334], TODO: solve problems with rest-client crashing and blabbing about negative integers
|
23
|
+
# [48.8565056, 2.3521334], TODO: solve problems with rest-client crashing and blabbing about negative integers
|
23
24
|
[46.9482713, 7.4514512],
|
24
25
|
[45.4210328, -75.6900219],
|
25
26
|
[59.9132694, 10.7391112],
|
@@ -238,5 +239,6 @@ def get_list_of_testing_locations
|
|
238
239
|
[-8.5202604, 179.1974823],
|
239
240
|
[4.1779879, 73.5107387],
|
240
241
|
[53.3497645, -6.2602732],
|
241
|
-
|
242
|
+
]
|
243
|
+
end
|
242
244
|
end
|
data/readme.md
CHANGED
@@ -22,23 +22,47 @@ Install ruby - see https://www.ruby-lang.org/en/documentation/installation/ for
|
|
22
22
|
|
23
23
|
Unfortunately, standard `gem install cartocss_helper` may not be enough as CartoCSS Helper depends on RMagick gem that requires special installation.
|
24
24
|
|
25
|
-
|
25
|
+
1. install software necessary to install RMagick gem. On Lubuntu 14.04 it was enough to run `sudo apt-get install ruby-dev imagemagick libmagickcore-dev libmagickwand-dev`.
|
26
|
+
2. `gem install --user-install rmagick`
|
27
|
+
3. `gem install --user-install cartocss_helper`.
|
26
28
|
|
27
|
-
|
29
|
+
###Examples
|
28
30
|
|
29
|
-
|
31
|
+
It is assumed that CartoCSS project with Default OSM Style (https://github.com/gravitystorm/openstreetmap-carto/) is located at `~/Documents/MapBox/project/osm-carto`.
|
30
32
|
|
31
|
-
|
33
|
+
require 'cartocss_helper'
|
32
34
|
|
33
|
-
require cartocss_helper
|
34
35
|
CartoCSSHelper::Configuration.set_style_specific_data(CartoCSSHelper::StyleDataForDefaultOSM.get_style_data)
|
35
|
-
|
36
|
-
CartoCSSHelper::Configuration.
|
37
|
-
|
36
|
+
project_location = File.join(ENV['HOME'], 'Documents', 'MapBox', 'project', 'osm-carto', '')
|
37
|
+
CartoCSSHelper::Configuration.set_path_to_cartocss_project_folder(project_location)
|
38
|
+
output_folder = File.join(ENV['HOME'], 'Documents', 'CartoCSSHelper-output', '')
|
39
|
+
CartoCSSHelper::Configuration.set_path_to_folder_for_output(output_folder)
|
40
|
+
cache_folder = File.join(ENV['HOME'], 'Documents', 'CartoCSSHelper-tmp', '')
|
41
|
+
CartoCSSHelper::Configuration.set_path_to_folder_for_cache(cache_folder)
|
38
42
|
|
39
43
|
tags = {'landuse' => 'village_green', 'tourism' => 'attraction'}
|
40
44
|
CartoCSSHelper.test tags, 'master', 'v2.28.1'
|
41
45
|
|
46
|
+
or, to just test on real examples of landuse=quarry tagged on ways (most will form areas)
|
47
|
+
|
48
|
+
require 'cartocss_helper'
|
49
|
+
|
50
|
+
CartoCSSHelper::Configuration.set_style_specific_data(CartoCSSHelper::StyleDataForDefaultOSM.get_style_data)
|
51
|
+
project_location = File.join(ENV['HOME'], 'Documents', 'MapBox', 'project', 'osm-carto', '')
|
52
|
+
CartoCSSHelper::Configuration.set_path_to_cartocss_project_folder(project_location)
|
53
|
+
output_folder = File.join(ENV['HOME'], 'Documents', 'CartoCSSHelper-output', '')
|
54
|
+
CartoCSSHelper::Configuration.set_path_to_folder_for_output(output_folder)
|
55
|
+
cache_folder = File.join(ENV['HOME'], 'Documents', 'CartoCSSHelper-tmp', '')
|
56
|
+
CartoCSSHelper::Configuration.set_path_to_folder_for_cache(cache_folder)
|
57
|
+
|
58
|
+
tags = {'landuse' => 'quarry'}
|
59
|
+
branch_name = 'quarry-icon'
|
60
|
+
base_branch_name = 'master'
|
61
|
+
zlevels = 10..22
|
62
|
+
type = 'way' #or 'node'
|
63
|
+
test_locations_count = 10
|
64
|
+
CartoCSSHelper.test_tag_on_real_data_for_this_type(tags, branch_name, base_branch_name, zlevels, type, test_locations_count)
|
65
|
+
|
42
66
|
First part of this Ruby script is responsible for loading gem and configuration, including location of cache folder and folder where produced comparison images will be saved.
|
43
67
|
|
44
68
|
Second part runs quick test for specified tag combination rendering only this element as node, way and a closed way. It is followed by locating multiple places across globe where such tag combination is used.
|
@@ -53,4 +77,5 @@ It is also possible to look for certain keys, with any value:
|
|
53
77
|
|
54
78
|
###Automated stuff
|
55
79
|
|
56
|
-
[![Code Climate](https://codeclimate.com/github/
|
80
|
+
[![Code Climate](https://codeclimate.com/github/matkoniecz/CartoCSSHelper/badges/gpa.svg)](https://codeclimate.com/github/matkoniecz/CartoCSSHelper)
|
81
|
+
[![Build Status](https://travis-ci.org/matkoniecz/CartoCSSHelper.svg?branch=master)](https://travis-ci.org/matkoniecz/CartoCSSHelper)
|
metadata
CHANGED
@@ -1,64 +1,159 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cartocss_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 4.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Mateusz Konieczny
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rest-client
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.8
|
19
|
+
version: '1.8'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.8
|
26
|
+
version: '1.8'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: sys-filesystem
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.1
|
33
|
+
version: '1.1'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 1.1.0
|
38
37
|
type: :runtime
|
39
38
|
prerelease: false
|
40
39
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
40
|
requirements:
|
43
|
-
- - ~>
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.1'
|
44
|
+
- - ">="
|
44
45
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.1.
|
46
|
+
version: 1.1.0
|
46
47
|
- !ruby/object:Gem::Dependency
|
47
48
|
name: rmagick
|
48
49
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
50
|
requirements:
|
51
|
-
- - ~>
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.
|
53
|
+
version: '2.0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
57
|
requirements:
|
59
|
-
- - ~>
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '2.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: ruby-progressbar
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
67
|
+
version: '1.8'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.8'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rubocop
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0.41'
|
82
|
+
- - ">"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0.41'
|
85
|
+
type: :development
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0.41'
|
92
|
+
- - ">"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0.41'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: rspec
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - "~>"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '3.4'
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 3.4.0
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '3.4'
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: 3.4.0
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: travis
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - "~>"
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '1.8'
|
122
|
+
type: :development
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - "~>"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '1.8'
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
name: simplecov
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - "~>"
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0.11'
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - "~>"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0.11'
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: codeclimate-test-reporter
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - "~>"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0.5'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - "~>"
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0.5'
|
62
157
|
description: Tool to make development of CartoCSS styles more efficient. Automates
|
63
158
|
actions necessary to produce test images and validates style. Loading data using
|
64
159
|
osm2pgsql, rendering with TileMill, obtaining test data from overpass turbo.
|
@@ -69,46 +164,52 @@ extensions: []
|
|
69
164
|
extra_rdoc_files: []
|
70
165
|
files:
|
71
166
|
- lib/cartocss_helper.rb
|
72
|
-
- lib/cartocss_helper/
|
73
|
-
- lib/cartocss_helper/
|
74
|
-
- lib/cartocss_helper/image_generator.rb
|
75
|
-
- lib/cartocss_helper/validator.rb
|
76
|
-
- lib/cartocss_helper/downloader.rb
|
77
|
-
- lib/cartocss_helper/tilemill_handler.rb
|
167
|
+
- lib/cartocss_helper/configuration.rb
|
168
|
+
- lib/cartocss_helper/data_file_handling.rb
|
78
169
|
- lib/cartocss_helper/git.rb
|
79
|
-
- lib/cartocss_helper/util/filehelper.rb
|
80
170
|
- lib/cartocss_helper/heuristic.rb
|
81
|
-
- lib/cartocss_helper/
|
82
|
-
- lib/cartocss_helper/
|
83
|
-
- lib/cartocss_helper/
|
171
|
+
- lib/cartocss_helper/image_generator.rb
|
172
|
+
- lib/cartocss_helper/notes_downloader.rb
|
173
|
+
- lib/cartocss_helper/overpass_downloader.rb
|
174
|
+
- lib/cartocss_helper/overpass_query_generator.rb
|
175
|
+
- lib/cartocss_helper/renderer_handler.rb
|
84
176
|
- lib/cartocss_helper/style_specific/default_osm_style.rb
|
85
|
-
- lib/cartocss_helper/
|
177
|
+
- lib/cartocss_helper/style_specific/style_specific.rb
|
178
|
+
- lib/cartocss_helper/tag_lister.rb
|
179
|
+
- lib/cartocss_helper/util/filehelper.rb
|
180
|
+
- lib/cartocss_helper/util/generic_cached_downloader.rb
|
181
|
+
- lib/cartocss_helper/util/generic_downloader.rb
|
182
|
+
- lib/cartocss_helper/util/logger.rb
|
183
|
+
- lib/cartocss_helper/util/rest-client_wrapper.rb
|
184
|
+
- lib/cartocss_helper/util/systemhelper.rb
|
185
|
+
- lib/cartocss_helper/validator.rb
|
186
|
+
- lib/cartocss_helper/visualise_changes_diff_from_images.rb
|
187
|
+
- lib/cartocss_helper/visualise_changes_image_generation.rb
|
86
188
|
- lib/data/testing_locations.rb
|
87
189
|
- license.txt
|
88
190
|
- readme.md
|
89
191
|
homepage: https://github.com/matkoniecz/CartoCSSHelper
|
90
192
|
licenses:
|
91
193
|
- CC0
|
194
|
+
metadata: {}
|
92
195
|
post_install_message:
|
93
196
|
rdoc_options: []
|
94
197
|
require_paths:
|
95
198
|
- lib
|
96
199
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
200
|
requirements:
|
99
|
-
- -
|
201
|
+
- - ">="
|
100
202
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
203
|
+
version: 2.1.0
|
102
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
-
none: false
|
104
205
|
requirements:
|
105
|
-
- -
|
206
|
+
- - ">="
|
106
207
|
- !ruby/object:Gem::Version
|
107
208
|
version: 1.8.23
|
108
209
|
requirements: []
|
109
210
|
rubyforge_project:
|
110
|
-
rubygems_version:
|
211
|
+
rubygems_version: 2.5.1
|
111
212
|
signing_key:
|
112
|
-
specification_version:
|
213
|
+
specification_version: 4
|
113
214
|
summary: Tool to make development of CartoCSS styles more efficient.
|
114
215
|
test_files: []
|