libgd-gis 0.2.7.pre.alpha.1 → 0.2.8

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.
@@ -1,7 +1,3 @@
1
- # ============================================================
2
- # WATER
3
- # ============================================================
4
-
5
1
  water:
6
2
  ign:
7
3
  objeto:
@@ -26,242 +22,7 @@ water:
26
22
  - reservoir
27
23
  - riverbank
28
24
 
29
- osm:
30
- waterway:
31
- - river
32
- - stream
33
- - canal
34
- - drain
35
- - ditch
36
- natural:
37
- - water
38
- - lake
39
- - reservoir
40
- - wetland
41
- - bay
42
- - strait
43
-
44
- # ============================================================
45
- # ROADS
46
- # ============================================================
47
-
48
- roads:
49
- ign:
50
- objeto:
51
- - autopista
52
- - ruta
53
- - camino
54
- - calle
55
- - avenida
56
-
57
- natural_earth:
58
- featurecla:
59
- - road
60
- - highway
61
-
62
- osm:
63
- highway:
64
- - motorway
65
- - motorway_link
66
- - trunk
67
- - trunk_link
68
- - primary
69
- - primary_link
70
- - secondary
71
- - secondary_link
72
- - tertiary
73
- - tertiary_link
74
- - residential
75
- - unclassified
76
- - service
77
- - living_street
78
- - pedestrian
79
- - road
80
- - busway
25
+ track:
26
+ gps:
27
+ name:
81
28
  - track
82
-
83
- # ============================================================
84
- # RAIL
85
- # ============================================================
86
-
87
- rail:
88
- osm:
89
- railway:
90
- - rail
91
- - subway
92
- - light_rail
93
- - tram
94
- - monorail
95
- - funicular
96
-
97
- # ============================================================
98
- # PARKS & GREEN
99
- # ============================================================
100
-
101
- park:
102
- ign:
103
- objeto:
104
- - parque
105
- - plaza
106
- - reserva
107
-
108
- natural_earth:
109
- featurecla:
110
- - park
111
- - protected_area
112
-
113
- osm:
114
- leisure:
115
- - park
116
- - garden
117
- - pitch
118
- - playground
119
- - recreation_ground
120
- - golf_course
121
- landuse:
122
- - grass
123
- - meadow
124
- - forest
125
- natural:
126
- - wood
127
- - scrub
128
- - heath
129
- - grassland
130
-
131
- # ============================================================
132
- # BUILDINGS
133
- # ============================================================
134
-
135
- buildings:
136
- ign:
137
- objeto:
138
- - edificio
139
- - hospital
140
- - escuela
141
-
142
- osm:
143
- building:
144
- - yes
145
- - residential
146
- - commercial
147
- - industrial
148
- - retail
149
- - hospital
150
- - school
151
- - church
152
- - cathedral
153
- - university
154
- - public
155
- - civic
156
- - apartments
157
-
158
- # ============================================================
159
- # POI (Points of Interest)
160
- # ============================================================
161
-
162
- poi:
163
- osm:
164
- amenity:
165
- - hospital
166
- - school
167
- - university
168
- - cafe
169
- - restaurant
170
- - bar
171
- - pharmacy
172
- - bank
173
- - atm
174
- - police
175
- - fire_station
176
- - library
177
- - cinema
178
- - theatre
179
- - post_office
180
- - fuel
181
- shop:
182
- - supermarket
183
- - bakery
184
- - convenience
185
- - clothes
186
- - mall
187
- - department_store
188
- - butcher
189
- - greengrocer
190
- - fast_food
191
-
192
- # ============================================================
193
- # TRANSPORT
194
- # ============================================================
195
-
196
- transport:
197
- osm:
198
- aeroway:
199
- - aerodrome
200
- - runway
201
- - taxiway
202
- - apron
203
- - terminal
204
- public_transport:
205
- - station
206
- - stop_position
207
- - platform
208
-
209
- # ============================================================
210
- # NATURAL FEATURES
211
- # ============================================================
212
-
213
- natural:
214
- natural_earth:
215
- featurecla:
216
- - mountain
217
- - peak
218
- - hill
219
- - volcano
220
-
221
- osm:
222
- natural:
223
- - peak
224
- - hill
225
- - volcano
226
- - ridge
227
- - cliff
228
- - dune
229
-
230
- # ============================================================
231
- # LANDUSE
232
- # ============================================================
233
-
234
- landuse:
235
- osm:
236
- landuse:
237
- - residential
238
- - commercial
239
- - industrial
240
- - retail
241
- - farmland
242
- - forest
243
- - grass
244
- - meadow
245
- - quarry
246
- - cemetery
247
- - landfill
248
- - recreation_ground
249
- roads:
250
- osm_geofabrik:
251
- fclass:
252
- - motorway
253
- - motorway_link
254
- - trunk
255
- - trunk_link
256
- - primary
257
- - primary_link
258
- - secondary
259
- - secondary_link
260
- - tertiary
261
- - tertiary_link
262
- - residential
263
- - unclassified
264
- - service
265
- - living_street
266
- - pedestrian
267
- - road
data/lib/gd/gis.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "gd"
2
2
 
