simpler-tiles 0.0.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.
Files changed (56) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +2 -0
  3. data/LICENSE +19 -0
  4. data/README +22 -0
  5. data/Rakefile +71 -0
  6. data/doc/SimplerTiles/Bounds.html +506 -0
  7. data/doc/SimplerTiles/Layer.html +593 -0
  8. data/doc/SimplerTiles/Map.html +2081 -0
  9. data/doc/SimplerTiles/PP.html +204 -0
  10. data/doc/SimplerTiles/Query.html +521 -0
  11. data/doc/SimplerTiles/Style.html +577 -0
  12. data/doc/SimplerTiles.html +167 -0
  13. data/doc/_index.html +188 -0
  14. data/doc/class_list.html +47 -0
  15. data/doc/css/common.css +1 -0
  16. data/doc/css/full_list.css +55 -0
  17. data/doc/css/style.css +322 -0
  18. data/doc/file.README.html +89 -0
  19. data/doc/file_list.html +49 -0
  20. data/doc/frames.html +13 -0
  21. data/doc/index.html +89 -0
  22. data/doc/js/app.js +205 -0
  23. data/doc/js/full_list.js +173 -0
  24. data/doc/js/jquery.js +16 -0
  25. data/doc/method_list.html +390 -0
  26. data/doc/top-level-namespace.html +105 -0
  27. data/ext/simpler_tiles/bounds.c +90 -0
  28. data/ext/simpler_tiles/bounds.h +17 -0
  29. data/ext/simpler_tiles/depend +7 -0
  30. data/ext/simpler_tiles/extconf.rb +42 -0
  31. data/ext/simpler_tiles/layer.c +93 -0
  32. data/ext/simpler_tiles/layer.h +16 -0
  33. data/ext/simpler_tiles/map.c +338 -0
  34. data/ext/simpler_tiles/map.h +17 -0
  35. data/ext/simpler_tiles/query.c +87 -0
  36. data/ext/simpler_tiles/query.h +17 -0
  37. data/ext/simpler_tiles/simpler_tiles.c +16 -0
  38. data/ext/simpler_tiles/simpler_tiles.h +25 -0
  39. data/ext/simpler_tiles/style.c +106 -0
  40. data/ext/simpler_tiles/style.h +17 -0
  41. data/index.erb +459 -0
  42. data/index.html +439 -0
  43. data/lib/simpler_tiles/bounds.rb +19 -0
  44. data/lib/simpler_tiles/layer.rb +25 -0
  45. data/lib/simpler_tiles/map.rb +55 -0
  46. data/lib/simpler_tiles/mixins/pp.rb +13 -0
  47. data/lib/simpler_tiles/query.rb +28 -0
  48. data/lib/simpler_tiles/style.rb +19 -0
  49. data/lib/simpler_tiles/version.rb +4 -0
  50. data/lib/simpler_tiles.rb +13 -0
  51. data/simpler-tiles-logo.png +0 -0
  52. data/simpler-tiles.gemspec +30 -0
  53. data/test/helper.rb +8 -0
  54. data/test/test_map.rb +67 -0
  55. data/test/test_simpler_tiles.rb +26 -0
  56. metadata +199 -0
