libgd-gis 0.2.4 → 0.2.6
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 +12 -1
- data/lib/gd/gis/map.rb +35 -2
- metadata +1 -2
- data/lib/gd/gis/dump.sh +0 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c36a99210906574c046daffe2120213b027d92fdd22dec0b27861df22f88029
|
|
4
|
+
data.tar.gz: bd991fd3290c3bfb82f5640dad84c8e6486368285539774eed1b942acd7848b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bed27a3930a9512b0f5fff46fdfe2f76fe76932ddf263cc2d219cdaafd754d5161ede878f1b0d929e5a7b00b9c4b546c6905d9ee27d9bc478d5e7914ebc1784
|
|
7
|
+
data.tar.gz: ee203f7b9dc6f0a2669bbbedcde1e6fe31678c3a847c79a14d975c75cee1cc0a7f2784398acbef9b821943cce9124bdb5b41f0194070ff020fa39824f699a56a
|
data/README.md
CHANGED
|
@@ -29,10 +29,15 @@
|
|
|
29
29
|
</p>
|
|
30
30
|
|
|
31
31
|

|
|
32
|
+
[](https://www.codacy.com/app/libgd-gis/libgd-gis?utm_source=github.com&utm_medium=referral&utm_content=libgd-gis/libgd-gis&utm_campaign=Badge_Grade)
|
|
33
|
+
[](https://coveralls.io/github/libgd-gis/libgd-gis?branch=master)
|
|
34
|
+
[](https://rubygems.org/gems/libgd-gis)
|
|
35
|
+
|
|
32
36
|
|
|
33
37
|
| Examples | Examples | Examples |
|
|
34
38
|
| :----: | :----: | :--: |
|
|
35
|
-
| <img src="examples/
|
|
39
|
+
| <img src="docs/examples/parana.png" height="250"> | <img src="docs/examples/nyc.png" height="250"> | <img src="docs/examples/paris.png" height="250"> |
|
|
40
|
+
| <img src="examples/nyc/nyc.png" height="250"> | <img src="docs/examples/tokyo_solarized.png" height="250"> | <img src="examples/parana/parana.png" height="250"> |
|
|
36
41
|
| <img src="docs/examples/america.png" height="250"> | <img src="docs/examples/argentina_museum.png" height="250"> | <img src="docs/examples/museos_parana.png" height="250"> |
|
|
37
42
|
| <img src="docs/examples/asia.png" height="250"> | <img src="docs/examples/europe.png" height="250"> | <img src="docs/examples/icecream_parana.png" height="250"> |
|
|
38
43
|
| <img src="docs/examples/argentina_cities.png" height="250"> | <img src="docs/examples/tanzania_hydro.png" height="250"> | <img src="docs/examples/parana_polygon.png" height="250"> |
|
|
@@ -40,6 +45,12 @@
|
|
|
40
45
|
|
|
41
46
|
---
|
|
42
47
|
|
|
48
|
+
> **libgd-gis is evolving very fast**, so some examples may temporarily stop working.
|
|
49
|
+
> Please report issues or ask for help — feedback is very welcome.
|
|
50
|
+
> https://github.com/ggerman/libgd-gis/issues or ggerman@gmail.com
|
|
51
|
+
|
|
52
|
+
--
|
|
53
|
+
|
|
43
54
|
## A geospatial raster engine for Ruby.
|
|
44
55
|
|
|
45
56
|
libgd-gis allows Ruby to render real maps, GeoJSON layers, vector features, and geospatial tiles using a native raster backend powered by **libgd**.
|
data/lib/gd/gis/map.rb
CHANGED
|
@@ -71,8 +71,30 @@ module GD
|
|
|
71
71
|
@points_layers << GD::GIS::PointsLayer.new(data, **opts)
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
def
|
|
75
|
-
|
|
74
|
+
def add_line(coords, **opts)
|
|
75
|
+
feature = {
|
|
76
|
+
"type" => "Feature",
|
|
77
|
+
"geometry" => {
|
|
78
|
+
"type" => "LineString",
|
|
79
|
+
"coordinates" => coords
|
|
80
|
+
},
|
|
81
|
+
"properties" => {}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
add_lines([feature], **opts)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def add_multiline(lines, **opts)
|
|
88
|
+
feature = {
|
|
89
|
+
"type" => "Feature",
|
|
90
|
+
"geometry" => {
|
|
91
|
+
"type" => "MultiLineString",
|
|
92
|
+
"coordinates" => lines
|
|
93
|
+
},
|
|
94
|
+
"properties" => []
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
add_lines([feature], **opts)
|
|
76
98
|
end
|
|
77
99
|
|
|
78
100
|
def add_polygons(polygons, **opts)
|
|
@@ -185,6 +207,17 @@ module GD
|
|
|
185
207
|
end
|
|
186
208
|
end
|
|
187
209
|
|
|
210
|
+
private
|
|
211
|
+
|
|
212
|
+
def add_lines(features, **opts)
|
|
213
|
+
stroke = opts.delete(:color) || opts.delete(:stroke)
|
|
214
|
+
width = opts.delete(:width) || opts.delete(:stroke_width)
|
|
215
|
+
|
|
216
|
+
raise ArgumentError, "missing :color or :stroke" unless stroke
|
|
217
|
+
raise ArgumentError, "missing :width" unless width
|
|
218
|
+
|
|
219
|
+
@lines_layers << GD::GIS::LinesLayer.new(features, :stroke => stroke, :width => width)
|
|
220
|
+
end
|
|
188
221
|
|
|
189
222
|
end
|
|
190
223
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: libgd-gis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Germán Alberto Giménez Silva
|
|
@@ -41,7 +41,6 @@ files:
|
|
|
41
41
|
- lib/gd/gis.rb
|
|
42
42
|
- lib/gd/gis/basemap.rb
|
|
43
43
|
- lib/gd/gis/classifier.rb
|
|
44
|
-
- lib/gd/gis/dump.sh
|
|
45
44
|
- lib/gd/gis/feature.rb
|
|
46
45
|
- lib/gd/gis/geometry.rb
|
|
47
46
|
- lib/gd/gis/layer_geojson.rb
|
data/lib/gd/gis/dump.sh
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -e
|
|
4
|
-
|
|
5
|
-
OUT="all_ruby_sources.txt"
|
|
6
|
-
> "$OUT"
|
|
7
|
-
|
|
8
|
-
echo "### Ruby sources dump ($(date))" >> "$OUT"
|
|
9
|
-
echo >> "$OUT"
|
|
10
|
-
|
|
11
|
-
find . -type f -name "*.rb" | sort | while read -r file; do
|
|
12
|
-
echo "===== FILE: $file =====" >> "$OUT"
|
|
13
|
-
echo >> "$OUT"
|
|
14
|
-
cat "$file" >> "$OUT"
|
|
15
|
-
echo >> "$OUT"
|
|
16
|
-
echo >> "$OUT"
|
|
17
|
-
done
|
|
18
|
-
|
|
19
|
-
echo "Wrote $OUT"
|