ruby_mapnik 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/.autotest +35 -0
  2. data/.gemtest +0 -0
  3. data/.yardopts +1 -0
  4. data/Gemfile +12 -0
  5. data/LICENSE +19 -0
  6. data/Manifest.txt +177 -0
  7. data/README.rdoc +84 -0
  8. data/Rakefile +43 -0
  9. data/demo/data/COPYRIGHT.txt +3 -0
  10. data/demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.dbf +0 -0
  11. data/demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.prj +1 -0
  12. data/demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shp +0 -0
  13. data/demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shx +0 -0
  14. data/demo/data/boundaries.dbf +0 -0
  15. data/demo/data/boundaries.prj +1 -0
  16. data/demo/data/boundaries.sbx +0 -0
  17. data/demo/data/boundaries.shp +0 -0
  18. data/demo/data/boundaries.shx +0 -0
  19. data/demo/data/boundaries_l.dbf +0 -0
  20. data/demo/data/boundaries_l.prj +1 -0
  21. data/demo/data/boundaries_l.sbx +0 -0
  22. data/demo/data/boundaries_l.shp +0 -0
  23. data/demo/data/boundaries_l.shx +0 -0
  24. data/demo/data/ontdrainage.dbf +0 -0
  25. data/demo/data/ontdrainage.prj +1 -0
  26. data/demo/data/ontdrainage.sbx +0 -0
  27. data/demo/data/ontdrainage.shp +0 -0
  28. data/demo/data/ontdrainage.shx +0 -0
  29. data/demo/data/popplaces.dbf +0 -0
  30. data/demo/data/popplaces.prj +1 -0
  31. data/demo/data/popplaces.sbx +0 -0
  32. data/demo/data/popplaces.shp +0 -0
  33. data/demo/data/popplaces.shx +0 -0
  34. data/demo/data/qcdrainage.dbf +0 -0
  35. data/demo/data/qcdrainage.prj +1 -0
  36. data/demo/data/qcdrainage.sbx +0 -0
  37. data/demo/data/qcdrainage.shp +0 -0
  38. data/demo/data/qcdrainage.shx +0 -0
  39. data/demo/data/roads.dbf +0 -0
  40. data/demo/data/roads.prj +1 -0
  41. data/demo/data/roads.sbx +0 -0
  42. data/demo/data/roads.shp +0 -0
  43. data/demo/data/roads.shx +0 -0
  44. data/demo/data/test/charplacement.dbf +0 -0
  45. data/demo/data/test/charplacement.shp +0 -0
  46. data/demo/data/test/charplacement.shx +0 -0
  47. data/demo/data/test/displacement.dbf +0 -0
  48. data/demo/data/test/displacement.shp +0 -0
  49. data/demo/data/test/displacement.shx +0 -0
  50. data/demo/data/test/overlap.dbf +0 -0
  51. data/demo/data/test/overlap.shp +0 -0
  52. data/demo/data/test/overlap.shx +0 -0
  53. data/demo/data/test/raw/charplacement.gfs +25 -0
  54. data/demo/data/test/raw/charplacement.gml +99 -0
  55. data/demo/data/test/raw/charplacement.xsd +36 -0
  56. data/demo/data/test/raw/displacement.gfs +25 -0
  57. data/demo/data/test/raw/displacement.gml +173 -0
  58. data/demo/data/test/raw/displacement.xsd +36 -0
  59. data/demo/data/test/raw/overlap.gfs +25 -0
  60. data/demo/data/test/raw/overlap.gml +127 -0
  61. data/demo/data/test/raw/overlap.xsd +36 -0
  62. data/demo/data/test/raw/textspacing.gfs +25 -0
  63. data/demo/data/test/raw/textspacing.gml +117 -0
  64. data/demo/data/test/raw/textspacing.xsd +36 -0
  65. data/demo/data/test/readme.txt +3 -0
  66. data/demo/data/test/regenerate.sh +20 -0
  67. data/demo/data/test/textspacing.dbf +0 -0
  68. data/demo/data/test/textspacing.shp +0 -0
  69. data/demo/data/test/textspacing.shx +0 -0
  70. data/demo/rundemo.rb +139 -0
  71. data/demo/sinatra/demo.rb +31 -0
  72. data/demo/sinatra/public/css/demo_map.css +7 -0
  73. data/demo/sinatra/public/index.html +13 -0
  74. data/demo/sinatra/public/javascripts/demo_map.js +42 -0
  75. data/ext/ruby_mapnik/_mapnik.cpp +54 -0
  76. data/ext/ruby_mapnik/_mapnik.h +69 -0
  77. data/ext/ruby_mapnik/_mapnik_color.rb.cpp +179 -0
  78. data/ext/ruby_mapnik/_mapnik_color.rb.h +32 -0
  79. data/ext/ruby_mapnik/_mapnik_coord.rb.cpp +145 -0
  80. data/ext/ruby_mapnik/_mapnik_coord.rb.h +32 -0
  81. data/ext/ruby_mapnik/_mapnik_datasource.rb.cpp +150 -0
  82. data/ext/ruby_mapnik/_mapnik_datasource.rb.h +32 -0
  83. data/ext/ruby_mapnik/_mapnik_datasource_cache.rb.cpp +79 -0
  84. data/ext/ruby_mapnik/_mapnik_datasource_cache.rb.h +32 -0
  85. data/ext/ruby_mapnik/_mapnik_envelope.rb.cpp +220 -0
  86. data/ext/ruby_mapnik/_mapnik_envelope.rb.h +32 -0
  87. data/ext/ruby_mapnik/_mapnik_expression.rb.cpp +91 -0
  88. data/ext/ruby_mapnik/_mapnik_expression.rb.h +32 -0
  89. data/ext/ruby_mapnik/_mapnik_feature.rb.cpp +56 -0
  90. data/ext/ruby_mapnik/_mapnik_feature.rb.h +32 -0
  91. data/ext/ruby_mapnik/_mapnik_font_engine.rb.cpp +71 -0
  92. data/ext/ruby_mapnik/_mapnik_font_engine.rb.h +32 -0
  93. data/ext/ruby_mapnik/_mapnik_geometry.rb.cpp +73 -0
  94. data/ext/ruby_mapnik/_mapnik_geometry.rb.h +32 -0
  95. data/ext/ruby_mapnik/_mapnik_glyph_symbolizer.rb.cpp +250 -0
  96. data/ext/ruby_mapnik/_mapnik_glyph_symbolizer.rb.h +32 -0
  97. data/ext/ruby_mapnik/_mapnik_layer.rb.cpp +237 -0
  98. data/ext/ruby_mapnik/_mapnik_layer.rb.h +32 -0
  99. data/ext/ruby_mapnik/_mapnik_line_pattern_symbolizer.rb.cpp +70 -0
  100. data/ext/ruby_mapnik/_mapnik_line_pattern_symbolizer.rb.h +32 -0
  101. data/ext/ruby_mapnik/_mapnik_line_symbolizer.rb.cpp +43 -0
  102. data/ext/ruby_mapnik/_mapnik_line_symbolizer.rb.h +32 -0
  103. data/ext/ruby_mapnik/_mapnik_map.rb.cpp +435 -0
  104. data/ext/ruby_mapnik/_mapnik_map.rb.h +32 -0
  105. data/ext/ruby_mapnik/_mapnik_markers_symbolizer.rb.cpp +139 -0
  106. data/ext/ruby_mapnik/_mapnik_markers_symbolizer.rb.h +32 -0
  107. data/ext/ruby_mapnik/_mapnik_point_symbolizer.rb.cpp +147 -0
  108. data/ext/ruby_mapnik/_mapnik_point_symbolizer.rb.h +32 -0
  109. data/ext/ruby_mapnik/_mapnik_polygon_pattern_symbolizer.rb.cpp +92 -0
  110. data/ext/ruby_mapnik/_mapnik_polygon_pattern_symbolizer.rb.h +32 -0
  111. data/ext/ruby_mapnik/_mapnik_polygon_symbolizer.rb.cpp +89 -0
  112. data/ext/ruby_mapnik/_mapnik_polygon_symbolizer.rb.h +32 -0
  113. data/ext/ruby_mapnik/_mapnik_projection.rb.cpp +98 -0
  114. data/ext/ruby_mapnik/_mapnik_projection.rb.h +32 -0
  115. data/ext/ruby_mapnik/_mapnik_raster_colorizer.rb.cpp +162 -0
  116. data/ext/ruby_mapnik/_mapnik_raster_colorizer.rb.h +32 -0
  117. data/ext/ruby_mapnik/_mapnik_raster_symbolizer.rb.cpp +53 -0
  118. data/ext/ruby_mapnik/_mapnik_raster_symbolizer.rb.h +32 -0
  119. data/ext/ruby_mapnik/_mapnik_rule.rb.cpp +99 -0
  120. data/ext/ruby_mapnik/_mapnik_rule.rb.h +32 -0
  121. data/ext/ruby_mapnik/_mapnik_shield_symbolizer.rb.cpp +86 -0
  122. data/ext/ruby_mapnik/_mapnik_shield_symbolizer.rb.h +32 -0
  123. data/ext/ruby_mapnik/_mapnik_stroke.rb.cpp +188 -0
  124. data/ext/ruby_mapnik/_mapnik_stroke.rb.h +32 -0
  125. data/ext/ruby_mapnik/_mapnik_style.rb.cpp +76 -0
  126. data/ext/ruby_mapnik/_mapnik_style.rb.h +32 -0
  127. data/ext/ruby_mapnik/_mapnik_symbolizer.rb.cpp +77 -0
  128. data/ext/ruby_mapnik/_mapnik_symbolizer.rb.h +32 -0
  129. data/ext/ruby_mapnik/_mapnik_text_symbolizer.rb.cpp +521 -0
  130. data/ext/ruby_mapnik/_mapnik_text_symbolizer.rb.h +32 -0
  131. data/ext/ruby_mapnik/extconf.rb +78 -0
  132. data/ext/ruby_mapnik/ruby_mapnik.cpp +31 -0
  133. data/lib/ruby_mapnik/mapnik/font_engine.rb +35 -0
  134. data/lib/ruby_mapnik/mapnik/layer.rb +69 -0
  135. data/lib/ruby_mapnik/mapnik/map.rb +144 -0
  136. data/lib/ruby_mapnik/mapnik/projection.rb +46 -0
  137. data/lib/ruby_mapnik/mapnik/raster_colorizer.rb +55 -0
  138. data/lib/ruby_mapnik/mapnik/rule.rb +107 -0
  139. data/lib/ruby_mapnik/mapnik/stroke.rb +58 -0
  140. data/lib/ruby_mapnik/mapnik/style.rb +66 -0
  141. data/lib/ruby_mapnik/mapnik/tile.rb +93 -0
  142. data/lib/ruby_mapnik.rb +48 -0
  143. data/script/console +2 -0
  144. data/test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.dbf +0 -0
  145. data/test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.prj +1 -0
  146. data/test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shp +0 -0
  147. data/test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shx +0 -0
  148. data/test/data/test_map.xml +15 -0
  149. data/test/test_helper.rb +27 -0
  150. data/test/test_line_pattern_symbolizer.rb +26 -0
  151. data/test/test_mapnik_color.rb +66 -0
  152. data/test/test_mapnik_coord.rb +112 -0
  153. data/test/test_mapnik_datasource.rb +49 -0
  154. data/test/test_mapnik_envelope.rb +232 -0
  155. data/test/test_mapnik_expression.rb +19 -0
  156. data/test/test_mapnik_feature.rb +33 -0
  157. data/test/test_mapnik_font_engine.rb +13 -0
  158. data/test/test_mapnik_geometry.rb +72 -0
  159. data/test/test_mapnik_glyph_symbolizer.rb +96 -0
  160. data/test/test_mapnik_layer.rb +137 -0
  161. data/test/test_mapnik_line_symbolizer.rb +25 -0
  162. data/test/test_mapnik_map.rb +191 -0
  163. data/test/test_mapnik_markers_symbolizer.rb +46 -0
  164. data/test/test_mapnik_point_symbolizer.rb +53 -0
  165. data/test/test_mapnik_polygon_symbolizer.rb +44 -0
  166. data/test/test_mapnik_projection.rb +46 -0
  167. data/test/test_mapnik_raster_colorizer.rb +56 -0
  168. data/test/test_mapnik_raster_symbolizer.rb +40 -0
  169. data/test/test_mapnik_rule.rb +63 -0
  170. data/test/test_mapnik_shield_symbolizer.rb +193 -0
  171. data/test/test_mapnik_stroke.rb +94 -0
  172. data/test/test_mapnik_style.rb +28 -0
  173. data/test/test_mapnik_symbolizer.rb +9 -0
  174. data/test/test_mapnik_text_symbolizer.rb +232 -0
  175. data/test/test_polygon_pattern_symbolizer.rb +34 -0
  176. data/test/test_ruby_mapnik.rb +34 -0
  177. data/yard/lib/yard/parser/generic_parser.rb +72 -0
  178. data/yard/lib/yard_generic.rb +18 -0
  179. metadata +322 -0
