aqila-mapas 0.4.7 → 0.4.8

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
  SHA256:
3
- metadata.gz: d6fce2f7cd80a0ad57fa45f9135295600e04bd639c4359e86c00b75afe05f522
4
- data.tar.gz: e4030db8d53c17a6b32bd36742584596f9dbe9be48355d0e24fe493dc80ca1cd
3
+ metadata.gz: '099f167d3713bc774d6cf3257022a3b788cc4ead04ebe7f73751d5e0c872a4e8'
4
+ data.tar.gz: 5d3d177510ace7ac14ed0913c24f2809c9a2ee0ef93a7ef8438de9d7a13c4ad5
5
5
  SHA512:
6
- metadata.gz: '08591b8107f70c8e2f66700783c56b41fd90e771359b73f0b5dfbb52ac814ab1b56a85602bf7698f595ffb9d0ae43e3449e47d3b2891de964380ad9e43f8dc63'
7
- data.tar.gz: 5220c696138f3dcf555eb414916684a709d48ed7d68bcd744c3430403e570551f2e68d3194c4c5677703251a3bedfd1ee2b4e9ffdb898a2a60e08ab4105500ab
6
+ metadata.gz: ff9cd4d2ce2a473e88bfd606264ae3449d1a7238e1e949f9b59b7d7a5b09c5a304d7e003684a9b9fc1318dbb9f0a9c080be7570501577a7fcf7e5b9bbd5c93de
7
+ data.tar.gz: bc6a8c3cef6e118a463b23681c20e493a4525ba30ff8a0f3a33da800cc5cc21bd882e894c6805e7649b798bb53cc61eb53964d0aaeae78f457e4b3668c95cb15
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aqila-mapas (0.4.7)
4
+ aqila-mapas (0.4.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aqila
4
4
  module Mapas
5
- VERSION = '0.4.7'
5
+ VERSION = '0.4.8'
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ class Map::DownloadTilesService
13
13
  'http://c.tile.openstreetmap.org'
14
14
  ].freeze
15
15
  MAP_BOX_SERVER = 'https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256'
16
- MAP_BOX_TOKEN = 'pk.eyJ1IjoiaW5vdmFjYW8tYWdybzEiLCJhIjoiY2xneHhwdXZ0MDN5OTNpcXF3dTd0dHJwOCJ9.kZoathkPpmDuuc1nDROauA'
16
+ MAP_BOX_TOKEN = 'pk.eyJ1IjoiaW5vdmFjYW8tYWdybzEiLCJhIjoiY2xoczRiNGx1MnVucTNkcGJ5cXN6bTZtMCJ9.0tT_B-kqD_GL0-VKvY15iw'
17
17
 
18
18
  def initialize(options = {})
19
19
  @zoom_min = options[:zoom] || options[:zoom_min]
@@ -49,12 +49,14 @@ class Map::DownloadTilesService
49
49
  private
50
50
 
51
51
  def valid_file?(file_name)
52
- File.exist?(file_name) && File.size(file_name) > MIN_FILE_SIZE
52
+ matching_files = Dir.glob("**/#{file_name}")
53
+ matching_files.any? && File.size(matching_files.first) > MIN_FILE_SIZE
53
54
  end
54
55
 
55
56
  def get_tile(points, zoom)
56
57
  dir = "#{@output_directory}/#{zoom}/#{points.first}"
57
58
  file_name = "#{dir}/#{points.second}.jpg"
59
+ Rails.logger.info "Baixando tile: #{file_name}"
58
60
 
59
61
  return file_name if valid_file?(file_name)
60
62
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aqila-mapas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - lucasferronato
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-18 00:00:00.000000000 Z
11
+ date: 2023-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler