mapnik 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. data/.autotest +35 -0
  2. data/.yardopts +1 -0
  3. data/Gemfile +14 -0
  4. data/LICENSE +19 -0
  5. data/Manifest.txt +172 -0
  6. data/README.rdoc +107 -0
  7. data/Rakefile +43 -0
  8. data/demo/data/COPYRIGHT.txt +3 -0
  9. data/demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.dbf +0 -0
  10. data/demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.prj +1 -0
  11. data/demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shp +0 -0
  12. data/demo/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shx +0 -0
  13. data/demo/data/boundaries.dbf +0 -0
  14. data/demo/data/boundaries.prj +1 -0
  15. data/demo/data/boundaries.sbx +0 -0
  16. data/demo/data/boundaries.shp +0 -0
  17. data/demo/data/boundaries.shx +0 -0
  18. data/demo/data/boundaries_l.dbf +0 -0
  19. data/demo/data/boundaries_l.prj +1 -0
  20. data/demo/data/boundaries_l.sbx +0 -0
  21. data/demo/data/boundaries_l.shp +0 -0
  22. data/demo/data/boundaries_l.shx +0 -0
  23. data/demo/data/ontdrainage.dbf +0 -0
  24. data/demo/data/ontdrainage.prj +1 -0
  25. data/demo/data/ontdrainage.sbx +0 -0
  26. data/demo/data/ontdrainage.shp +0 -0
  27. data/demo/data/ontdrainage.shx +0 -0
  28. data/demo/data/popplaces.dbf +0 -0
  29. data/demo/data/popplaces.prj +1 -0
  30. data/demo/data/popplaces.sbx +0 -0
  31. data/demo/data/popplaces.shp +0 -0
  32. data/demo/data/popplaces.shx +0 -0
  33. data/demo/data/qcdrainage.dbf +0 -0
  34. data/demo/data/qcdrainage.prj +1 -0
  35. data/demo/data/qcdrainage.sbx +0 -0
  36. data/demo/data/qcdrainage.shp +0 -0
  37. data/demo/data/qcdrainage.shx +0 -0
  38. data/demo/data/roads.dbf +0 -0
  39. data/demo/data/roads.prj +1 -0
  40. data/demo/data/roads.sbx +0 -0
  41. data/demo/data/roads.shp +0 -0
  42. data/demo/data/roads.shx +0 -0
  43. data/demo/data/test/charplacement.dbf +0 -0
  44. data/demo/data/test/charplacement.shp +0 -0
  45. data/demo/data/test/charplacement.shx +0 -0
  46. data/demo/data/test/displacement.dbf +0 -0
  47. data/demo/data/test/displacement.shp +0 -0
  48. data/demo/data/test/displacement.shx +0 -0
  49. data/demo/data/test/overlap.dbf +0 -0
  50. data/demo/data/test/overlap.shp +0 -0
  51. data/demo/data/test/overlap.shx +0 -0
  52. data/demo/data/test/raw/charplacement.gfs +25 -0
  53. data/demo/data/test/raw/charplacement.gml +99 -0
  54. data/demo/data/test/raw/charplacement.xsd +36 -0
  55. data/demo/data/test/raw/displacement.gfs +25 -0
  56. data/demo/data/test/raw/displacement.gml +173 -0
  57. data/demo/data/test/raw/displacement.xsd +36 -0
  58. data/demo/data/test/raw/overlap.gfs +25 -0
  59. data/demo/data/test/raw/overlap.gml +127 -0
  60. data/demo/data/test/raw/overlap.xsd +36 -0
  61. data/demo/data/test/raw/textspacing.gfs +25 -0
  62. data/demo/data/test/raw/textspacing.gml +117 -0
  63. data/demo/data/test/raw/textspacing.xsd +36 -0
  64. data/demo/data/test/readme.txt +3 -0
  65. data/demo/data/test/regenerate.sh +20 -0
  66. data/demo/data/test/textspacing.dbf +0 -0
  67. data/demo/data/test/textspacing.shp +0 -0
  68. data/demo/data/test/textspacing.shx +0 -0
  69. data/demo/rundemo.rb +145 -0
  70. data/demo/sinatra/demo.rb +31 -0
  71. data/demo/sinatra/public/css/demo_map.css +7 -0
  72. data/demo/sinatra/public/index.html +13 -0
  73. data/demo/sinatra/public/javascripts/demo_map.js +42 -0
  74. data/ext/ruby_mapnik/_mapnik.cpp +52 -0
  75. data/ext/ruby_mapnik/_mapnik.h +65 -0
  76. data/ext/ruby_mapnik/_mapnik_color.rb.cpp +179 -0
  77. data/ext/ruby_mapnik/_mapnik_color.rb.h +32 -0
  78. data/ext/ruby_mapnik/_mapnik_coord.rb.cpp +145 -0
  79. data/ext/ruby_mapnik/_mapnik_coord.rb.h +32 -0
  80. data/ext/ruby_mapnik/_mapnik_datasource.rb.cpp +170 -0
  81. data/ext/ruby_mapnik/_mapnik_datasource.rb.h +32 -0
  82. data/ext/ruby_mapnik/_mapnik_datasource_cache.rb.cpp +87 -0
  83. data/ext/ruby_mapnik/_mapnik_datasource_cache.rb.h +32 -0
  84. data/ext/ruby_mapnik/_mapnik_envelope.rb.cpp +220 -0
  85. data/ext/ruby_mapnik/_mapnik_envelope.rb.h +32 -0
  86. data/ext/ruby_mapnik/_mapnik_expression.rb.cpp +91 -0
  87. data/ext/ruby_mapnik/_mapnik_expression.rb.h +32 -0
  88. data/ext/ruby_mapnik/_mapnik_feature.rb.cpp +93 -0
  89. data/ext/ruby_mapnik/_mapnik_feature.rb.h +32 -0
  90. data/ext/ruby_mapnik/_mapnik_font_engine.rb.cpp +71 -0
  91. data/ext/ruby_mapnik/_mapnik_font_engine.rb.h +32 -0
  92. data/ext/ruby_mapnik/_mapnik_layer.rb.cpp +208 -0
  93. data/ext/ruby_mapnik/_mapnik_layer.rb.h +32 -0
  94. data/ext/ruby_mapnik/_mapnik_line_pattern_symbolizer.rb.cpp +71 -0
  95. data/ext/ruby_mapnik/_mapnik_line_pattern_symbolizer.rb.h +32 -0
  96. data/ext/ruby_mapnik/_mapnik_line_symbolizer.rb.cpp +43 -0
  97. data/ext/ruby_mapnik/_mapnik_line_symbolizer.rb.h +32 -0
  98. data/ext/ruby_mapnik/_mapnik_map.rb.cpp +489 -0
  99. data/ext/ruby_mapnik/_mapnik_map.rb.h +32 -0
  100. data/ext/ruby_mapnik/_mapnik_markers_symbolizer.rb.cpp +140 -0
  101. data/ext/ruby_mapnik/_mapnik_markers_symbolizer.rb.h +32 -0
  102. data/ext/ruby_mapnik/_mapnik_point_symbolizer.rb.cpp +150 -0
  103. data/ext/ruby_mapnik/_mapnik_point_symbolizer.rb.h +32 -0
  104. data/ext/ruby_mapnik/_mapnik_polygon_pattern_symbolizer.rb.cpp +93 -0
  105. data/ext/ruby_mapnik/_mapnik_polygon_pattern_symbolizer.rb.h +32 -0
  106. data/ext/ruby_mapnik/_mapnik_polygon_symbolizer.rb.cpp +89 -0
  107. data/ext/ruby_mapnik/_mapnik_polygon_symbolizer.rb.h +32 -0
  108. data/ext/ruby_mapnik/_mapnik_projection.rb.cpp +100 -0
  109. data/ext/ruby_mapnik/_mapnik_projection.rb.h +32 -0
  110. data/ext/ruby_mapnik/_mapnik_raster_colorizer.rb.cpp +162 -0
  111. data/ext/ruby_mapnik/_mapnik_raster_colorizer.rb.h +32 -0
  112. data/ext/ruby_mapnik/_mapnik_raster_symbolizer.rb.cpp +87 -0
  113. data/ext/ruby_mapnik/_mapnik_raster_symbolizer.rb.h +32 -0
  114. data/ext/ruby_mapnik/_mapnik_rule.rb.cpp +69 -0
  115. data/ext/ruby_mapnik/_mapnik_rule.rb.h +32 -0
  116. data/ext/ruby_mapnik/_mapnik_shield_symbolizer.rb.cpp +86 -0
  117. data/ext/ruby_mapnik/_mapnik_shield_symbolizer.rb.h +32 -0
  118. data/ext/ruby_mapnik/_mapnik_stroke.rb.cpp +188 -0
  119. data/ext/ruby_mapnik/_mapnik_stroke.rb.h +32 -0
  120. data/ext/ruby_mapnik/_mapnik_style.rb.cpp +76 -0
  121. data/ext/ruby_mapnik/_mapnik_style.rb.h +32 -0
  122. data/ext/ruby_mapnik/_mapnik_symbolizer.rb.cpp +75 -0
  123. data/ext/ruby_mapnik/_mapnik_symbolizer.rb.h +32 -0
  124. data/ext/ruby_mapnik/_mapnik_text_symbolizer.rb.cpp +471 -0
  125. data/ext/ruby_mapnik/_mapnik_text_symbolizer.rb.h +32 -0
  126. data/ext/ruby_mapnik/extconf.rb +80 -0
  127. data/ext/ruby_mapnik/ruby_mapnik.cpp +32 -0
  128. data/lib/mapnik.rb +1 -0
  129. data/lib/ruby_mapnik.rb +48 -0
  130. data/lib/ruby_mapnik/mapnik/font_engine.rb +35 -0
  131. data/lib/ruby_mapnik/mapnik/layer.rb +68 -0
  132. data/lib/ruby_mapnik/mapnik/map.rb +166 -0
  133. data/lib/ruby_mapnik/mapnik/projection.rb +44 -0
  134. data/lib/ruby_mapnik/mapnik/raster_colorizer.rb +55 -0
  135. data/lib/ruby_mapnik/mapnik/rule.rb +104 -0
  136. data/lib/ruby_mapnik/mapnik/stroke.rb +56 -0
  137. data/lib/ruby_mapnik/mapnik/style.rb +64 -0
  138. data/lib/ruby_mapnik/mapnik/tile.rb +93 -0
  139. data/script/console +2 -0
  140. data/test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.dbf +0 -0
  141. data/test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.prj +1 -0
  142. data/test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shp +0 -0
  143. data/test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shx +0 -0
  144. data/test/data/test_map.xml +15 -0
  145. data/test/test_helper.rb +29 -0
  146. data/test/test_line_pattern_symbolizer.rb +26 -0
  147. data/test/test_mapnik_color.rb +66 -0
  148. data/test/test_mapnik_coord.rb +92 -0
  149. data/test/test_mapnik_datasource.rb +49 -0
  150. data/test/test_mapnik_envelope.rb +232 -0
  151. data/test/test_mapnik_expression.rb +19 -0
  152. data/test/test_mapnik_feature.rb +29 -0
  153. data/test/test_mapnik_font_engine.rb +13 -0
  154. data/test/test_mapnik_layer.rb +121 -0
  155. data/test/test_mapnik_line_symbolizer.rb +25 -0
  156. data/test/test_mapnik_map.rb +211 -0
  157. data/test/test_mapnik_markers_symbolizer.rb +46 -0
  158. data/test/test_mapnik_point_symbolizer.rb +53 -0
  159. data/test/test_mapnik_polygon_symbolizer.rb +44 -0
  160. data/test/test_mapnik_projection.rb +46 -0
  161. data/test/test_mapnik_raster_colorizer.rb +56 -0
  162. data/test/test_mapnik_raster_symbolizer.rb +45 -0
  163. data/test/test_mapnik_rule.rb +45 -0
  164. data/test/test_mapnik_shield_symbolizer.rb +156 -0
  165. data/test/test_mapnik_stroke.rb +94 -0
  166. data/test/test_mapnik_style.rb +28 -0
  167. data/test/test_mapnik_symbolizer.rb +9 -0
  168. data/test/test_mapnik_text_symbolizer.rb +208 -0
  169. data/test/test_polygon_pattern_symbolizer.rb +34 -0
  170. data/test/test_ruby_mapnik.rb +34 -0
  171. data/yard/lib/yard/parser/generic_parser.rb +72 -0
  172. data/yard/lib/yard_generic.rb +18 -0
  173. metadata +333 -0