3
+ require_relative "gis/color_helpers"
3
4
  require_relative "gis/style"
4
5
  require_relative "gis/classifier"
5
6
 
@@ -12,4 +13,3 @@ require_relative "gis/layer_points"
12
13
  require_relative "gis/layer_lines"
13
14
  require_relative "gis/layer_polygons"
14
15
  require_relative "gis/layer_geojson"
15
- require_relative "gis/path_sampler"
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libgd-gis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7.pre.alpha.1
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Germán Alberto Giménez Silva
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-01-19 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: ruby-libgd
@@ -41,10 +42,10 @@ files:
41
42
  - lib/gd/gis.rb
42
43
  - lib/gd/gis/basemap.rb
43
44
  - lib/gd/gis/classifier.rb
45
+ - lib/gd/gis/color_helpers.rb
44
46
  - lib/gd/gis/crs_normalizer.rb
45
47
  - lib/gd/gis/feature.rb
46
48
  - lib/gd/gis/geometry.rb
47
- - lib/gd/gis/input.rb
48
49
  - lib/gd/gis/input/detector.rb
49
50
  - lib/gd/gis/input/geojson.rb
50
51
  - lib/gd/gis/input/kml.rb
@@ -54,19 +55,17 @@ files:
54
55
  - lib/gd/gis/layer_points.rb
55
56
  - lib/gd/gis/layer_polygons.rb
56
57
  - lib/gd/gis/map.rb
58
+ - lib/gd/gis/middleware.rb
57
59
  - lib/gd/gis/ontology.rb
58
60
  - lib/gd/gis/ontology.yml
59
- - lib/gd/gis/path_sampler.rb
60
61
  - lib/gd/gis/projection.rb
61
62
  - lib/gd/gis/style.rb
62
- - lib/gd/gis/style/dark.rb
63
- - lib/gd/gis/style/light.rb
64
- - lib/gd/gis/style/solarized.rb
65
63
  - lib/libgd_gis.rb
66
64
  homepage: https://github.com/ggerman/libgd-gis
67
65
  licenses:
68
66
  - MIT
69
67
  metadata: {}
68
+ post_install_message:
70
69
  rdoc_options: []
71
70
  require_paths:
72
71
  - lib
@@ -81,7 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
80
  - !ruby/object:Gem::Version
82
81
  version: '0'
83
82
  requirements: []
84
- rubygems_version: 4.0.4
83
+ rubygems_version: 3.5.22
84
+ signing_key:
85
85
  specification_version: 4
86
86
  summary: Geospatial raster rendering for Ruby using libgd
87
87
  test_files: []
