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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/osm.rb +1 -1
- data/lib/osm/exporter.rb +12 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 757c6befa7fdeb827fbe59ad15395abff9d1ab8ae5084b3131fc356970150868
|
4
|
+
data.tar.gz: f891637fc61e2cb496ac3f8522cd812ac794fc5af7ba610b154deed9a8501009
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6602375742a437525c2b476d19210d06d60d920c43f8da46584a34dc94aa57360d2eccad425a85f4006730bdd0c84128b64cb25623e53a827731c1c7c729f6d
|
7
|
+
data.tar.gz: 5532490d9f284b4840f40ac60e03842ca31c87a5806e9abf2951bd8308da83137b9c95c8f7b6fc612b9c246415a2a569c638f286aed4bce6e49333c7663cb24f
|
data/Gemfile.lock
CHANGED
data/lib/osm.rb
CHANGED
data/lib/osm/exporter.rb
CHANGED
@@ -42,9 +42,18 @@ module OSM
|
|
42
42
|
png
|
43
43
|
end
|
44
44
|
|
45
|
-
def draw_line(png, coordinates)
|
46
|
-
|
47
|
-
|
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
|
+
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
|
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.
|
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
|