data/.autotest ADDED
@@ -0,0 +1,35 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/restart'
4
+
5
+ # Autotest.add_hook :initialize do |at|
6
+ # at.extra_files << "../some/external/dependency.rb"
7
+ #
8
+ # at.libs << ":../some/external"
9
+ #
10
+ # at.add_exception 'vendor'
11
+ #
12
+ # at.add_mapping(/dependency.rb/) do |f, _|
13
+ # at.files_matching(/test_.*rb$/)
14
+ # end
15
+ #
16
+ # %w(TestA TestB).each do |klass|
17
+ # at.extra_class_map[klass] = "test/test_misc.rb"
18
+ # end
19
+ # end
20
+
21
+ # Autotest.add_hook :run_command do |at|
22
+ # system "rake build"
23
+ # end
24
+
25
+ # require 'autotest/restart'
26
+
27
+ Autotest.add_hook :initialize do |at|
28
+ at.add_mapping(/.*\.c/) do |f, _|
29
+ at.files_matching(/test_.*rb$/)
30
+ end
31
+ end
32
+
33
+ Autotest.add_hook :run_command do |at|
34
+ system "rake compile"
35
+ end
data/.gemtest ADDED
File without changes
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ -eyard/lib/yard_generic.rb ext/**/*.cpp lib/ruby_mapnik/mapnik/*.rb
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # -*- ruby -*-
2
+
3
+ # DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
4
+
5
+ source :gemcutter
6
+
7
+ gem "rice", ">=1.4.2"
8
+
9
+ gem "rake-compiler", ">=0", :group => [:development, :test]
10
+ gem "hoe", "~>2.10", :group => [:development, :test]
11
+
12
+ # vim: syntax=ruby
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2011 Elliot Laster
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the ‘Software’), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ 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 FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
data/Manifest.txt ADDED
@@ -0,0 +1,177 @@
1
+ .autotest
2
+ .yardopts
3
+ Gemfile
4
+ LICENSE
5
+ Manifest.txt
6
+ README.rdoc
7
+ Rakefile
8
+ demo/data/COPYRIGHT.txt
9
+ demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.dbf
10
+ demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.prj
11
+ demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shp
12
+ demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shx
13
+ demo/data/boundaries.dbf
14
+ demo/data/boundaries.prj
15
+ demo/data/boundaries.sbx
16
+ demo/data/boundaries.shp
17
+ demo/data/boundaries.shx
18
+ demo/data/boundaries_l.dbf
19
+ demo/data/boundaries_l.prj
20
+ demo/data/boundaries_l.sbx
21
+ demo/data/boundaries_l.shp
22
+ demo/data/boundaries_l.shx
23
+ demo/data/ontdrainage.dbf
24
+ demo/data/ontdrainage.prj
25
+ demo/data/ontdrainage.sbx
26
+ demo/data/ontdrainage.shp
27
+ demo/data/ontdrainage.shx
28
+ demo/data/popplaces.dbf
29
+ demo/data/popplaces.prj
30
+ demo/data/popplaces.sbx
31
+ demo/data/popplaces.shp
32
+ demo/data/popplaces.shx
33
+ demo/data/qcdrainage.dbf
34
+ demo/data/qcdrainage.prj
35
+ demo/data/qcdrainage.sbx
36
+ demo/data/qcdrainage.shp
37
+ demo/data/qcdrainage.shx
38
+ demo/data/roads.dbf
39
+ demo/data/roads.prj
40
+ demo/data/roads.sbx
41
+ demo/data/roads.shp
42
+ demo/data/roads.shx
43
+ demo/data/test/charplacement.dbf
44
+ demo/data/test/charplacement.shp
45
+ demo/data/test/charplacement.shx
46
+ demo/data/test/displacement.dbf
47
+ demo/data/test/displacement.shp
48
+ demo/data/test/displacement.shx
49
+ demo/data/test/overlap.dbf
50
+ demo/data/test/overlap.shp
51
+ demo/data/test/overlap.shx
52
+ demo/data/test/raw/charplacement.gfs
53
+ demo/data/test/raw/charplacement.gml
54
+ demo/data/test/raw/charplacement.xsd
55
+ demo/data/test/raw/displacement.gfs
56
+ demo/data/test/raw/displacement.gml
57
+ demo/data/test/raw/displacement.xsd
58
+ demo/data/test/raw/overlap.gfs
59
+ demo/data/test/raw/overlap.gml
60
+ demo/data/test/raw/overlap.xsd
61
+ demo/data/test/raw/textspacing.gfs
62
+ demo/data/test/raw/textspacing.gml
63
+ demo/data/test/raw/textspacing.xsd
64
+ demo/data/test/readme.txt
65
+ demo/data/test/regenerate.sh
66
+ demo/data/test/textspacing.dbf
67
+ demo/data/test/textspacing.shp
68
+ demo/data/test/textspacing.shx
69
+ demo/rundemo.rb
70
+ demo/sinatra/demo.rb
71
+ demo/sinatra/public/css/demo_map.css
72
+ demo/sinatra/public/index.html
73
+ demo/sinatra/public/javascripts/demo_map.js
74
+ ext/ruby_mapnik/_mapnik.cpp
75
+ ext/ruby_mapnik/_mapnik.h
76
+ ext/ruby_mapnik/_mapnik_color.rb.cpp
77
+ ext/ruby_mapnik/_mapnik_color.rb.h
78
+ ext/ruby_mapnik/_mapnik_coord.rb.cpp
79
+ ext/ruby_mapnik/_mapnik_coord.rb.h
80
+ ext/ruby_mapnik/_mapnik_datasource.rb.cpp
81
+ ext/ruby_mapnik/_mapnik_datasource.rb.h
82
+ ext/ruby_mapnik/_mapnik_datasource_cache.rb.cpp
83
+ ext/ruby_mapnik/_mapnik_datasource_cache.rb.h
84
+ ext/ruby_mapnik/_mapnik_envelope.rb.cpp
85
+ ext/ruby_mapnik/_mapnik_envelope.rb.h
86
+ ext/ruby_mapnik/_mapnik_expression.rb.cpp
87
+ ext/ruby_mapnik/_mapnik_expression.rb.h
88
+ ext/ruby_mapnik/_mapnik_feature.rb.cpp
89
+ ext/ruby_mapnik/_mapnik_feature.rb.h
90
+ ext/ruby_mapnik/_mapnik_font_engine.rb.cpp
91
+ ext/ruby_mapnik/_mapnik_font_engine.rb.h
92
+ ext/ruby_mapnik/_mapnik_geometry.rb.cpp
93
+ ext/ruby_mapnik/_mapnik_geometry.rb.h
94
+ ext/ruby_mapnik/_mapnik_glyph_symbolizer.rb.cpp
95
+ ext/ruby_mapnik/_mapnik_glyph_symbolizer.rb.h
96
+ ext/ruby_mapnik/_mapnik_layer.rb.cpp
97
+ ext/ruby_mapnik/_mapnik_layer.rb.h
98
+ ext/ruby_mapnik/_mapnik_line_pattern_symbolizer.rb.cpp
99
+ ext/ruby_mapnik/_mapnik_line_pattern_symbolizer.rb.h
100
+ ext/ruby_mapnik/_mapnik_line_symbolizer.rb.cpp
101
+ ext/ruby_mapnik/_mapnik_line_symbolizer.rb.h
102
+ ext/ruby_mapnik/_mapnik_map.rb.cpp
103
+ ext/ruby_mapnik/_mapnik_map.rb.h
104
+ ext/ruby_mapnik/_mapnik_markers_symbolizer.rb.cpp
105
+ ext/ruby_mapnik/_mapnik_markers_symbolizer.rb.h
106
+ ext/ruby_mapnik/_mapnik_point_symbolizer.rb.cpp
107
+ ext/ruby_mapnik/_mapnik_point_symbolizer.rb.h
108
+ ext/ruby_mapnik/_mapnik_polygon_pattern_symbolizer.rb.cpp
109
+ ext/ruby_mapnik/_mapnik_polygon_pattern_symbolizer.rb.h
110
+ ext/ruby_mapnik/_mapnik_polygon_symbolizer.rb.cpp
111
+ ext/ruby_mapnik/_mapnik_polygon_symbolizer.rb.h
112
+ ext/ruby_mapnik/_mapnik_projection.rb.cpp
113
+ ext/ruby_mapnik/_mapnik_projection.rb.h
114
+ ext/ruby_mapnik/_mapnik_raster_colorizer.rb.cpp
115
+ ext/ruby_mapnik/_mapnik_raster_colorizer.rb.h
116
+ ext/ruby_mapnik/_mapnik_raster_symbolizer.rb.cpp
117
+ ext/ruby_mapnik/_mapnik_raster_symbolizer.rb.h
118
+ ext/ruby_mapnik/_mapnik_rule.rb.cpp
119
+ ext/ruby_mapnik/_mapnik_rule.rb.h
120
+ ext/ruby_mapnik/_mapnik_shield_symbolizer.rb.cpp
121
+ ext/ruby_mapnik/_mapnik_shield_symbolizer.rb.h
122
+ ext/ruby_mapnik/_mapnik_stroke.rb.cpp
123
+ ext/ruby_mapnik/_mapnik_stroke.rb.h
124
+ ext/ruby_mapnik/_mapnik_style.rb.cpp
125
+ ext/ruby_mapnik/_mapnik_style.rb.h
126
+ ext/ruby_mapnik/_mapnik_symbolizer.rb.cpp
127
+ ext/ruby_mapnik/_mapnik_symbolizer.rb.h
128
+ ext/ruby_mapnik/_mapnik_text_symbolizer.rb.cpp
129
+ ext/ruby_mapnik/_mapnik_text_symbolizer.rb.h
130
+ ext/ruby_mapnik/extconf.rb
131
+ ext/ruby_mapnik/ruby_mapnik.cpp
132
+ lib/ruby_mapnik.rb
133
+ lib/ruby_mapnik/mapnik/font_engine.rb
134
+ lib/ruby_mapnik/mapnik/layer.rb
135
+ lib/ruby_mapnik/mapnik/map.rb
136
+ lib/ruby_mapnik/mapnik/projection.rb
137
+ lib/ruby_mapnik/mapnik/raster_colorizer.rb
138
+ lib/ruby_mapnik/mapnik/rule.rb
139
+ lib/ruby_mapnik/mapnik/stroke.rb
140
+ lib/ruby_mapnik/mapnik/style.rb
141
+ lib/ruby_mapnik/mapnik/tile.rb
142
+ script/console
143
+ test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.dbf
144
+ test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.prj
145
+ test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shp
146
+ test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shx
147
+ test/data/test_map.xml
148
+ test/test_helper.rb
149
+ test/test_line_pattern_symbolizer.rb
150
+ test/test_mapnik_color.rb
151
+ test/test_mapnik_coord.rb
152
+ test/test_mapnik_datasource.rb
153
+ test/test_mapnik_envelope.rb
154
+ test/test_mapnik_expression.rb
155
+ test/test_mapnik_feature.rb
156
+ test/test_mapnik_font_engine.rb
157
+ test/test_mapnik_geometry.rb
158
+ test/test_mapnik_glyph_symbolizer.rb
159
+ test/test_mapnik_layer.rb
160
+ test/test_mapnik_line_symbolizer.rb
161
+ test/test_mapnik_map.rb
162
+ test/test_mapnik_markers_symbolizer.rb
163
+ test/test_mapnik_point_symbolizer.rb
164
+ test/test_mapnik_polygon_symbolizer.rb
165
+ test/test_mapnik_projection.rb
166
+ test/test_mapnik_raster_colorizer.rb
167
+ test/test_mapnik_raster_symbolizer.rb
168
+ test/test_mapnik_rule.rb
169
+ test/test_mapnik_shield_symbolizer.rb
170
+ test/test_mapnik_stroke.rb
171
+ test/test_mapnik_style.rb
172
+ test/test_mapnik_symbolizer.rb
173
+ test/test_mapnik_text_symbolizer.rb
174
+ test/test_polygon_pattern_symbolizer.rb
175
+ test/test_ruby_mapnik.rb
176
+ yard/lib/yard/parser/generic_parser.rb
177
+ yard/lib/yard_generic.rb
data/README.rdoc ADDED
@@ -0,0 +1,84 @@
1
+ = Ruby Mapnik
2
+
3
+ https://github.com/mapnik/Ruby-Mapnik
4
+
5
+ == Requirements
6
+
7
+ * Mapnik 2 (Currently available at http://svn.mapnik.org/trunk)
8
+ * Rice >=1.4.2
9
+ * rcairo (https://github.com/rcairo/rcairo) (Optional)
10
+
11
+ == Description
12
+
13
+ A set of bindings between Ruby and Mapnik. Supports many of the common uses for
14
+ Mapnik, and one day, might support al of them. Rundering is available using
15
+ the plain agg library, or via Cairo, if the rcairo gem is installed and
16
+ Mapnik has been compiled with Cairo support.
17
+
18
+ == Installation
19
+
20
+ Coming Soon!
21
+
22
+ Note: on osx the default rake compile will try to build universal, and your
23
+ mapnik install is unlikely built universal. Check the architecture of libmapnik2.dylib like:
24
+
25
+ file /usr/local/lib/libmapnik2.dylib
26
+
27
+ On a system where your compiler defaults to 64bit you'll see: 'Mach-O 64-bit dynamically linked shared library x86_64'
28
+
29
+ So to avoid a linking warning like:
30
+
31
+ ld: warning: ignoring file /usr/local/lib/libmapnik2.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
32
+
33
+ You can pass this before rake compile:
34
+
35
+ export ARCHFLAGS="-arch x86_64"
36
+
37
+ == Synopsis
38
+
39
+ require 'ruby_mapnik'
40
+
41
+ map = Mapnik::Map.new do |m|
42
+
43
+ # A grey background
44
+ m.background = Mapnik::Color.new('#777')
45
+
46
+ # Use the Google mercator projection
47
+ m.srs = Mapnik::Tile::DEFAULT_OUTPUT_PROJECTION
48
+
49
+ # Add a layer to the map
50
+ m.layer 'countries' do |l|
51
+
52
+ # Add a style to the layer
53
+ l.style do |s|
54
+
55
+ # Add a rule to the style (this one is a default rule)
56
+ s.rule do |default|
57
+
58
+ #fill the shapes woith polygon symbolizers
59
+ default.fill = Mapnik::Color.new('#880000')
60
+ end
61
+ end
62
+
63
+ # set the srs of the layer
64
+ l.srs = "+proj=latlong +datum=WGS84"
65
+
66
+ #specify the datasource for the layer
67
+ l.datasource = Mapnik::Datasource.create :type => 'shape', :file => "#{PATH}/../data/TM_WORLD_BORDERS_SIMPL_0.3_MOD"
68
+ end
69
+
70
+ end
71
+
72
+ map.zoom_to_box(map.layers.first.envelope)
73
+ map.render_to_file('my_map.png')
74
+
75
+ == Examples
76
+
77
+ See demo/rundemo.rb for the classic mapnik rundemo. Also see demo/sinatra/demo.rb
78
+ for a simple tile server (requires the sinatra gem).
79
+
80
+ == Thanks
81
+
82
+ Thanks to the Mapnik team and especially to Dane Springmeyer!
83
+
84
+
data/Rakefile ADDED
@@ -0,0 +1,43 @@
1
+ =begin
2
+ *******************************************************************************
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the ‘Software’), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ 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 FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
20
+ *******************************************************************************
21
+ =end
22
+ require 'rubygems'
23
+ require 'hoe'
24
+ require 'rake/extensiontask'
25
+
26
+ Hoe.plugin :bundler, :rubygems, :doofus, :git
27
+
28
+ Hoe.spec 'ruby_mapnik' do
29
+ developer('Elliot Laster', 'elliotlaster@gmail.com')
30
+ self.readme_file = 'README.rdoc'
31
+ # self.history_file = 'CHANGELOG.rdoc'
32
+ self.extra_deps << ['rice', '>= 1.4.2']
33
+ self.extra_dev_deps << ['rake-compiler', '>= 0']
34
+
35
+
36
+ self.spec_extras = { :extensions => ["ext/ruby_mapnik/extconf.rb"] }
37
+
38
+ Rake::ExtensionTask.new('ruby_mapnik', spec) do |ext|
39
+ ext.lib_dir = File.join('lib', 'ruby_mapnik')
40
+ end
41
+ end
42
+
43
+ Rake::Task[:test].prerequisites << :compile
@@ -0,0 +1,3 @@
1
+ � 2003. Government of Canada with permission from Natural Resources Canada
2
+
3
+ Original License: http://geogratis.cgdi.gc.ca/geogratis/en/licence.jsp
@@ -0,0 +1 @@
1
+ GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file
@@ -0,0 +1 @@
1
+ PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ PROJCS["Atlas of Canada Lambert Conformal Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-95.0],PARAMETER["Standard_Parallel_1",49.0],PARAMETER["Standard_Parallel_2",77.0],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ <GMLFeatureClassList>
2
+ <GMLFeatureClass>
3
+ <Name>charplacement</Name>
4
+ <ElementPath>charplacement</ElementPath>
5
+ <DatasetSpecificInfo>
6
+ <FeatureCount>1</FeatureCount>
7
+ <ExtentXMin>1.00000</ExtentXMin>
8
+ <ExtentXMax>2.00000</ExtentXMax>
9
+ <ExtentYMin>1.00000</ExtentYMin>
10
+ <ExtentYMax>5.00000</ExtentYMax>
11
+ </DatasetSpecificInfo>
12
+ <PropertyDefn>
13
+ <Name>NAME</Name>
14
+ <ElementPath>NAME</ElementPath>
15
+ <Type>String</Type>
16
+ <Width>0</Width>
17
+ </PropertyDefn>
18
+ <PropertyDefn>
19
+ <Name>CLASS</Name>
20
+ <ElementPath>CLASS</ElementPath>
21
+ <Type>String</Type>
22
+ <Width>0</Width>
23
+ </PropertyDefn>
24
+ </GMLFeatureClass>
25
+ </GMLFeatureClassList>
@@ -0,0 +1,99 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <ogr:FeatureCollection
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:schemaLocation="charplacement.xsd"
5
+ xmlns:ogr="http://ogr.maptools.org/"
6
+ xmlns:gml="http://www.opengis.net/gml">
7
+ <gml:boundedBy>
8
+ <gml:Box>
9
+ <gml:coord><gml:X>0</gml:X><gml:Y>0</gml:Y></gml:coord>
10
+ <gml:coord><gml:X>13</gml:X><gml:Y>-13</gml:Y></gml:coord>
11
+ </gml:Box>
12
+ </gml:boundedBy>
13
+ <gml:featureMember>
14
+
15
+ <ogr:charplacement fid="F0">
16
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>2,-1 1,-3 2,-5</gml:coordinates></gml:LineString></ogr:geometryProperty>
17
+ <ogr:NAME>Road Name</ogr:NAME>
18
+ <ogr:CLASS>TRIANGLE</ogr:CLASS>
19
+ </ogr:charplacement>
20
+ <ogr:charplacement fid="F1">
21
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>3,-1 4,-3 3,-5</gml:coordinates></gml:LineString></ogr:geometryProperty>
22
+ <ogr:NAME>Road Name</ogr:NAME>
23
+ <ogr:CLASS>TRIANGLE</ogr:CLASS>
24
+ </ogr:charplacement>
25
+
26
+ <ogr:charplacement fid="F7">
27
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>
28
+ 1,-12 13,-12
29
+ </gml:coordinates></gml:LineString></ogr:geometryProperty>
30
+ <ogr:NAME>Road Name</ogr:NAME>
31
+ <ogr:CLASS>STRAIGHT</ogr:CLASS>
32
+ </ogr:charplacement>
33
+ <ogr:charplacement fid="F8">
34
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>
35
+ 1,-13 2,-13 5,-13 10,-13 13,-13
36
+ </gml:coordinates></gml:LineString></ogr:geometryProperty>
37
+ <ogr:NAME>Road Name</ogr:NAME>
38
+ <ogr:CLASS>STRAIGHT</ogr:CLASS>
39
+ </ogr:charplacement>
40
+
41
+ <ogr:charplacement fid="F9">
42
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>6,-1 5,-3 5,-5</gml:coordinates></gml:LineString></ogr:geometryProperty>
43
+ <ogr:NAME>Road Name</ogr:NAME>
44
+ <ogr:CLASS>BEND</ogr:CLASS>
45
+ </ogr:charplacement>
46
+ <ogr:charplacement fid="F10">
47
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>7,-1 8,-3 8,-5</gml:coordinates></gml:LineString></ogr:geometryProperty>
48
+ <ogr:NAME>Road Name</ogr:NAME>
49
+ <ogr:CLASS>BEND</ogr:CLASS>
50
+ </ogr:charplacement>
51
+ <ogr:charplacement fid="F11">
52
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>5,-6 5,-8 6,-10</gml:coordinates></gml:LineString></ogr:geometryProperty>
53
+ <ogr:NAME>Road Name</ogr:NAME>
54
+ <ogr:CLASS>BEND</ogr:CLASS>
55
+ </ogr:charplacement>
56
+ <ogr:charplacement fid="F12">
57
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>8,-6 8,-8 7,-10</gml:coordinates></gml:LineString></ogr:geometryProperty>
58
+ <ogr:NAME>Road Name</ogr:NAME>
59
+ <ogr:CLASS>BEND</ogr:CLASS>
60
+ </ogr:charplacement>
61
+
62
+ <ogr:charplacement fid="F13">
63
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>10.055915,-1.00031738281 10.6649858,-1.077712483 11.274056,-1.26950068 11.77921,-1.55298308 12.191993,-1.92815928 12.51529,-2.369132 12.746218,-2.8329032 12.884774,-3.2968745 12.930959,-3.875339</gml:coordinates></gml:LineString></ogr:geometryProperty>
64
+ <ogr:NAME>Road Name</ogr:NAME>
65
+ <ogr:CLASS>CURVE</ogr:CLASS>
66
+ </ogr:charplacement>
67
+ <ogr:charplacement fid="F14">
68
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>10.0555,-8.875339 10.6645708,-8.7979439 11.273641,-8.6061557 11.778795,-8.3226733 12.191578,-7.9474971 12.514875,-7.5065244 12.745803,-7.0427532 12.884359,-6.5787819 12.930544,-6.0003174</gml:coordinates></gml:LineString></ogr:geometryProperty>
69
+ <ogr:NAME>Road Name</ogr:NAME>
70
+ <ogr:CLASS>CURVE</ogr:CLASS>
71
+ </ogr:charplacement>
72
+
73
+ <ogr:charplacement fid="F15">
74
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>
75
+ 9.055915,-2.00031738281 9.6649858,-2.077712483 10.274056,-2.26950068 10.77921,-2.55298308 11.191993,-2.92815928 11.51529,-3.369132 11.746218,-3.8329032 11.884774,-4.2968745 11.930959,-4.875339
76
+ 11.930544,-5.0003174 11.884359,-5.5787819 11.745803,-6.0427532 11.514875,-6.5065244 11.191578,-6.9474971 10.778795,-7.3226733 10.273641,-7.6061557 9.6645708,-7.7979439 9.0555,-7.875339
77
+ </gml:coordinates></gml:LineString></ogr:geometryProperty>
78
+ <ogr:NAME>Road Name</ogr:NAME>
79
+ <ogr:CLASS>CURVE</ogr:CLASS>
80
+ </ogr:charplacement>
81
+
82
+ <ogr:charplacement fid="F16">
83
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>
84
+ 9.0435048,-10.5550195 9.480786,-10.2191668 9.963148,-10.0731439 10.540222,-10.2495527 10.968444,-10.525815 11.419238,-10.8336443 12.01882,-10.9565825 12.559787,-10.7996079 12.956495,-10.4089966
85
+ </gml:coordinates></gml:LineString></ogr:geometryProperty>
86
+ <ogr:NAME>Road Name</ogr:NAME>
87
+ <ogr:CLASS>SQUIGGLE</ogr:CLASS>
88
+ </ogr:charplacement>
89
+
90
+ <ogr:charplacement fid="F16">
91
+ <ogr:geometryProperty><gml:LineString><gml:coordinates>
92
+ 1,-9 1.4,-10 1.8,-9 2.2,-10 2.6,-9 3.0,-10 3.4,-9 3.8,-10 4.2,-9 4.6,-10
93
+ </gml:coordinates></gml:LineString></ogr:geometryProperty>
94
+ <ogr:NAME>Long ZigZag Road Name</ogr:NAME>
95
+ <ogr:CLASS>ZIGZAG</ogr:CLASS>
96
+ </ogr:charplacement>
97
+
98
+ </gml:featureMember>
99
+ </ogr:FeatureCollection>