osm-rb 0.0.4 → 0.0.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
  SHA256:
3
- metadata.gz: 8feaaa2f9e992e40a1a90e217f0740456b3c27d82738dbe3d4bc918c08456f9c
4
- data.tar.gz: 1059922372bcc067c1830686920b288be65600f7509edf634874d4e1cb4ac6e2
3
+ metadata.gz: 757c6befa7fdeb827fbe59ad15395abff9d1ab8ae5084b3131fc356970150868
4
+ data.tar.gz: f891637fc61e2cb496ac3f8522cd812ac794fc5af7ba610b154deed9a8501009
5
5
  SHA512:
6
- metadata.gz: 29a57400d2768ebb8b43efb2628dd678cad766e5a6c67368409d74861f9168931f98061ab8c2170df71d8cde6902017edf1941e311511ffbbb60774a0a1402a9
7
- data.tar.gz: fca6d5e9e6231adce2016b94b839702399711893e8a74620bb718d91759b6d753cbc722045a0d518d4c95ff1b1674c62e10f68538bf1cca88f440bb1f3f9c6f4
6
+ metadata.gz: a6602375742a437525c2b476d19210d06d60d920c43f8da46584a34dc94aa57360d2eccad425a85f4006730bdd0c84128b64cb25623e53a827731c1c7c729f6d
7
+ data.tar.gz: 5532490d9f284b4840f40ac60e03842ca31c87a5806e9abf2951bd8308da83137b9c95c8f7b6fc612b9c246415a2a569c638f286aed4bce6e49333c7663cb24f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- osm-rb (0.0.3)
4
+ osm-rb (0.0.6)
5
5
  oily_png (~> 1.2.1)
6
6
  typhoeus (~> 1.3.1)
7
7
 
data/lib/osm.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module OSM
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.6'
3
3
 
4
4
  require_relative 'osm/calculator'
5
5
  require_relative 'osm/exporter'
@@ -42,9 +42,18 @@ module OSM
42
42
  png
43
43
  end
44
44
 
45
- def draw_line(png, coordinates)
46
- str = coordinates.map { |c| "(#{c.x},#{c.y})" }.join(' ')
47
- png.polygon(str, ChunkyPNG::Color.rgb(255, 0, 0))
45
+ def draw_line(png, coordinates, rgb = { r: 255, g: 0, b: 0 })
46
+ str0 = coordinates.map { |c| "(#{c.x},#{c.y})" }.join(' ')
47
+ str1 = coordinates.map { |c| "(#{c.x+1},#{c.y})" }.join(' ')
48
+ str2 = coordinates.map { |c| "(#{c.x},#{c.y+1})" }.join(' ')
49
+ str3 = coordinates.map { |c| "(#{c.x-1},#{c.y})" }.join(' ')
50
+ str4 = coordinates.map { |c| "(#{c.x},#{c.y-1})" }.join(' ')
51
+ s = Time.now.to_f
52
+ [str0, str1, str2, str3, str4].each do |str|
53
+ png = png.polygon(str, ChunkyPNG::Color.rgb(rgb[:r], rgb[:g], rgb[:b]))
54
+ end
55
+ puts Time.now.to_f - s
56
+ png
48
57
  end
49
58
 
50
59
  def crop(png, crop_dimensions, target_size)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osm-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas_Skywalker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2020-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubygems_version: 3.1.2
130
+ rubygems_version: 3.0.6
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Manipulation and export of OSM map tiles