@@ -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
@@ -0,0 +1 @@
1
+ -eyard/lib/yard_generic.rb ext/**/*.cpp lib/ruby_mapnik/mapnik/*.rb
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # -*- ruby -*-
2
+
3
+ # DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
4
+
5
+ source "https://rubygems.org/"
6
+
7
+ gem "rice", ">=1.4.2"
8
+
9
+ gem "rdoc", "~>3.10", :group => [:development, :test]
10
+ gem "rake-compiler", ">=0", :group => [:development, :test]
11
+ gem "chunky_png", ">=0", :group => [:development, :test]
12
+ gem "hoe", "~>3.5", :group => [:development, :test]
13
+
14
+ # 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.
@@ -0,0 +1,172 @@
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_layer.rb.cpp
93
+ ext/ruby_mapnik/_mapnik_layer.rb.h
94
+ ext/ruby_mapnik/_mapnik_line_pattern_symbolizer.rb.cpp
95
+ ext/ruby_mapnik/_mapnik_line_pattern_symbolizer.rb.h
96
+ ext/ruby_mapnik/_mapnik_line_symbolizer.rb.cpp
97
+ ext/ruby_mapnik/_mapnik_line_symbolizer.rb.h
98
+ ext/ruby_mapnik/_mapnik_map.rb.cpp
99
+ ext/ruby_mapnik/_mapnik_map.rb.h
100
+ ext/ruby_mapnik/_mapnik_markers_symbolizer.rb.cpp
101
+ ext/ruby_mapnik/_mapnik_markers_symbolizer.rb.h
102
+ ext/ruby_mapnik/_mapnik_point_symbolizer.rb.cpp
103
+ ext/ruby_mapnik/_mapnik_point_symbolizer.rb.h
104
+ ext/ruby_mapnik/_mapnik_polygon_pattern_symbolizer.rb.cpp
105
+ ext/ruby_mapnik/_mapnik_polygon_pattern_symbolizer.rb.h
106
+ ext/ruby_mapnik/_mapnik_polygon_symbolizer.rb.cpp
107
+ ext/ruby_mapnik/_mapnik_polygon_symbolizer.rb.h
108
+ ext/ruby_mapnik/_mapnik_projection.rb.cpp
109
+ ext/ruby_mapnik/_mapnik_projection.rb.h
110
+ ext/ruby_mapnik/_mapnik_raster_colorizer.rb.cpp
111
+ ext/ruby_mapnik/_mapnik_raster_colorizer.rb.h
112
+ ext/ruby_mapnik/_mapnik_raster_symbolizer.rb.cpp
113
+ ext/ruby_mapnik/_mapnik_raster_symbolizer.rb.h
114
+ ext/ruby_mapnik/_mapnik_rule.rb.cpp
115
+ ext/ruby_mapnik/_mapnik_rule.rb.h
116
+ ext/ruby_mapnik/_mapnik_shield_symbolizer.rb.cpp
117
+ ext/ruby_mapnik/_mapnik_shield_symbolizer.rb.h
118
+ ext/ruby_mapnik/_mapnik_stroke.rb.cpp
119
+ ext/ruby_mapnik/_mapnik_stroke.rb.h
120
+ ext/ruby_mapnik/_mapnik_style.rb.cpp
121
+ ext/ruby_mapnik/_mapnik_style.rb.h
122
+ ext/ruby_mapnik/_mapnik_symbolizer.rb.cpp
123
+ ext/ruby_mapnik/_mapnik_symbolizer.rb.h
124
+ ext/ruby_mapnik/_mapnik_text_symbolizer.rb.cpp
125
+ ext/ruby_mapnik/_mapnik_text_symbolizer.rb.h
126
+ ext/ruby_mapnik/extconf.rb
127
+ ext/ruby_mapnik/ruby_mapnik.cpp
128
+ lib/mapnik.rb
129
+ lib/ruby_mapnik.rb
130
+ lib/ruby_mapnik/mapnik/font_engine.rb
131
+ lib/ruby_mapnik/mapnik/layer.rb
132
+ lib/ruby_mapnik/mapnik/map.rb
133
+ lib/ruby_mapnik/mapnik/projection.rb
134
+ lib/ruby_mapnik/mapnik/raster_colorizer.rb
135
+ lib/ruby_mapnik/mapnik/rule.rb
136
+ lib/ruby_mapnik/mapnik/stroke.rb
137
+ lib/ruby_mapnik/mapnik/style.rb
138
+ lib/ruby_mapnik/mapnik/tile.rb
139
+ script/console
140
+ test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.dbf
141
+ test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.prj
142
+ test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shp
143
+ test/data/TM_WORLD_BORDERS_SIMPL_0.3_MOD.shx
144
+ test/data/test_map.xml
145
+ test/test_helper.rb
146
+ test/test_line_pattern_symbolizer.rb
147
+ test/test_mapnik_color.rb
148
+ test/test_mapnik_coord.rb
149
+ test/test_mapnik_datasource.rb
150
+ test/test_mapnik_envelope.rb
151
+ test/test_mapnik_expression.rb
152
+ test/test_mapnik_feature.rb
153
+ test/test_mapnik_font_engine.rb
154
+ test/test_mapnik_layer.rb
155
+ test/test_mapnik_line_symbolizer.rb
156
+ test/test_mapnik_map.rb
157
+ test/test_mapnik_markers_symbolizer.rb
158
+ test/test_mapnik_point_symbolizer.rb
159
+ test/test_mapnik_polygon_symbolizer.rb
160
+ test/test_mapnik_projection.rb
161
+ test/test_mapnik_raster_colorizer.rb
162
+ test/test_mapnik_raster_symbolizer.rb
163
+ test/test_mapnik_rule.rb
164
+ test/test_mapnik_shield_symbolizer.rb
165
+ test/test_mapnik_stroke.rb
166
+ test/test_mapnik_style.rb
167
+ test/test_mapnik_symbolizer.rb
168
+ test/test_mapnik_text_symbolizer.rb
169
+ test/test_polygon_pattern_symbolizer.rb
170
+ test/test_ruby_mapnik.rb
171
+ yard/lib/yard/parser/generic_parser.rb
172
+ yard/lib/yard_generic.rb
@@ -0,0 +1,107 @@
1
+ = Ruby Mapnik
2
+
3
+ https://github.com/mapnik/Ruby-Mapnik
4
+
5
+ {<img src="https://travis-ci.org/mapnik/Ruby-Mapnik.svg?branch=master" alt="Build Status">}[https://travis-ci.org/mapnik/Ruby-Mapnik]
6
+
7
+ == Requirements
8
+
9
+ * Rake (and extentiontask)
10
+ * Rice >= 1.4.2 (build depends on autoconf)
11
+ * rcairo (https://github.com/rcairo/rcairo) (Optional)
12
+ * Mapnik 2.3.x or 2.2.x (Currently available at https://github.com/mapnik/mapnik)
13
+
14
+ On OS X install ruby deps like:
15
+
16
+ export ARCHFLAGS="-arch x86_64"
17
+ gem install rake-compiler rake hoe rice chunky_png cairo
18
+
19
+ == Description
20
+
21
+ A set of bindings between Ruby and Mapnik. Supports many of the common uses for
22
+ Mapnik, and one day, might support all of them. Rendering is available using
23
+ the standard AGG library, or additionally via Cairo, if the rcairo gem is
24
+ installed and Mapnik has been compiled with Cairo support.
25
+
26
+ == Installation
27
+
28
+ If you have checked out this local repository code build like:
29
+
30
+ rake
31
+
32
+ The above command will compile the bindings and run the tests.
33
+
34
+ File issues at https://github.com/mapnik/Ruby-Mapnik/issues if you hit any compile errors.
35
+
36
+ To create a gem from your local repository and install it run:
37
+
38
+ rake gem
39
+ gem install pkg/ruby_mapnik-0.x.y.gem
40
+
41
+ Alternatively, if you wish to install Ruby-Mapnik from the latest tagged release you can do:
42
+
43
+ gem install ruby_mapnik
44
+
45
+ Note: on osx the default rake compile will try to build universal, and your
46
+ mapnik install is unlikely built universal. Check the architecture of libmapnik.dylib like:
47
+
48
+ file /usr/local/lib/libmapnik.dylib
49
+
50
+ On a system where your compiler defaults to 64bit you'll see: 'Mach-O 64-bit dynamically linked shared library x86_64'
51
+
52
+ So to avoid a linking warning like:
53
+
54
+ ld: warning: ignoring file /usr/local/lib/libmapnik.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
55
+
56
+ You can pass this before rake compile:
57
+
58
+ export ARCHFLAGS="-arch x86_64"
59
+
60
+ == Synopsis
61
+
62
+ require 'mapnik'
63
+
64
+ map = Mapnik::Map.new do |m|
65
+
66
+ # A grey background
67
+ m.background = Mapnik::Color.new('#777')
68
+
69
+ # Use the Google mercator projection
70
+ m.srs = Mapnik::Tile::DEFAULT_OUTPUT_PROJECTION
71
+
72
+ # Add a layer to the map
73
+ m.layer 'countries' do |l|
74
+
75
+ # Add a style to the layer
76
+ l.style do |s|
77
+
78
+ # Add a rule to the style (this one is a default rule)
79
+ s.rule do |default|
80
+
81
+ #fill the shapes with polygon symbolizers
82
+ default.fill = Mapnik::Color.new('#880000')
83
+ end
84
+ end
85
+
86
+ # set the srs of the layer
87
+ l.srs = "+proj=latlong +datum=WGS84"
88
+
89
+ #specify the datasource for the layer
90
+ l.datasource = Mapnik::Datasource.create :type => 'shape', :file => "#{PATH}/../data/TM_WORLD_BORDERS_SIMPL_0.3_MOD"
91
+ end
92
+
93
+ end
94
+
95
+ map.zoom_to_box(map.layers.first.envelope)
96
+ map.render_to_file('my_map.png')
97
+
98
+ == Examples
99
+
100
+ See demo/rundemo.rb for the classic mapnik rundemo. Also see demo/sinatra/demo.rb
101
+ for a simple tile server (requires the sinatra gem).
102
+
103
+ == Thanks
104
+
105
+ Thanks to the Mapnik team and especially to Dane Springmeyer!
106
+
107
+
@@ -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, :gemspec
27
+
28
+ Hoe.spec 'mapnik' do
29
+ developer('Andy Allan', 'info@gravitystorm.co.uk')
30
+ self.readme_file = 'README.rdoc'
31
+ self.history_file = 'History.txt'
32
+ self.extra_deps << ['rice', '>= 1.4.2']
33
+ self.extra_dev_deps << ['rake-compiler', '>= 0']
34
+ self.extra_dev_deps << ['chunky_png', '>= 0']
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
@@ -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
@@ -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