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.
- data/.gitignore +17 -0
- data/Gemfile +2 -0
- data/LICENSE +19 -0
- data/README +22 -0
- data/Rakefile +71 -0
- data/doc/SimplerTiles/Bounds.html +506 -0
- data/doc/SimplerTiles/Layer.html +593 -0
- data/doc/SimplerTiles/Map.html +2081 -0
- data/doc/SimplerTiles/PP.html +204 -0
- data/doc/SimplerTiles/Query.html +521 -0
- data/doc/SimplerTiles/Style.html +577 -0
- data/doc/SimplerTiles.html +167 -0
- data/doc/_index.html +188 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +89 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +89 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +390 -0
- data/doc/top-level-namespace.html +105 -0
- data/ext/simpler_tiles/bounds.c +90 -0
- data/ext/simpler_tiles/bounds.h +17 -0
- data/ext/simpler_tiles/depend +7 -0
- data/ext/simpler_tiles/extconf.rb +42 -0
- data/ext/simpler_tiles/layer.c +93 -0
- data/ext/simpler_tiles/layer.h +16 -0
- data/ext/simpler_tiles/map.c +338 -0
- data/ext/simpler_tiles/map.h +17 -0
- data/ext/simpler_tiles/query.c +87 -0
- data/ext/simpler_tiles/query.h +17 -0
- data/ext/simpler_tiles/simpler_tiles.c +16 -0
- data/ext/simpler_tiles/simpler_tiles.h +25 -0
- data/ext/simpler_tiles/style.c +106 -0
- data/ext/simpler_tiles/style.h +17 -0
- data/index.erb +459 -0
- data/index.html +439 -0
- data/lib/simpler_tiles/bounds.rb +19 -0
- data/lib/simpler_tiles/layer.rb +25 -0
- data/lib/simpler_tiles/map.rb +55 -0
- data/lib/simpler_tiles/mixins/pp.rb +13 -0
- data/lib/simpler_tiles/query.rb +28 -0
- data/lib/simpler_tiles/style.rb +19 -0
- data/lib/simpler_tiles/version.rb +4 -0
- data/lib/simpler_tiles.rb +13 -0
- data/simpler-tiles-logo.png +0 -0
- data/simpler-tiles.gemspec +30 -0
- data/test/helper.rb +8 -0
- data/test/test_map.rb +67 -0
- data/test/test_simpler_tiles.rb +26 -0
- metadata +199 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2012, ProPublica
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is furnished
|
8
|
+
to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
+
IN THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
=
|
2
|
+
|
3
|
+
+-----------------------------+
|
4
|
+
| / ~|
|
5
|
+
| ---------- /|
|
6
|
+
| Simpler / --------- |
|
7
|
+
| / ~ / ** |
|
8
|
+
| / / **** |
|
9
|
+
| ---- ~ / ****** |
|
10
|
+
| / ~~ -- ******* |
|
11
|
+
| / / ***** |
|
12
|
+
| / / |
|
13
|
+
| / ~~ / Tiles |
|
14
|
+
|- / |
|
15
|
+
| ~~~ / |
|
16
|
+
+-----------------------------+
|
17
|
+
|
18
|
+
Simpler Tiles is the ruby bindings to Simple Tiles, a library for generating
|
19
|
+
images from geo spatial data sources.
|
20
|
+
|
21
|
+
Documentation: http://propublica.github.com/simpler-tiles/
|
22
|
+
Issues or questions: https://github.com/propublica/simpler-tiles/issues
|
data/Rakefile
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
|
6
|
+
begin
|
7
|
+
Bundler.setup(:default, :development, :test)
|
8
|
+
rescue Bundler::BundlerError => e
|
9
|
+
$stderr.puts e.message
|
10
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
11
|
+
exit e.status_code
|
12
|
+
end
|
13
|
+
Bundler::GemHelper.install_tasks
|
14
|
+
require 'rake'
|
15
|
+
require 'yard'
|
16
|
+
|
17
|
+
YARD::Rake::YardocTask.new
|
18
|
+
|
19
|
+
|
20
|
+
require 'erb'
|
21
|
+
task :doc do |t|
|
22
|
+
File.open("index.html", 'w').write ERB.new(File.open("index.erb").read).result(binding)
|
23
|
+
end
|
24
|
+
|
25
|
+
task :publish do |t|
|
26
|
+
`git checkout gh-pages`
|
27
|
+
`git merge master`
|
28
|
+
`git push`
|
29
|
+
`git checkout master`
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
require 'rake/testtask'
|
34
|
+
Rake::TestTask.new(:test) do |test|
|
35
|
+
test.libs << 'lib' << 'test'
|
36
|
+
test.pattern = 'test/**/test_*.rb'
|
37
|
+
test.verbose = true
|
38
|
+
end
|
39
|
+
|
40
|
+
task :default => :test
|
41
|
+
|
42
|
+
require 'rake/extensiontask'
|
43
|
+
Rake::ExtensionTask.new('simpler_tiles') do |ext|
|
44
|
+
ext.lib_dir = File.join('lib', 'simpler_tiles')
|
45
|
+
end
|
46
|
+
|
47
|
+
DEPEND = "ext/simpler_tiles/depend"
|
48
|
+
file DEPEND => FileList["ext/simpler_tiles/*.c"] do |t|
|
49
|
+
`cd ext/simpler_tiles/; gcc -MM *.c > depend`
|
50
|
+
end
|
51
|
+
|
52
|
+
DATA = "data/tl_2010_us_state10.shp"
|
53
|
+
file DATA do |t|
|
54
|
+
if !File.exists? t.name
|
55
|
+
require 'fileutils'
|
56
|
+
FileUtils.mkdir_p "data"
|
57
|
+
tasks = []
|
58
|
+
tasks << 'cd data'
|
59
|
+
tasks << 'curl -O ftp://ftp2.census.gov/geo/tiger/TIGER2010/STATE/2010/tl_2010_us_state10.zip'
|
60
|
+
tasks << 'unzip tl_2010_us_state10.zip'
|
61
|
+
`#{tasks.join ';'}`
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
Rake::Task[:compile].prerequisites.unshift DEPEND
|
66
|
+
Rake::Task[:test].prerequisites.unshift DATA
|
67
|
+
Rake::Task[:test].prerequisites.unshift :compile
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
@@ -0,0 +1,506 @@
|
|
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
|
+
Class: SimplerTiles::Bounds
|
8
|
+
|
9
|
+
— 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 (B)</a> »
|
37
|
+
<span class='title'><span class='object_link'><a href="../SimplerTiles.html" title="SimplerTiles (module)">SimplerTiles</a></span></span>
|
38
|
+
»
|
39
|
+
<span class="title">Bounds</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>Class: SimplerTiles::Bounds
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
<dt class="r1">Inherits:</dt>
|
68
|
+
<dd class="r1">
|
69
|
+
<span class="inheritName">Object</span>
|
70
|
+
|
71
|
+
<ul class="fullTree">
|
72
|
+
<li>Object</li>
|
73
|
+
|
74
|
+
<li class="next">SimplerTiles::Bounds</li>
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
78
|
+
|
79
|
+
</dd>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
<dt class="r2">Includes:</dt>
|
87
|
+
<dd class="r2"><span class='object_link'><a href="PP.html" title="SimplerTiles::PP (module)">PP</a></span></dd>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<dt class="r1 last">Defined in:</dt>
|
94
|
+
<dd class="r1 last">lib/simpler_tiles/bounds.rb<span class="defines">,<br />
|
95
|
+
ext/simpler_tiles/bounds.c</span>
|
96
|
+
</dd>
|
97
|
+
|
98
|
+
</dl>
|
99
|
+
<div class="clear"></div>
|
100
|
+
|
101
|
+
<h2>Overview</h2><div class="docstring">
|
102
|
+
<div class="discussion">
|
103
|
+
<p>
|
104
|
+
Each Bounds represents a rectangular box, for <span class='object_link'><a href="Map.html" title="SimplerTiles::Map (class)">Map</a></span> objects they define the
|
105
|
+
boundary of the data to return from each <span class='object_link'><a href="Layer.html" title="SimplerTiles::Layer (class)">Layer</a></span>.
|
106
|
+
</p>
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
<div class="tags">
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<h2>
|
123
|
+
Instance Method Summary
|
124
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
125
|
+
</h2>
|
126
|
+
|
127
|
+
<ul class="summary">
|
128
|
+
|
129
|
+
<li class="public ">
|
130
|
+
<span class="summary_signature">
|
131
|
+
|
132
|
+
<a href="#grow-instance_method" title="#grow (instance method)">- (Bounds) <strong>grow</strong> </a>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
</span>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'><p>
|
146
|
+
Extend the bounds to include the point defined by x, y.
|
147
|
+
</p>
|
148
|
+
</div></span>
|
149
|
+
|
150
|
+
</li>
|
151
|
+
|
152
|
+
|
153
|
+
<li class="public ">
|
154
|
+
<span class="summary_signature">
|
155
|
+
|
156
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Bounds) <strong>initialize</strong>(maxx, maxy, minx, miny) </a>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
</span>
|
161
|
+
|
162
|
+
<span class="note title constructor">constructor</span>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'><p>
|
172
|
+
Initialize a bounds from max and min coordinates.
|
173
|
+
</p>
|
174
|
+
</div></span>
|
175
|
+
|
176
|
+
</li>
|
177
|
+
|
178
|
+
|
179
|
+
<li class="public ">
|
180
|
+
<span class="summary_signature">
|
181
|
+
|
182
|
+
<a href="#reproject-instance_method" title="#reproject (instance method)">- (Bounds) <strong>reproject</strong> </a>
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
</span>
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
<span class="summary_desc"><div class='inline'><p>
|
196
|
+
Reproject the bounds from <tt>from_proj</tt> to new projection
|
197
|
+
<tt>to_proj</tt>.
|
198
|
+
</p>
|
199
|
+
</div></span>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
<li class="public ">
|
205
|
+
<span class="summary_signature">
|
206
|
+
|
207
|
+
<a href="#to_wkt-instance_method" title="#to_wkt (instance method)">- (String) <strong>to_wkt</strong> </a>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<span class="summary_desc"><div class='inline'><p>
|
221
|
+
Return a WKT representation of the bounds.
|
222
|
+
</p>
|
223
|
+
</div></span>
|
224
|
+
|
225
|
+
</li>
|
226
|
+
|
227
|
+
|
228
|
+
</ul>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="PP.html" title="SimplerTiles::PP (module)">PP</a></span></h3>
|
240
|
+
<p class="inherited"><span class='object_link'><a href="PP.html#inspect-instance_method" title="SimplerTiles::PP#inspect (method)">#inspect</a></span></p>
|
241
|
+
<div id="constructor_details" class="method_details_list">
|
242
|
+
<h2>Constructor Details</h2>
|
243
|
+
|
244
|
+
<div class="method_details first">
|
245
|
+
<p class="signature first" id="initialize-instance_method">
|
246
|
+
|
247
|
+
- (<tt><span class='object_link'><a href="" title="SimplerTiles::Bounds (class)">Bounds</a></span></tt>) <strong>initialize</strong>(maxx, maxy, minx, miny)
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
</p><div class="docstring">
|
252
|
+
<div class="discussion">
|
253
|
+
<p>
|
254
|
+
Initialize a bounds from max and min coordinates
|
255
|
+
</p>
|
256
|
+
|
257
|
+
|
258
|
+
</div>
|
259
|
+
</div>
|
260
|
+
<div class="tags">
|
261
|
+
|
262
|
+
|
263
|
+
</div><table class="source_code">
|
264
|
+
<tr>
|
265
|
+
<td>
|
266
|
+
<pre class="lines">
|
267
|
+
|
268
|
+
|
269
|
+
8
|
270
|
+
9
|
271
|
+
10
|
272
|
+
11</pre>
|
273
|
+
</td>
|
274
|
+
<td>
|
275
|
+
<pre class="code"><span class="info file"># File 'lib/simpler_tiles/bounds.rb', line 8</span>
|
276
|
+
|
277
|
+
<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_maxx identifier id'>maxx</span><span class='comma token'>,</span> <span class='rubyid_maxy identifier id'>maxy</span><span class='comma token'>,</span> <span class='rubyid_minx identifier id'>minx</span><span class='comma token'>,</span> <span class='rubyid_miny identifier id'>miny</span><span class='rparen token'>)</span>
|
278
|
+
<span class='rubyid_grow identifier id'>grow</span> <span class='rubyid_maxx identifier id'>maxx</span><span class='comma token'>,</span> <span class='rubyid_maxy identifier id'>maxy</span>
|
279
|
+
<span class='rubyid_grow identifier id'>grow</span> <span class='rubyid_minx identifier id'>minx</span><span class='comma token'>,</span> <span class='rubyid_miny identifier id'>miny</span>
|
280
|
+
<span class='rubyid_end end kw'>end</span>
|
281
|
+
</pre>
|
282
|
+
</td>
|
283
|
+
</tr>
|
284
|
+
</table>
|
285
|
+
</div>
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
|
290
|
+
<div id="instance_method_details" class="method_details_list">
|
291
|
+
<h2>Instance Method Details</h2>
|
292
|
+
|
293
|
+
|
294
|
+
<div class="method_details first">
|
295
|
+
<p class="signature first" id="grow-instance_method">
|
296
|
+
|
297
|
+
- (<tt><span class='object_link'><a href="" title="SimplerTiles::Bounds (class)">Bounds</a></span></tt>) <strong>grow</strong>
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
</p><div class="docstring">
|
302
|
+
<div class="discussion">
|
303
|
+
<p>
|
304
|
+
Extend the bounds to include the point defined by x, y.
|
305
|
+
</p>
|
306
|
+
|
307
|
+
|
308
|
+
</div>
|
309
|
+
</div>
|
310
|
+
<div class="tags">
|
311
|
+
<h3>Parameters:</h3>
|
312
|
+
<ul class="param">
|
313
|
+
|
314
|
+
<li>
|
315
|
+
|
316
|
+
<span class='name'></span>
|
317
|
+
|
318
|
+
|
319
|
+
<span class='type'>(<tt>Number</tt>, <tt>Number</tt>)</span>
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
</li>
|
324
|
+
|
325
|
+
</ul>
|
326
|
+
|
327
|
+
<h3>Returns:</h3>
|
328
|
+
<ul class="return">
|
329
|
+
|
330
|
+
<li>
|
331
|
+
|
332
|
+
|
333
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="SimplerTiles::Bounds (class)">Bounds</a></span></tt>)</span>
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
</li>
|
338
|
+
|
339
|
+
</ul>
|
340
|
+
|
341
|
+
</div><table class="source_code">
|
342
|
+
<tr>
|
343
|
+
<td>
|
344
|
+
<pre class="lines">
|
345
|
+
|
346
|
+
|
347
|
+
</pre>
|
348
|
+
</td>
|
349
|
+
<td>
|
350
|
+
<pre class="code"><span class="info file"># File 'ext/simpler_tiles/bounds.c'</span>
|
351
|
+
|
352
|
+
<span class='rubyid_static identifier id'>static</span> <span class='rubyid_VALUE constant id'>VALUE</span>
|
353
|
+
<span class='rubyid_grow identifier id'>grow</span><span class='lparen token'>(</span><span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_self self kw'>self</span><span class='comma token'>,</span> <span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_x identifier id'>x</span><span class='comma token'>,</span> <span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_y identifier id'>y</span><span class='rparen token'>)</span><span class='lbrace token'>{</span>
|
354
|
+
</pre>
|
355
|
+
</td>
|
356
|
+
</tr>
|
357
|
+
</table>
|
358
|
+
</div>
|
359
|
+
|
360
|
+
<div class="method_details ">
|
361
|
+
<p class="signature " id="reproject-instance_method">
|
362
|
+
|
363
|
+
- (<tt><span class='object_link'><a href="" title="SimplerTiles::Bounds (class)">Bounds</a></span></tt>) <strong>reproject</strong>
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
</p><div class="docstring">
|
368
|
+
<div class="discussion">
|
369
|
+
<p>
|
370
|
+
Reproject the bounds from <tt>from_proj</tt> to new projection
|
371
|
+
<tt>to_proj</tt>. Returns a new bounds object.
|
372
|
+
</p>
|
373
|
+
|
374
|
+
|
375
|
+
</div>
|
376
|
+
</div>
|
377
|
+
<div class="tags">
|
378
|
+
<h3>Parameters:</h3>
|
379
|
+
<ul class="param">
|
380
|
+
|
381
|
+
<li>
|
382
|
+
|
383
|
+
<span class='name'></span>
|
384
|
+
|
385
|
+
|
386
|
+
<span class='type'>(<tt>String</tt>, <tt>String</tt>)</span>
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
</li>
|
391
|
+
|
392
|
+
</ul>
|
393
|
+
|
394
|
+
<h3>Returns:</h3>
|
395
|
+
<ul class="return">
|
396
|
+
|
397
|
+
<li>
|
398
|
+
|
399
|
+
|
400
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="SimplerTiles::Bounds (class)">Bounds</a></span></tt>)</span>
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
</li>
|
405
|
+
|
406
|
+
</ul>
|
407
|
+
|
408
|
+
</div><table class="source_code">
|
409
|
+
<tr>
|
410
|
+
<td>
|
411
|
+
<pre class="lines">
|
412
|
+
|
413
|
+
|
414
|
+
</pre>
|
415
|
+
</td>
|
416
|
+
<td>
|
417
|
+
<pre class="code"><span class="info file"># File 'ext/simpler_tiles/bounds.c'</span>
|
418
|
+
|
419
|
+
<span class='rubyid_static identifier id'>static</span> <span class='rubyid_VALUE constant id'>VALUE</span>
|
420
|
+
<span class='rubyid_reproject identifier id'>reproject</span><span class='lparen token'>(</span><span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_self self kw'>self</span><span class='comma token'>,</span> <span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_from identifier id'>from</span><span class='comma token'>,</span> <span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_to identifier id'>to</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
|
421
|
+
<span class='rubyid_Check_Type constant id'>Check_Type</span><span class='lparen token'>(</span><span class='rubyid_from identifier id'>from</span><span class='comma token'>,</span> <span class='rubyid_T_STRING constant id'>T_STRING</span><span class='rparen token'>)</span><span class='semicolon token'>;</span>
|
422
|
+
<span class='rubyid_Check_Type constant id'>Check_Type</span><span class='lparen token'>(</span><span class='rubyid_to identifier id'>to</span><span class='comma token'>,</span> <span class='rubyid_T_STRING constant id'>T_STRING</span><span class='rparen token'>)</span><span class='semicolon token'>;</span>
|
423
|
+
<span class='rubyid_simplet_bounds_t identifier id'>simplet_bounds_t</span> <span class='mult op'>*</span><span class='rubyid_bounds identifier id'>bounds</span><span class='semicolon token'>;</span>
|
424
|
+
<span class='rubyid_if if kw'>if</span><span class='lparen token'>(</span><span class='notop op'>!</span><span class='lparen token'>(</span><span class='rubyid_bounds identifier id'>bounds</span> <span class='assign token'>=</span> <span class='rubyid_simplet_bounds_reproject identifier id'>simplet_bounds_reproject</span><span class='lparen token'>(</span><span class='rubyid_get_bounds identifier id'>get_bounds</span><span class='lparen token'>(</span><span class='rubyid_self self kw'>self</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_RSTRING_PTR constant id'>RSTRING_PTR</span><span class='lparen token'>(</span><span class='rubyid_from identifier id'>from</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='rubyid_RSTRING_PTR constant id'>RSTRING_PTR</span><span class='lparen token'>(</span><span class='rubyid_to identifier id'>to</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
|
425
|
+
<span class='rubyid_rb_raise identifier id'>rb_raise</span><span class='lparen token'>(</span><span class='rubyid_rb_eRuntimeError identifier id'>rb_eRuntimeError</span><span class='comma token'>,</span> <span class='string val'>"Error in creating bounds."</span><span class='rparen token'>)</span><span class='semicolon token'>;</span>
|
426
|
+
|
427
|
+
<span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_id identifier id'>id</span> <span class='assign token'>=</span> <span class='rubyid_rb_intern identifier id'>rb_intern</span><span class='lparen token'>(</span><span class='string val'>"new"</span><span class='rparen token'>)</span><span class='semicolon token'>;</span>
|
428
|
+
|
429
|
+
<span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_rbounds identifier id'>rbounds</span> <span class='assign token'>=</span> <span class='rubyid_rb_funcall identifier id'>rb_funcall</span><span class='lparen token'>(</span><span class='rubyid_cSimplerTilesBounds identifier id'>cSimplerTilesBounds</span><span class='comma token'>,</span> <span class='rubyid_id identifier id'>id</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='comma token'>,</span>
|
430
|
+
<span class='rubyid_rb_float_new identifier id'>rb_float_new</span><span class='lparen token'>(</span><span class='rubyid_bounds identifier id'>bounds</span><span class='minus op'>-</span><span class='gt op'>></span><span class='rubyid_nw identifier id'>nw</span><span class='dot token'>.</span><span class='rubyid_x identifier id'>x</span><span class='rparen token'>)</span><span class='comma token'>,</span>
|
431
|
+
<span class='rubyid_rb_float_new identifier id'>rb_float_new</span><span class='lparen token'>(</span><span class='rubyid_bounds identifier id'>bounds</span><span class='minus op'>-</span><span class='gt op'>></span><span class='rubyid_nw identifier id'>nw</span><span class='dot token'>.</span><span class='rubyid_y identifier id'>y</span><span class='rparen token'>)</span><span class='comma token'>,</span>
|
432
|
+
<span class='rubyid_rb_float_new identifier id'>rb_float_new</span><span class='lparen token'>(</span><span class='rubyid_bounds identifier id'>bounds</span><span class='minus op'>-</span><span class='gt op'>></span><span class='rubyid_se identifier id'>se</span><span class='dot token'>.</span><span class='rubyid_x identifier id'>x</span><span class='rparen token'>)</span><span class='comma token'>,</span>
|
433
|
+
<span class='rubyid_rb_float_new identifier id'>rb_float_new</span><span class='lparen token'>(</span><span class='rubyid_bounds identifier id'>bounds</span><span class='minus op'>-</span><span class='gt op'>></span><span class='rubyid_se identifier id'>se</span><span class='dot token'>.</span><span class='rubyid_y identifier id'>y</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='semicolon token'>;</span>
|
434
|
+
|
435
|
+
<span class='rubyid_simplet_bounds_free identifier id'>simplet_bounds_free</span><span class='lparen token'>(</span><span class='rubyid_bounds identifier id'>bounds</span><span class='rparen token'>)</span><span class='semicolon token'>;</span>
|
436
|
+
<span class='rubyid_return return kw'>return</span> <span class='rubyid_rbounds identifier id'>rbounds</span><span class='semicolon token'>;</span>
|
437
|
+
<span class='rbrace token'>}</span>
|
438
|
+
</pre>
|
439
|
+
</td>
|
440
|
+
</tr>
|
441
|
+
</table>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
<div class="method_details ">
|
445
|
+
<p class="signature " id="to_wkt-instance_method">
|
446
|
+
|
447
|
+
- (<tt>String</tt>) <strong>to_wkt</strong>
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
</p><div class="docstring">
|
452
|
+
<div class="discussion">
|
453
|
+
<p>
|
454
|
+
Return a WKT representation of the bounds.
|
455
|
+
</p>
|
456
|
+
|
457
|
+
|
458
|
+
</div>
|
459
|
+
</div>
|
460
|
+
<div class="tags">
|
461
|
+
|
462
|
+
<h3>Returns:</h3>
|
463
|
+
<ul class="return">
|
464
|
+
|
465
|
+
<li>
|
466
|
+
|
467
|
+
|
468
|
+
<span class='type'>(<tt>String</tt>)</span>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
</li>
|
473
|
+
|
474
|
+
</ul>
|
475
|
+
|
476
|
+
</div><table class="source_code">
|
477
|
+
<tr>
|
478
|
+
<td>
|
479
|
+
<pre class="lines">
|
480
|
+
|
481
|
+
|
482
|
+
</pre>
|
483
|
+
</td>
|
484
|
+
<td>
|
485
|
+
<pre class="code"><span class="info file"># File 'ext/simpler_tiles/bounds.c'</span>
|
486
|
+
|
487
|
+
<span class='rubyid_static identifier id'>static</span> <span class='rubyid_VALUE constant id'>VALUE</span>
|
488
|
+
<span class='rubyid_to_wkt identifier id'>to_wkt</span><span class='lparen token'>(</span><span class='rubyid_VALUE constant id'>VALUE</span> <span class='rubyid_self self kw'>self</span><span class='rparen token'>)</span><span class='lbrace token'>{</span>
|
489
|
+
</pre>
|
490
|
+
</td>
|
491
|
+
</tr>
|
492
|
+
</table>
|
493
|
+
</div>
|
494
|
+
|
495
|
+
</div>
|
496
|
+
|
497
|
+
</div>
|
498
|
+
|
499
|
+
<div id="footer">
|
500
|
+
Generated on Wed Mar 7 20:33:22 2012 by
|
501
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
502
|
+
0.7.5 (ruby-1.8.7).
|
503
|
+
</div>
|
504
|
+
|
505
|
+
</body>
|
506
|
+
</html>
|