map_print 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/map_print/core.rb +13 -11
- data/lib/map_print/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b403565fd160476de9c6c7bc64b96f87168c0709
|
4
|
+
data.tar.gz: 2acbf3eea43cc28719c4d50270de1ad244fb4b37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96ae6bc8c7a4d0b81539616ce93b8c0cd13f1288b70e7fa20d9f24de5f6207d24665bd651a534d592d73b8e04441d92b8a6e9053716e8fb642c5df8b7b2af246
|
7
|
+
data.tar.gz: 1a347d350da58f79f5336f13ab07efbea01ca0e28be37233a947d26ac670479e112e355db05daacb1c85fa664d690532c49611126959d522edac6d3f6a47a6d8
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# MapPrint
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/map_print)
|
4
|
+
|
3
5
|
MapPrint allows for exporting many map sources and GeoJSON to a pdf file. Allowing to specify map element, text/image elements as well as printing a legend with the reference and a scale bar.
|
4
6
|
|
5
7
|
## Installation
|
data/lib/map_print/core.rb
CHANGED
@@ -50,7 +50,10 @@ module MapPrint
|
|
50
50
|
|
51
51
|
FileUtils.cp map_image.path, './map.png' if defined?(DEBUG)
|
52
52
|
|
53
|
-
|
53
|
+
size = @map[:size]
|
54
|
+
size[:width] ||= map_image.width
|
55
|
+
size[:height] ||= map_image.height
|
56
|
+
pdf.image map_image.path, at: [@map[:position][:x], pdf.bounds.top - @map[:position][:y]], fit: size.values
|
54
57
|
|
55
58
|
print_images_on_pdf(pdf)
|
56
59
|
print_texts_on_pdf(pdf)
|
@@ -68,6 +71,14 @@ module MapPrint
|
|
68
71
|
print_texts_on_png(map_image)
|
69
72
|
print_legend_on_png(map_image)
|
70
73
|
|
74
|
+
size = @map[:size]
|
75
|
+
if size
|
76
|
+
size[:width] ||= map_image.width
|
77
|
+
size[:height] ||= map_image.height
|
78
|
+
puts "Fitting map image (#{map_image.width}x#{map_image.height}) in #{size[:width]}x#{size[:height]}"
|
79
|
+
map_image.colorspace("RGB").resize("#{size[:width]}x#{size[:height]}\>").colorspace("sRGB").unsharp "0x0.75+0.75+0.008"
|
80
|
+
end
|
81
|
+
|
71
82
|
FileUtils.cp map_image.path, @output_path
|
72
83
|
end
|
73
84
|
|
@@ -81,17 +92,8 @@ module MapPrint
|
|
81
92
|
|
82
93
|
def print_layers
|
83
94
|
file = LayerHandler.new(@map[:layers], @map[:sw], @map[:ne], @map[:zoom]).process
|
84
|
-
size = @map[:size]
|
85
|
-
|
86
|
-
FileUtils.cp file.path, 'layers.png' if defined?DEBUG
|
87
95
|
|
88
|
-
if
|
89
|
-
image = MiniMagick::Image.new(file.path)
|
90
|
-
size[:width] ||= image.width
|
91
|
-
size[:height] ||= image.height
|
92
|
-
puts "Fitting map image (#{image.width}x#{image.height}) in #{size[:width]}x#{size[:height]}"
|
93
|
-
image.colorspace("RGB").resize("#{size[:width]}x#{size[:height]}\>").colorspace("sRGB").unsharp "0x0.75+0.75+0.008"
|
94
|
-
end
|
96
|
+
FileUtils.cp file.path, 'layers.png' if defined?(DEBUG)
|
95
97
|
|
96
98
|
file
|
97
99
|
end
|
data/lib/map_print/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: map_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Fast
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|