simpler-tiles 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require "#{File.expand_path(File.dirname(__FILE__))}/lib/simpler_tiles/version"
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = %q{simpler-tiles}
|
6
|
+
s.version = SimplerTiles::VERSION
|
7
|
+
|
8
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
|
+
s.authors = ["Jeff Larson"]
|
10
|
+
s.date = %q{2011-06-23}
|
11
|
+
s.description = %q{Ruby bindings for Simple Tiles}
|
12
|
+
s.email = %q{thejefflarson@gmail.com}
|
13
|
+
s.extensions = ["ext/simpler_tiles/extconf.rb"]
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"LICENSE",
|
16
|
+
"README"
|
17
|
+
]
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.test_files = `git ls-files -- {test}/*`.split("\n")
|
20
|
+
s.homepage = %q{http://github.com/thejefflarson/simpler-tiles}
|
21
|
+
s.licenses = ["MIT"]
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
s.summary = %q{A set of ruby bindings for the Simple Tiles mapping library.}
|
24
|
+
|
25
|
+
s.add_development_dependency(%q<rake-compiler>, [">= 0"])
|
26
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
|
27
|
+
s.add_development_dependency(%q<shoulda>, ["~> 2.11.3"])
|
28
|
+
s.add_development_dependency(%q<redgreen>, ["~> 1.2.2"])
|
29
|
+
s.add_development_dependency(%q<yard>, ["~> 0.7.5"])
|
30
|
+
end
|
data/test/helper.rb
ADDED
data/test/test_map.rb
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
require "#{File.join(File.dirname(__FILE__))}/helper"
|
2
|
+
|
3
|
+
class TestMap < Test::Unit::TestCase
|
4
|
+
context SimplerTiles::Map do
|
5
|
+
setup do
|
6
|
+
@map = SimplerTiles::Map.new
|
7
|
+
end
|
8
|
+
|
9
|
+
should "accept block parameters on initialization" do
|
10
|
+
map = SimplerTiles::Map.new do |m|
|
11
|
+
m.width = 500
|
12
|
+
m.height = 500
|
13
|
+
end
|
14
|
+
|
15
|
+
assert_equal(map.width, 500)
|
16
|
+
assert_equal(map.height, 500)
|
17
|
+
end
|
18
|
+
|
19
|
+
should "set projection" do
|
20
|
+
srs = "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs ";
|
21
|
+
@map.srs = srs
|
22
|
+
assert_equal(@map.srs, srs)
|
23
|
+
end
|
24
|
+
|
25
|
+
should "test validity" do
|
26
|
+
assert_equal @map.valid?, false
|
27
|
+
end
|
28
|
+
|
29
|
+
should "set slippy" do
|
30
|
+
@map.slippy(0, 0, 1)
|
31
|
+
assert_equal @map.width, 256
|
32
|
+
end
|
33
|
+
|
34
|
+
should "raise error when invalid" do
|
35
|
+
map = SimplerTiles::Map.new do |m|
|
36
|
+
m.srs = "+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs"
|
37
|
+
m.set_bounds -179.231086, 17.831509, -100.859681, 71.441059
|
38
|
+
m.set_size 256, 256
|
39
|
+
m.layer "#{File.dirname(__FILE__)}/../data/tl_2010_us_state10.shp" do |l|
|
40
|
+
l.query "SELECT * from tl_2010_us_state10_error_error" do |q|
|
41
|
+
q.styles 'fill' => "#061F3799",
|
42
|
+
'line-join' => "round",
|
43
|
+
'line-cap' => "square",
|
44
|
+
'seamless' => "true"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
assert_raises RuntimeError do
|
49
|
+
map.to_png
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
#TODO: transform to real test
|
54
|
+
should "return bounds" do
|
55
|
+
map = SimplerTiles::Map.new do |m|
|
56
|
+
m.slippy 0, 0, 1
|
57
|
+
end
|
58
|
+
map.buffer = 1000
|
59
|
+
end
|
60
|
+
|
61
|
+
should "set and get bgcolor" do
|
62
|
+
color = "#cc0000"
|
63
|
+
@map.bgcolor = color
|
64
|
+
assert_equal @map.bgcolor, color
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "#{File.join(File.dirname(__FILE__))}/helper"
|
2
|
+
|
3
|
+
class TestSimplerTiles < Test::Unit::TestCase
|
4
|
+
should "produce a png image" do
|
5
|
+
map = SimplerTiles::Map.new do |m|
|
6
|
+
m.slippy 3, 6, 4
|
7
|
+
m.layer "#{File.dirname(__FILE__)}/../data/tl_2010_us_state10.shp" do |l|
|
8
|
+
l.query "SELECT * from 'tl_2010_us_state10'" do |q|
|
9
|
+
q.styles 'fill' => "#061F3799",
|
10
|
+
'line-join' => "round",
|
11
|
+
'line-cap' => "square",
|
12
|
+
'seamless' => "true"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
assert map.valid?
|
18
|
+
map.to_png do |data|
|
19
|
+
assert data
|
20
|
+
File.open "#{File.dirname(__FILE__)}/out.png", "wb" do |f|
|
21
|
+
f.write data
|
22
|
+
end
|
23
|
+
assert data.length
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simpler-tiles
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Jeff Larson
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-06-23 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
type: :development
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
prerelease: false
|
33
|
+
name: rake-compiler
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
type: :development
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 19
|
43
|
+
segments:
|
44
|
+
- 1
|
45
|
+
- 1
|
46
|
+
- 0
|
47
|
+
version: 1.1.0
|
48
|
+
prerelease: false
|
49
|
+
name: bundler
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
type: :development
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 37
|
59
|
+
segments:
|
60
|
+
- 2
|
61
|
+
- 11
|
62
|
+
- 3
|
63
|
+
version: 2.11.3
|
64
|
+
prerelease: false
|
65
|
+
name: shoulda
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
type: :development
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ~>
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 27
|
75
|
+
segments:
|
76
|
+
- 1
|
77
|
+
- 2
|
78
|
+
- 2
|
79
|
+
version: 1.2.2
|
80
|
+
prerelease: false
|
81
|
+
name: redgreen
|
82
|
+
version_requirements: *id004
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
type: :development
|
85
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 9
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
- 7
|
94
|
+
- 5
|
95
|
+
version: 0.7.5
|
96
|
+
prerelease: false
|
97
|
+
name: yard
|
98
|
+
version_requirements: *id005
|
99
|
+
description: Ruby bindings for Simple Tiles
|
100
|
+
email: thejefflarson@gmail.com
|
101
|
+
executables: []
|
102
|
+
|
103
|
+
extensions:
|
104
|
+
- ext/simpler_tiles/extconf.rb
|
105
|
+
extra_rdoc_files:
|
106
|
+
- LICENSE
|
107
|
+
- README
|
108
|
+
files:
|
109
|
+
- .gitignore
|
110
|
+
- Gemfile
|
111
|
+
- LICENSE
|
112
|
+
- README
|
113
|
+
- Rakefile
|
114
|
+
- doc/SimplerTiles.html
|
115
|
+
- doc/SimplerTiles/Bounds.html
|
116
|
+
- doc/SimplerTiles/Layer.html
|
117
|
+
- doc/SimplerTiles/Map.html
|
118
|
+
- doc/SimplerTiles/PP.html
|
119
|
+
- doc/SimplerTiles/Query.html
|
120
|
+
- doc/SimplerTiles/Style.html
|
121
|
+
- doc/_index.html
|
122
|
+
- doc/class_list.html
|
123
|
+
- doc/css/common.css
|
124
|
+
- doc/css/full_list.css
|
125
|
+
- doc/css/style.css
|
126
|
+
- doc/file.README.html
|
127
|
+
- doc/file_list.html
|
128
|
+
- doc/frames.html
|
129
|
+
- doc/index.html
|
130
|
+
- doc/js/app.js
|
131
|
+
- doc/js/full_list.js
|
132
|
+
- doc/js/jquery.js
|
133
|
+
- doc/method_list.html
|
134
|
+
- doc/top-level-namespace.html
|
135
|
+
- ext/simpler_tiles/bounds.c
|
136
|
+
- ext/simpler_tiles/bounds.h
|
137
|
+
- ext/simpler_tiles/depend
|
138
|
+
- ext/simpler_tiles/extconf.rb
|
139
|
+
- ext/simpler_tiles/layer.c
|
140
|
+
- ext/simpler_tiles/layer.h
|
141
|
+
- ext/simpler_tiles/map.c
|
142
|
+
- ext/simpler_tiles/map.h
|
143
|
+
- ext/simpler_tiles/query.c
|
144
|
+
- ext/simpler_tiles/query.h
|
145
|
+
- ext/simpler_tiles/simpler_tiles.c
|
146
|
+
- ext/simpler_tiles/simpler_tiles.h
|
147
|
+
- ext/simpler_tiles/style.c
|
148
|
+
- ext/simpler_tiles/style.h
|
149
|
+
- index.erb
|
150
|
+
- index.html
|
151
|
+
- lib/simpler_tiles.rb
|
152
|
+
- lib/simpler_tiles/bounds.rb
|
153
|
+
- lib/simpler_tiles/layer.rb
|
154
|
+
- lib/simpler_tiles/map.rb
|
155
|
+
- lib/simpler_tiles/mixins/pp.rb
|
156
|
+
- lib/simpler_tiles/query.rb
|
157
|
+
- lib/simpler_tiles/style.rb
|
158
|
+
- lib/simpler_tiles/version.rb
|
159
|
+
- simpler-tiles-logo.png
|
160
|
+
- simpler-tiles.gemspec
|
161
|
+
- test/helper.rb
|
162
|
+
- test/test_map.rb
|
163
|
+
- test/test_simpler_tiles.rb
|
164
|
+
has_rdoc: true
|
165
|
+
homepage: http://github.com/thejefflarson/simpler-tiles
|
166
|
+
licenses:
|
167
|
+
- MIT
|
168
|
+
post_install_message:
|
169
|
+
rdoc_options: []
|
170
|
+
|
171
|
+
require_paths:
|
172
|
+
- lib
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
+
none: false
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
hash: 3
|
179
|
+
segments:
|
180
|
+
- 0
|
181
|
+
version: "0"
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
none: false
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
hash: 3
|
188
|
+
segments:
|
189
|
+
- 0
|
190
|
+
version: "0"
|
191
|
+
requirements: []
|
192
|
+
|
193
|
+
rubyforge_project:
|
194
|
+
rubygems_version: 1.6.2
|
195
|
+
signing_key:
|
196
|
+
specification_version: 3
|
197
|
+
summary: A set of ruby bindings for the Simple Tiles mapping library.
|
198
|
+
test_files: []
|
199
|
+
|