data/lib/gd/gis/input.rb DELETED
File without changes
@@ -1,68 +0,0 @@
1
- require "json"
2
-
3
- module GD
4
- module GIS
5
- class PathSampler
6
- def initialize(coords)
7
- @coords = coords
8
- @segments = []
9
- @total = 0.0
10
-
11
- coords.each_cons(2) do |a,b|
12
- d = haversine(a[0],a[1], b[0],b[1])
13
- @segments << [a,b,d]
14
- @total += d
15
- end
16
- end
17
-
18
- def point_at(t)
19
- target = t * @total
20
- acc = 0.0
21
-
22
- @segments.each do |a,b,d|
23
- return interpolate(a,b,(target-acc)/d) if acc + d >= target
24
- acc += d
25
- end
26
-
27
- @coords.last
28
- end
29
-
30
- def interpolate(a,b,t)
31
- [
32
- a[0] + (b[0]-a[0])*t,
33
- a[1] + (b[1]-a[1])*t
34
- ]
35
- end
36
-
37
- def haversine(lon1,lat1,lon2,lat2)
38
- r = 6371000
39
- dlat = (lat2-lat1) * Math::PI/180
40
- dlon = (lon2-lon1) * Math::PI/180
41
- a = Math.sin(dlat/2)**2 +
42
- Math.cos(lat1*Math::PI/180)*Math.cos(lat2*Math::PI/180)*
43
- Math.sin(dlon/2)**2
44
- 2 * r * Math.atan2(Math.sqrt(a), Math.sqrt(1-a))
45
- end
46
-
47
- def self.from_geojson(path)
48
- data = JSON.parse(File.read(path))
49
-
50
- coords =
51
- if data["features"]
52
- data["features"][0]["geometry"]["coordinates"]
53
-
54
- elsif data["paths"]
55
- data["paths"][0]["points"]["coordinates"]
56
-
57
- elsif data["routes"]
58
- data["routes"][0]["geometry"]["coordinates"]
59
-
60
- else
61
- raise "Formato de ruta desconocido en #{path}"
62
- end
63
-
64
- new(coords)
65
- end
66
- end
67
- end
68
- end
@@ -1,49 +0,0 @@
1
- module GD
2
- module GIS
3
- class Style
4
- DARK = Style.new(
5
- roads: {
6
- motorway: {
7
- stroke: [255,255,255],
8
- stroke_width: 10,
9
- fill: [60,60,60],
10
- fill_width: 6
11
- },
12
- primary: {
13
- stroke: [200,200,200],
14
- stroke_width: 7,
15
- fill: [80,80,80],
16
- fill_width: 4
17
- },
18
- street: {
19
- stroke: [120,120,120],
20
- stroke_width: 1
21
- }
22
- },
23
- rail: {
24
- stroke: [255,255,255],
25
- stroke_width: 6,
26
- fill: [220,50,50],
27
- fill_width: 4,
28
- center: [255,255,255],
29
- center_width: 1
30
- },
31
- water: {
32
- fill: [40,80,120],
33
- stroke: [100,160,220]
34
- },
35
- park: {
36
- fill: [40,80,40]
37
- },
38
- order: [
39
- :water,
40
- :park,
41
- :street,
42
- :primary,
43
- :motorway,
44
- :rail
45
- ]
46
- )
47
- end
48
- end
49
- end
@@ -1,49 +0,0 @@
1
- module GD
2
- module GIS
3
- class Style
4
- LIGHT = Style.new(
5
- roads: {
6
- motorway: {
7
- stroke: [100,100,100],
8
- stroke_width: 10,
9
- fill: [245,245,245],
10
- fill_width: 6
11
- },
12
- primary: {
13
- stroke: [140,140,140],
14
- stroke_width: 7,
15
- fill: [240,240,240],
16
- fill_width: 4
17
- },
18
- street: {
19
- stroke: [220,220,220],
20
- stroke_width: 1
21
- }
22
- },
23
- rail: {
24
- stroke: [80,80,80],
25
- stroke_width: 6,
26
- fill: [230,70,70],
27
- fill_width: 4,
28
- center: [255,255,255],
29
- center_width: 1
30
- },
31
- water: {
32
- fill: [168,208,255],
33
- stroke: [120,180,240]
34
- },
35
- park: {
36
- fill: [205,238,203]
37
- },
38
- order: [
39
- :water,
40
- :park,
41
- :street,
42
- :primary,
43
- :motorway,
44
- :rail
45
- ]
46
- )
47
- end
48
- end
49
- end
@@ -1,49 +0,0 @@
1
- module GD
2
- module GIS
3
- class Style
4
- SOLARIZED = Style.new(
5
- roads: {
6
- motorway: {
7
- stroke: [7, 54, 66], # Base02
8
- stroke_width: 10,
9
- fill: [131, 148, 150], # Base0
10
- fill_width: 6
11
- },
12
- primary: {
13
- stroke: [88, 110, 117], # Base01
14
- stroke_width: 7,
15
- fill: [147, 161, 161], # Base1
16
- fill_width: 4
17
- },
18
- street: {
19
- stroke: [147, 161, 161], # Base1
20
- stroke_width: 1
21
- }
22
- },
23
- rails: {
24
- stroke: [203, 75, 22], # Orange
25
- stroke_width: 6,
26
- fill: [220, 50, 47], # Red
27
- fill_width: 4,
28
- center: [253, 246, 227], # Base3
29
- center_width: 1
30
- },
31
- water: {
32
- fill: [38, 139, 210], # Blue
33
- stroke: [42, 161, 152] # Cyan
34
- },
35
- parks: {
36
- fill: [133, 153, 0] # Green
37
- },
38
- order: [
39
- :water,
40
- :park,
41
- :street,
42
- :primary,
43
- :motorway,
44
- :rail
45
- ]
46
- )
47
- end
48
- end
49
- end