Advertisement
Guest User

Working Mapserver map file

a guest
Oct 21st, 2012
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.69 KB | None | 0 0
  1. # Working Mapserver map file
  2.  
  3. MAP
  4. ################
  5. # Map attributes
  6. ################
  7. IMAGETYPE PNG
  8.  
  9. # Extent options
  10. # epsg:26915
  11. SIZE 700 700
  12. IMAGECOLOR 255 255 254
  13. TRANSPARENT ON
  14. FONTSET "/home/matt/votevis/mapserver-files/fonts/fonts.list"
  15.  
  16.  
  17. EXTENT -10879406.34 5308456.81 -9951631.67 6344157.39
  18. PROJECTION
  19. "init=epsg:900913"
  20. END
  21.  
  22.  
  23. ################
  24. # Symbol Defs
  25. ################
  26. SYMBOL
  27. NAME "circle"
  28. FILLED true
  29. TYPE ellipse
  30. POINTS 1 1 END
  31. END
  32.  
  33. ########################################################################
  34. # Layers
  35. ########################################################################
  36.  
  37. #...................................................................
  38. # VTD / Precinct Color
  39. #...................................................................
  40. LAYER
  41. NAME "vtd_color"
  42. DATA "/var/www/votevis/MN/2012-election/stsen/vtd2012general"
  43. STATUS default
  44. TYPE polygon
  45.  
  46. PROJECTION
  47. "init=epsg:26915"
  48. END
  49.  
  50. CLASS
  51. # Precinct is unreported
  52. # V_O_N := Votes for Office (N, or Count)
  53. NAME "Unreported"
  54. EXPRESSION ( [V_O_N] = 0 )
  55. COLOR 0 255 0
  56. END
  57. CLASS
  58. # Expression: is tied if margin of win is 0, but total votes for office is > 0
  59. # V_M_N := Votes, Margin of Win (N, or count)
  60. NAME "Tied"
  61. EXPRESSION ( ( [V_M_N] = 0 ) && ([V_O_N] > 0) )
  62. COLOR 255 255 0
  63. END
  64. CLASS
  65. # Expression : Winning party is DFL and margin of win is greater than 20%
  66. # V_M_P := Votes, Margin of Win (Percent of winner - percent of 2nd place finisher)
  67. # PARTY := Winning party
  68. NAME "DFL > 20% Win"
  69. EXPRESSION ( ("[PARTY]" = "DFL") && ([V_M_P] >= 20) )
  70. COLOR 0 34 102
  71. END
  72. CLASS
  73. # Expression : Winning party is DFL and margin of win is greater than 10%
  74. NAME "DFL > 10% Win"
  75. EXPRESSION ( ("[PARTY]" = "DFL") && ([V_M_P] >= 10) )
  76. COLOR 65 105 225
  77. END
  78. CLASS
  79. # Expression : Winning party is DFL and margin of win is less than 10%
  80. NAME "DFL Win"
  81. EXPRESSION ("[PARTY]" = "DFL")
  82. COLOR 135 206 235
  83. END
  84. CLASS
  85. # Expression : Winning party is R and margin of win is greater than 20%
  86. NAME "R > 20% Win"
  87. EXPRESSION ( ("[PARTY]" = "R") && ([V_M_P] >= 20) )
  88. COLOR 139 0 0
  89. END
  90. CLASS
  91. # Expression : Winning party is R and margin of win is greater than 10%
  92. NAME "R > 10% Win"
  93. EXPRESSION ( ("[PARTY]" = "R") && ([V_M_P] >= 10) )
  94. COLOR 255 0 0
  95. END
  96. CLASS
  97. # Expression : Winning party is R and margin of win is less than 10%
  98. NAME "R Win"
  99. EXPRESSION ("[PARTY]" = "R")
  100. COLOR 255 192 203
  101. END
  102. END # layer prct_color
  103.  
  104.  
  105. #...................................................................
  106. # VTD / Precinct Border
  107. #...................................................................
  108. LAYER
  109. NAME "prct_border"
  110. DATA "/var/www/votevis/MN/2012-election/stsen/vtd2012general"
  111. STATUS default
  112. TYPE line
  113.  
  114. PROJECTION
  115. "init=epsg:26915"
  116. END
  117.  
  118. CLASS
  119. NAME "prct_border_1"
  120. MAXSCALEDENOM 700000
  121. MINSCALEDENOM 200001
  122.  
  123. STYLE
  124. COLOR 0 0 0
  125. WIDTH 2.0
  126. LINECAP BUTT
  127. #PATTERN 8 12 END
  128. #PATTERN 2 5 END
  129. END # STYLE
  130.  
  131.  
  132. END # Class
  133.  
  134. CLASS
  135. NAME "prct_border_2"
  136. MAXSCALEDENOM 200000
  137.  
  138. STYLE
  139. COLOR 0 0 0
  140. WIDTH 3.0
  141. LINECAP BUTT
  142. #PATTERN 8 12 END
  143. #PATTERN 2 5 END
  144. END # STYLE
  145.  
  146. END # Class
  147. END # layer prct_border
  148.  
  149.  
  150.  
  151. #---------------------------------------------------------------
  152. # Precinct Annotation
  153. #---------------------------------------------------------------
  154. LAYER
  155. NAME "prct_anno"
  156. DATA "/var/www/votevis/MN/2012-election/stsen/vtd2012general"
  157. STATUS default
  158. TYPE annotation
  159. MAXSCALEDENOM 200000
  160. LABELITEM "PCT_NM"
  161.  
  162. PROJECTION
  163. "init=epsg:26915"
  164. END
  165.  
  166. CLASS
  167. NAME "prct_anno"
  168. LABEL
  169. FONT "vera_sans"
  170. TYPE truetype
  171. SIZE 7
  172. COLOR 0 0 0
  173. POSITION cc
  174. MINFEATURESIZE 100
  175. STYLE
  176. GEOMTRANSFORM 'labelpoly' #bbox
  177. COLOR 255 255 255
  178. END
  179. BUFFER 10
  180. WRAP " "
  181. END
  182. END
  183.  
  184. END # layer prct_border
  185.  
  186.  
  187.  
  188.  
  189.  
  190. #...................................................................
  191. # Senate District Border
  192. #...................................................................
  193. LAYER
  194. NAME "sendist_border"
  195. DATA "/var/www/votevis/MN/2012-election/stsen/S2012"
  196. STATUS default
  197. TYPE line
  198.  
  199. PROJECTION
  200. "init=epsg:26915"
  201. END
  202.  
  203. CLASS
  204. NAME "sd_border_1"
  205. STYLE
  206. COLOR 102 102 102
  207. WIDTH 3.0
  208. END # STYLE
  209. STYLE
  210. COLOR 255 255 255
  211. WIDTH 1.0
  212. LINECAP BUTT
  213. PATTERN 8 12 END
  214. END # STYLE
  215. END # CLASS
  216.  
  217.  
  218.  
  219. END # layer sendist_border
  220.  
  221.  
  222.  
  223. #---------------------------------------------------------------
  224. # Senate District Annotation
  225. #---------------------------------------------------------------
  226. LAYER
  227. NAME "sd_anno"
  228. DATA "/var/www/votevis/MN/2012-election/stsen/S2012"
  229. STATUS default
  230. TYPE annotation
  231. # MAXSCALEDENOM 200000
  232. LABELITEM "DISTRICT"
  233.  
  234. PROJECTION
  235. "init=epsg:26915"
  236. END
  237.  
  238. CLASS
  239. NAME "sd_anno"
  240. LABEL
  241. FONT "vera_sans"
  242. TYPE truetype
  243. SIZE 11
  244. COLOR 0 0 0
  245. POSITION cc
  246. MINFEATURESIZE 100
  247. STYLE
  248. GEOMTRANSFORM 'labelpoly' #bbox
  249. # COLOR 255 255 255
  250. COLOR 255 222 173
  251. END
  252. BUFFER 10
  253. WRAP " "
  254. END
  255. END
  256.  
  257. END # layer sd_anno
  258.  
  259.  
  260.  
  261.  
  262.  
  263. END # MAP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement