Advertisement
Guest User

WMS mapfile that is problematic

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