@@ -0,0 +1,390 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+
7
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
+
9
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
10
+
11
+
12
+
13
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
+
17
+
18
+ <base id="base_target" target="_parent" />
19
+ </head>
20
+ <body>
21
+ <script type="text/javascript" charset="utf-8">
22
+ if (window.top.frames.main) {
23
+ document.getElementById('base_target').target = 'main';
24
+ document.body.className = 'frames';
25
+ }
26
+ </script>
27
+ <div id="content">
28
+ <h1 id="full_list_header">Method List</h1>
29
+ <div id="nav">
30
+
31
+ <a target="_self" href="class_list.html">Classes</a>
32
+
33
+ <a target="_self" href="method_list.html">Methods</a>
34
+
35
+ <a target="_self" href="file_list.html">Files</a>
36
+
37
+ </div>
38
+ <div id="search">Search: <input type="text" /></div>
39
+
40
+ <ul id="full_list" class="methods">
41
+
42
+
43
+ <li class="r1 ">
44
+ <span class='object_link'><a href="SimplerTiles/Map.html#add_layer-instance_method" title="SimplerTiles::Map#add_layer (method)">#add_layer</a></span>
45
+
46
+ <small>SimplerTiles::Map</small>
47
+
48
+ </li>
49
+
50
+
51
+ <li class="r2 ">
52
+ <span class='object_link'><a href="SimplerTiles/Layer.html#add_query-instance_method" title="SimplerTiles::Layer#add_query (method)">#add_query</a></span>
53
+
54
+ <small>SimplerTiles::Layer</small>
55
+
56
+ </li>
57
+
58
+
59
+ <li class="r1 ">
60
+ <span class='object_link'><a href="SimplerTiles/Query.html#add_style-instance_method" title="SimplerTiles::Query#add_style (method)">#add_style</a></span>
61
+
62
+ <small>SimplerTiles::Query</small>
63
+
64
+ </li>
65
+
66
+
67
+ <li class="r2 ">
68
+ <span class='object_link'><a href="SimplerTiles/Map.html#ar_layer-instance_method" title="SimplerTiles::Map#ar_layer (method)">#ar_layer</a></span>
69
+
70
+ <small>SimplerTiles::Map</small>
71
+
72
+ </li>
73
+
74
+
75
+ <li class="r1 ">
76
+ <span class='object_link'><a href="SimplerTiles/Style.html#arg-instance_method" title="SimplerTiles::Style#arg (method)">#arg</a></span>
77
+
78
+ <small>SimplerTiles::Style</small>
79
+
80
+ </li>
81
+
82
+
83
+ <li class="r2 ">
84
+ <span class='object_link'><a href="SimplerTiles/Style.html#arg%3D-instance_method" title="SimplerTiles::Style#arg= (method)">#arg=</a></span>
85
+
86
+ <small>SimplerTiles::Style</small>
87
+
88
+ </li>
89
+
90
+
91
+ <li class="r1 ">
92
+ <span class='object_link'><a href="SimplerTiles/Map.html#bgcolor-instance_method" title="SimplerTiles::Map#bgcolor (method)">#bgcolor</a></span>
93
+
94
+ <small>SimplerTiles::Map</small>
95
+
96
+ </li>
97
+
98
+
99
+ <li class="r2 ">
100
+ <span class='object_link'><a href="SimplerTiles/Map.html#bgcolor%3D-instance_method" title="SimplerTiles::Map#bgcolor= (method)">#bgcolor=</a></span>
101
+
102
+ <small>SimplerTiles::Map</small>
103
+
104
+ </li>
105
+
106
+
107
+ <li class="r1 ">
108
+ <span class='object_link'><a href="SimplerTiles/Map.html#bounds-instance_method" title="SimplerTiles::Map#bounds (method)">#bounds</a></span>
109
+
110
+ <small>SimplerTiles::Map</small>
111
+
112
+ </li>
113
+
114
+
115
+ <li class="r2 ">
116
+ <span class='object_link'><a href="SimplerTiles/Map.html#buffer-instance_method" title="SimplerTiles::Map#buffer (method)">#buffer</a></span>
117
+
118
+ <small>SimplerTiles::Map</small>
119
+
120
+ </li>
121
+
122
+
123
+ <li class="r1 ">
124
+ <span class='object_link'><a href="SimplerTiles/Map.html#buffer%3D-instance_method" title="SimplerTiles::Map#buffer= (method)">#buffer=</a></span>
125
+
126
+ <small>SimplerTiles::Map</small>
127
+
128
+ </li>
129
+
130
+
131
+ <li class="r2 ">
132
+ <span class='object_link'><a href="SimplerTiles/Map.html#buffered_bounds-instance_method" title="SimplerTiles::Map#buffered_bounds (method)">#buffered_bounds</a></span>
133
+
134
+ <small>SimplerTiles::Map</small>
135
+
136
+ </li>
137
+
138
+
139
+ <li class="r1 ">
140
+ <span class='object_link'><a href="SimplerTiles/Bounds.html#grow-instance_method" title="SimplerTiles::Bounds#grow (method)">#grow</a></span>
141
+
142
+ <small>SimplerTiles::Bounds</small>
143
+
144
+ </li>
145
+
146
+
147
+ <li class="r2 ">
148
+ <span class='object_link'><a href="SimplerTiles/Map.html#height-instance_method" title="SimplerTiles::Map#height (method)">#height</a></span>
149
+
150
+ <small>SimplerTiles::Map</small>
151
+
152
+ </li>
153
+
154
+
155
+ <li class="r1 ">
156
+ <span class='object_link'><a href="SimplerTiles/Map.html#height%3D-instance_method" title="SimplerTiles::Map#height= (method)">#height=</a></span>
157
+
158
+ <small>SimplerTiles::Map</small>
159
+
160
+ </li>
161
+
162
+
163
+ <li class="r2 ">
164
+ <span class='object_link'><a href="SimplerTiles/Layer.html#initialize-instance_method" title="SimplerTiles::Layer#initialize (method)">#initialize</a></span>
165
+
166
+ <small>SimplerTiles::Layer</small>
167
+
168
+ </li>
169
+
170
+
171
+ <li class="r1 ">
172
+ <span class='object_link'><a href="SimplerTiles/Query.html#initialize-instance_method" title="SimplerTiles::Query#initialize (method)">#initialize</a></span>
173
+
174
+ <small>SimplerTiles::Query</small>
175
+
176
+ </li>
177
+
178
+
179
+ <li class="r2 ">
180
+ <span class='object_link'><a href="SimplerTiles/Map.html#initialize-instance_method" title="SimplerTiles::Map#initialize (method)">#initialize</a></span>
181
+
182
+ <small>SimplerTiles::Map</small>
183
+
184
+ </li>
185
+
186
+
187
+ <li class="r1 ">
188
+ <span class='object_link'><a href="SimplerTiles/Bounds.html#initialize-instance_method" title="SimplerTiles::Bounds#initialize (method)">#initialize</a></span>
189
+
190
+ <small>SimplerTiles::Bounds</small>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="r2 ">
196
+ <span class='object_link'><a href="SimplerTiles/Style.html#initialize-instance_method" title="SimplerTiles::Style#initialize (method)">#initialize</a></span>
197
+
198
+ <small>SimplerTiles::Style</small>
199
+
200
+ </li>
201
+
202
+
203
+ <li class="r1 ">
204
+ <span class='object_link'><a href="SimplerTiles/PP.html#inspect-instance_method" title="SimplerTiles::PP#inspect (method)">#inspect</a></span>
205
+
206
+ <small>SimplerTiles::PP</small>
207
+
208
+ </li>
209
+
210
+
211
+ <li class="r2 ">
212
+ <span class='object_link'><a href="SimplerTiles/Style.html#key-instance_method" title="SimplerTiles::Style#key (method)">#key</a></span>
213
+
214
+ <small>SimplerTiles::Style</small>
215
+
216
+ </li>
217
+
218
+
219
+ <li class="r1 ">
220
+ <span class='object_link'><a href="SimplerTiles/Style.html#key%3D-instance_method" title="SimplerTiles::Style#key= (method)">#key=</a></span>
221
+
222
+ <small>SimplerTiles::Style</small>
223
+
224
+ </li>
225
+
226
+
227
+ <li class="r2 ">
228
+ <span class='object_link'><a href="SimplerTiles/Map.html#layer-instance_method" title="SimplerTiles::Map#layer (method)">#layer</a></span>
229
+
230
+ <small>SimplerTiles::Map</small>
231
+
232
+ </li>
233
+
234
+
235
+ <li class="r1 ">
236
+ <span class='object_link'><a href="SimplerTiles/Query.html#query-instance_method" title="SimplerTiles::Query#query (method)">#query</a></span>
237
+
238
+ <small>SimplerTiles::Query</small>
239
+
240
+ </li>
241
+
242
+
243
+ <li class="r2 ">
244
+ <span class='object_link'><a href="SimplerTiles/Layer.html#query-instance_method" title="SimplerTiles::Layer#query (method)">#query</a></span>
245
+
246
+ <small>SimplerTiles::Layer</small>
247
+
248
+ </li>
249
+
250
+
251
+ <li class="r1 ">
252
+ <span class='object_link'><a href="SimplerTiles/Query.html#query%3D-instance_method" title="SimplerTiles::Query#query= (method)">#query=</a></span>
253
+
254
+ <small>SimplerTiles::Query</small>
255
+
256
+ </li>
257
+
258
+
259
+ <li class="r2 ">
260
+ <span class='object_link'><a href="SimplerTiles/Bounds.html#reproject-instance_method" title="SimplerTiles::Bounds#reproject (method)">#reproject</a></span>
261
+
262
+ <small>SimplerTiles::Bounds</small>
263
+
264
+ </li>
265
+
266
+
267
+ <li class="r1 ">
268
+ <span class='object_link'><a href="SimplerTiles/Map.html#save-instance_method" title="SimplerTiles::Map#save (method)">#save</a></span>
269
+
270
+ <small>SimplerTiles::Map</small>
271
+
272
+ </li>
273
+
274
+
275
+ <li class="r2 ">
276
+ <span class='object_link'><a href="SimplerTiles/Map.html#set_bounds-instance_method" title="SimplerTiles::Map#set_bounds (method)">#set_bounds</a></span>
277
+
278
+ <small>SimplerTiles::Map</small>
279
+
280
+ </li>
281
+
282
+
283
+ <li class="r1 ">
284
+ <span class='object_link'><a href="SimplerTiles/Map.html#set_size-instance_method" title="SimplerTiles::Map#set_size (method)">#set_size</a></span>
285
+
286
+ <small>SimplerTiles::Map</small>
287
+
288
+ </li>
289
+
290
+
291
+ <li class="r2 ">
292
+ <span class='object_link'><a href="SimplerTiles/Map.html#slippy-instance_method" title="SimplerTiles::Map#slippy (method)">#slippy</a></span>
293
+
294
+ <small>SimplerTiles::Map</small>
295
+
296
+ </li>
297
+
298
+
299
+ <li class="r1 ">
300
+ <span class='object_link'><a href="SimplerTiles/Layer.html#source-instance_method" title="SimplerTiles::Layer#source (method)">#source</a></span>
301
+
302
+ <small>SimplerTiles::Layer</small>
303
+
304
+ </li>
305
+
306
+
307
+ <li class="r2 ">
308
+ <span class='object_link'><a href="SimplerTiles/Layer.html#source%3D-instance_method" title="SimplerTiles::Layer#source= (method)">#source=</a></span>
309
+
310
+ <small>SimplerTiles::Layer</small>
311
+
312
+ </li>
313
+
314
+
315
+ <li class="r1 ">
316
+ <span class='object_link'><a href="SimplerTiles/Map.html#srs-instance_method" title="SimplerTiles::Map#srs (method)">#srs</a></span>
317
+
318
+ <small>SimplerTiles::Map</small>
319
+
320
+ </li>
321
+
322
+
323
+ <li class="r2 ">
324
+ <span class='object_link'><a href="SimplerTiles/Map.html#srs%3D-instance_method" title="SimplerTiles::Map#srs= (method)">#srs=</a></span>
325
+
326
+ <small>SimplerTiles::Map</small>
327
+
328
+ </li>
329
+
330
+
331
+ <li class="r1 ">
332
+ <span class='object_link'><a href="SimplerTiles/Query.html#styles-instance_method" title="SimplerTiles::Query#styles (method)">#styles</a></span>
333
+
334
+ <small>SimplerTiles::Query</small>
335
+
336
+ </li>
337
+
338
+
339
+ <li class="r2 ">
340
+ <span class='object_link'><a href="SimplerTiles/Map.html#to_png-instance_method" title="SimplerTiles::Map#to_png (method)">#to_png</a></span>
341
+
342
+ <small>SimplerTiles::Map</small>
343
+
344
+ </li>
345
+
346
+
347
+ <li class="r1 ">
348
+ <span class='object_link'><a href="SimplerTiles/Map.html#to_png_stream-instance_method" title="SimplerTiles::Map#to_png_stream (method)">#to_png_stream</a></span>
349
+
350
+ <small>SimplerTiles::Map</small>
351
+
352
+ </li>
353
+
354
+
355
+ <li class="r2 ">
356
+ <span class='object_link'><a href="SimplerTiles/Bounds.html#to_wkt-instance_method" title="SimplerTiles::Bounds#to_wkt (method)">#to_wkt</a></span>
357
+
358
+ <small>SimplerTiles::Bounds</small>
359
+
360
+ </li>
361
+
362
+
363
+ <li class="r1 ">
364
+ <span class='object_link'><a href="SimplerTiles/Map.html#valid%3F-instance_method" title="SimplerTiles::Map#valid? (method)">#valid?</a></span>
365
+
366
+ <small>SimplerTiles::Map</small>
367
+
368
+ </li>
369
+
370
+
371
+ <li class="r2 ">
372
+ <span class='object_link'><a href="SimplerTiles/Map.html#width-instance_method" title="SimplerTiles::Map#width (method)">#width</a></span>
373
+
374
+ <small>SimplerTiles::Map</small>
375
+
376
+ </li>
377
+
378
+
379
+ <li class="r1 ">
380
+ <span class='object_link'><a href="SimplerTiles/Map.html#width%3D-instance_method" title="SimplerTiles::Map#width= (method)">#width=</a></span>
381
+
382
+ <small>SimplerTiles::Map</small>
383
+
384
+ </li>
385
+
386
+
387
+ </ul>
388
+ </div>
389
+ </body>
390
+ </html>
@@ -0,0 +1,105 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.7.5
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="_index.html">Index</a> &raquo;
37
+
38
+
39
+ <span class="title">Top Level Namespace</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Top Level Namespace
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ </dl>
75
+ <div class="clear"></div>
76
+
77
+ <h2>Defined Under Namespace</h2>
78
+ <p class="children">
79
+
80
+
81
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="SimplerTiles.html" title="SimplerTiles (module)">SimplerTiles</a></span>
82
+
83
+
84
+
85
+
86
+ </p>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ </div>
97
+
98
+ <div id="footer">
99
+ Generated on Wed Mar 7 20:33:23 2012 by
100
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
101
+ 0.7.5 (ruby-1.8.7).
102
+ </div>
103
+
104
+ </body>
105
+ </html>
@@ -0,0 +1,90 @@
1
+ #include "bounds.h"
2
+ #include <simple-tiles/bounds.h>
3
+
4
+ VALUE cSimplerTilesBounds;
5
+
6
+ static simplet_bounds_t*
7
+ get_bounds(VALUE self){
8
+ simplet_bounds_t *bounds;
9
+ Data_Get_Struct(self, simplet_bounds_t, bounds);
10
+ return bounds;
11
+ }
12
+
13
+
14
+ /*
15
+ Return a WKT representation of the bounds.
16
+
17
+ @return [String]
18
+ */
19
+ static VALUE
20
+ to_wkt(VALUE self){
21
+ simplet_bounds_t *bounds = get_bounds(self);
22
+ char *wkt = NULL;
23
+
24
+ if(simplet_bounds_to_wkt(bounds, &wkt) != SIMPLET_OK)
25
+ rb_raise(rb_eRuntimeError, "Error in creating wkt string.");
26
+
27
+ return rb_str_new2(wkt);
28
+ }
29
+
30
+ /*
31
+ Extend the bounds to include the point defined by x, y.
32
+
33
+ @param [Number, Number]
34
+ @return [Bounds]
35
+ */
36
+ static VALUE
37
+ grow(VALUE self, VALUE x, VALUE y){
38
+ simplet_bounds_t *bounds = get_bounds(self);
39
+ simplet_bounds_extend(bounds, NUM2DBL(x), NUM2DBL(y));
40
+ return self;
41
+ }
42
+
43
+ /*
44
+ Reproject the bounds from <tt>from_proj</tt> to new projection
45
+ <tt>to_proj</tt>. Returns a new bounds object.
46
+
47
+ @param [String, String]
48
+ @return [Bounds]
49
+ */
50
+ static VALUE
51
+ reproject(VALUE self, VALUE from, VALUE to) {
52
+ Check_Type(from, T_STRING);
53
+ Check_Type(to, T_STRING);
54
+ simplet_bounds_t *bounds;
55
+ if(!(bounds = simplet_bounds_reproject(get_bounds(self), RSTRING_PTR(from), RSTRING_PTR(to))))
56
+ rb_raise(rb_eRuntimeError, "Error in creating bounds.");
57
+
58
+ VALUE id = rb_intern("new");
59
+
60
+ VALUE rbounds = rb_funcall(cSimplerTilesBounds, id, 4,
61
+ rb_float_new(bounds->nw.x),
62
+ rb_float_new(bounds->nw.y),
63
+ rb_float_new(bounds->se.x),
64
+ rb_float_new(bounds->se.y));
65
+
66
+ simplet_bounds_free(bounds);
67
+ return rbounds;
68
+ }
69
+
70
+ static VALUE
71
+ alloc_bounds(VALUE self){
72
+ simplet_bounds_t *bounds;
73
+ VALUE args[4];
74
+ if(!(bounds = simplet_bounds_new()))
75
+ rb_raise(rb_eRuntimeError, "Error in creating bounds.");
76
+
77
+ VALUE rbounds = Data_Wrap_Struct(self, NULL, simplet_bounds_free, bounds);
78
+ return rbounds;
79
+ }
80
+
81
+ void
82
+ init_bounds(){
83
+ VALUE rbounds = rb_define_class_under(mSimplerTiles, "Bounds", rb_cObject);
84
+ rb_define_alloc_func(rbounds, alloc_bounds);
85
+ rb_define_method(rbounds, "to_wkt", to_wkt, 0);
86
+ rb_define_method(rbounds, "grow", grow, 2);
87
+ rb_define_method(rbounds, "reproject", reproject, 2);
88
+ cSimplerTilesBounds = rbounds;
89
+ }
90
+
@@ -0,0 +1,17 @@
1
+ #ifndef _SIMPLER_BOUNDS_H
2
+ #define _SIMPLER_BOUNDS_H
3
+
4
+ #include "simpler_tiles.h"
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ void init_bounds();
11
+ extern VALUE cSimplerTilesBounds;
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
17
+ #endif
@@ -0,0 +1,7 @@
1
+ bounds.o: bounds.c bounds.h simpler_tiles.h map.h layer.h query.h style.h
2
+ layer.o: layer.c layer.h simpler_tiles.h map.h bounds.h query.h style.h
3
+ map.o: map.c map.h simpler_tiles.h bounds.h layer.h query.h style.h
4
+ query.o: query.c query.h simpler_tiles.h map.h bounds.h layer.h style.h
5
+ simpler_tiles.o: simpler_tiles.c simpler_tiles.h map.h bounds.h layer.h \
6
+ query.h style.h
7
+ style.o: style.c style.h simpler_tiles.h map.h bounds.h layer.h query.h
@@ -0,0 +1,42 @@
1
+ require 'mkmf'
2
+
3
+ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
4
+
5
+ ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
6
+ LIBDIR = Config::CONFIG['libdir']
7
+ INCLUDEDIR = Config::CONFIG['includedir']
8
+
9
+ $CFLAGS << " #{ENV["CFLAGS"]}" << `pkg-config --cflags simple-tiles pangocairo`.chomp << `gdal-config --cflags`.chomp
10
+ $LIBS << " #{ENV["LIBS"]}" << `pkg-config --libs simple-tiles pangocairo`.chomp << `gdal-config --libs`
11
+
12
+ HEADER_DIRS = [
13
+ '/usr/local/include',
14
+ '/usr/X11/include',
15
+ INCLUDEDIR,
16
+ '/usr/include'
17
+ ]
18
+
19
+ LIB_DIRS = [
20
+ '/usr/local/lib',
21
+ '/usr/X11/lib',
22
+ LIBDIR,
23
+ '/usr/lib',
24
+ ]
25
+
26
+ dir_config('cairo', HEADER_DIRS, LIB_DIRS)
27
+ dir_config('pango', HEADER_DIRS, LIB_DIRS)
28
+ dir_config('simple-tiles', HEADER_DIRS, LIB_DIRS)
29
+
30
+ def missing(lib)
31
+ abort "Could not find #{lib}, you may have to change your load path."
32
+ end
33
+
34
+ missing "cairo" unless find_library "cairo", "cairo_surface_write_to_png_stream"
35
+ missing "simple-tiles" unless find_library "simple-tiles", "simplet_map_render_to_stream"
36
+ missing "gdal" unless find_header "ogr_api.h"
37
+ missing "gdal" unless find_header "ogr_srs_api.h"
38
+ missing "cairo" unless find_header "cairo/cairo.h"
39
+ missing "pango" unless find_header "pango/pangocairo.h"
40
+ missing "simple-tiles" unless find_header "simple-tiles/simple_tiles.h"
41
+
42
+ create_makefile('simpler_tiles/simpler_tiles')