aqila-mapas 0.4.9 → 0.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/aqila/mapas/version.rb +1 -1
- data/lib/map/download_tiles_service.rb +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72c6f84a78b023c2c57b124b34f183350ab5f3acc3113113b7565193aa0e4b22
|
4
|
+
data.tar.gz: cefdac641effd3c03419c503375d7e327ea15c389a25d68397e86d4e2d2cea05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22045a00fecccd91b964226d5f1a5afd34565e64606a239444cab759779c6c8447e39e81d0f27f6c66a4ac5e54cf341857d3ad2069667aeaa9b79d4bbc68db1e
|
7
|
+
data.tar.gz: '040885feda3d4c63c32e2faa067e1d439842414f34bf24c0cba0304e6cd5d113df2014d0f3b6cb361220990c07f9f35ed1a640cf976b3f474008aed2c16b862f'
|
data/Gemfile.lock
CHANGED
data/lib/aqila/mapas/version.rb
CHANGED
@@ -31,8 +31,10 @@ class Map::DownloadTilesService
|
|
31
31
|
tile_NE = Map::TileService.new(@boundary_ne.second, @boundary_ne.first, zoom).points
|
32
32
|
tile_SW = Map::TileService.new(@boundary_sw.second, @boundary_sw.first, zoom).points
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
tile_x = [tile_SW[:x] - TILES_OVERHEAD, 0].max # avoid negative values
|
35
|
+
tile_y = [tile_SW[:y] - TILES_OVERHEAD, 0].max # avoid negative values
|
36
|
+
(tile_x..tile_NE[:x]+TILES_OVERHEAD).each do |point_x|
|
37
|
+
(tile_y..tile_SW[:y]+TILES_OVERHEAD).each do |point_y|
|
36
38
|
ret << {
|
37
39
|
x: point_x,
|
38
40
|
y: point_y,
|
@@ -49,8 +51,10 @@ class Map::DownloadTilesService
|
|
49
51
|
private
|
50
52
|
|
51
53
|
def valid_file?(file_name)
|
52
|
-
|
53
|
-
|
54
|
+
File.exist?(file_name) && File.size(file_name) > MIN_FILE_SIZE
|
55
|
+
rescue StandardError => error
|
56
|
+
Rails.logger.error "Erro ao verificar arquivo: #{file_name} - #{error.message}"
|
57
|
+
false
|
54
58
|
end
|
55
59
|
|
56
60
|
def get_tile(points, zoom)
|
@@ -59,7 +63,7 @@ class Map::DownloadTilesService
|
|
59
63
|
Rails.logger.info "Baixando tile: #{file_name}"
|
60
64
|
|
61
65
|
# file_name.match(/-/) - retorna o nome do arquivo caso tenha algum "-" no nome
|
62
|
-
return file_name if file_name.match(/-/) || valid_file?(file_name)
|
66
|
+
return file_name if file_name.match?(/-/) || valid_file?(file_name)
|
63
67
|
|
64
68
|
FileUtils.mkdir_p(dir)
|
65
69
|
|
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.
|
4
|
+
version: 0.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lucasferronato
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|