diff --git a/fetcher/fetcher.rb b/fetcher/fetcher.rb index 2bc2014..b4f802d 100644 --- a/fetcher/fetcher.rb +++ b/fetcher/fetcher.rb @@ -238,7 +238,7 @@ def routes(routes_geojson) } end -def tippecanoe(pois_layers, features_json, features_layer, mbtiles, attributions) +def tippecanoe(pois_layers, features_json, features_layer, mbtiles, attributions, maximum_tile_bytes) attributions = attributions.collect{ |attribution| attribution.gsub('©', '©') } system( 'tippecanoe --force ' + @@ -252,6 +252,7 @@ def tippecanoe(pois_layers, features_json, features_layer, mbtiles, attributions --coalesce-smallest-as-needed \ --drop-smallest-as-needed \ --coalesce-fraction-as-needed \ + --maximum-tile-bytes=#{maximum_tile_bytes | 500_000} \ --attribution='#{attributions.join(' ')}' \ -o #{mbtiles} " @@ -268,6 +269,7 @@ def build(source_id, source, config_path) polygon = "#{config_path}#{source_id}.geojson" settings = setting("#{data_api_url}/settings.json", polygon) attributions = settings['attributions'] || [] + maximum_tile_bytes = settings['maximum_tile_bytes'] mbtiles = config_path + source['sources']['partial']['mbtiles'] @@ -304,7 +306,7 @@ def build(source_id, source, config_path) features: features_data })) - tippecanoe(pois_layers, features_json, 'features', mbtiles, attributions) + tippecanoe(pois_layers, features_json, 'features', mbtiles, attributions, maximum_tile_bytes) end