From f31ba7e2c98ff3c1ccab81c17bfec79cd7a9065a Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Sun, 31 Jan 2016 23:39:59 +0000 Subject: [PATCH] Imagery - additional mapserver param support --- cookbooks/imagery/recipes/au_agri.rb | 3 +- cookbooks/imagery/recipes/default.rb | 5 ++ cookbooks/imagery/recipes/gb_os_sv.rb | 48 +++++-------------- .../templates/default/mapserver.map.erb | 21 ++++++++ 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/cookbooks/imagery/recipes/au_agri.rb b/cookbooks/imagery/recipes/au_agri.rb index dc9258fc2..d17e726d5 100644 --- a/cookbooks/imagery/recipes/au_agri.rb +++ b/cookbooks/imagery/recipes/au_agri.rb @@ -20,7 +20,7 @@ include_recipe "imagery" imagery_site "agri.openstreetmap.org" do - aliases [ "agri.openstreetmap.org.au" ] + # aliases [ "agri.openstreetmap.org.au" ] end imagery_layer "au_ga_agri" do @@ -28,6 +28,7 @@ imagery_layer "au_ga_agri" do root_layer true text "AGRI: The Australian Geographic Reference Image" copyright "Commonwealth of Australia (Geoscience Australia) - Creative Commons Attribution 4.0 International Licence" + background_colour "0 0 0" # Black projection "EPSG:3857" source "/data/imagery/au/agri/combine.vrt" end diff --git a/cookbooks/imagery/recipes/default.rb b/cookbooks/imagery/recipes/default.rb index 99a8c1700..809370d4a 100644 --- a/cookbooks/imagery/recipes/default.rb +++ b/cookbooks/imagery/recipes/default.rb @@ -72,3 +72,8 @@ execute "unzip-ostn02-ntv2-data" do group "root" not_if { File.exist?("/srv/imagery/common/ostn02-ntv2-data/OSTN02_NTv2.gsb") } end + +nginx_site "default" do + action [:delete] + restart_nginx false +end diff --git a/cookbooks/imagery/recipes/gb_os_sv.rb b/cookbooks/imagery/recipes/gb_os_sv.rb index 6f3e75651..c0680d433 100644 --- a/cookbooks/imagery/recipes/gb_os_sv.rb +++ b/cookbooks/imagery/recipes/gb_os_sv.rb @@ -36,9 +36,7 @@ imagery_layer "gb_os_sv_2010_04" do source "/data/imagery/gb/os-sv/ossv-2010-04-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2010" # FIXME: Correct Copyright? background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2010-04" ] end @@ -48,9 +46,7 @@ imagery_layer "gb_os_sv_2010_11" do source "/data/imagery/gb/os-sv/ossv-2010-11-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2010" # FIXME: Correct Copyright? background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2010-11" ] end @@ -60,9 +56,7 @@ imagery_layer "gb_os_sv_2011_05" do source "/data/imagery/gb/os-sv/ossv-2011-05-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2011" # FIXME: Correct Copyright? background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2011-05" ] end @@ -72,9 +66,7 @@ imagery_layer "gb_os_sv_2011_11" do source "/data/imagery/gb/os-sv/ossv-2011-11-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2011" # FIXME: Correct Copyright? background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2011-11" ] end @@ -84,9 +76,7 @@ imagery_layer "gb_os_sv_2012_05" do source "/data/imagery/gb/os-sv/ossv-2012-05-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2012" background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2012-05" ] end @@ -96,9 +86,7 @@ imagery_layer "gb_os_sv_2012_11" do source "/data/imagery/gb/os-sv/ossv-2012-11-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2012" background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2012-11" ] end @@ -108,9 +96,7 @@ imagery_layer "gb_os_sv_2013_05" do source "/data/imagery/gb/os-sv/ossv-2013-05-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2013" background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2013-05" ] end @@ -120,9 +106,7 @@ imagery_layer "gb_os_sv_2013_11" do source "/data/imagery/gb/os-sv/ossv-2013-11-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2013" background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2013-11" ] end @@ -132,9 +116,7 @@ imagery_layer "gb_os_sv_2014_04" do source "/data/imagery/gb/os-sv/ossv-2014-04-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2014" background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2014-04" ] end @@ -144,9 +126,7 @@ imagery_layer "gb_os_sv_2014_10" do source "/data/imagery/gb/os-sv/ossv-2014-10-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2014" background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2014-10" ] end @@ -156,9 +136,7 @@ imagery_layer "gb_os_sv_2015_05" do source "/data/imagery/gb/os-sv/ossv-2015-05-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2015" background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2015-05" ] end @@ -169,8 +147,6 @@ imagery_layer "gb_os_sv_2015_11" do source "/data/imagery/gb/os-sv/ossv-2015-11-combined.vrt" copyright "Contains Ordnance Survey data © Crown copyright and database right 2015" background_colour "230 246 255" # OSSV Water Blue - extension "png" - palette "/srv/imagery/common/ossv-palette.txt" - extent "5000 5000 660000 1225000" + extension "os_sv_png" url_aliases [ "/sv-2015-11", "/sv" ] end diff --git a/cookbooks/imagery/templates/default/mapserver.map.erb b/cookbooks/imagery/templates/default/mapserver.map.erb index 2c271a5fb..b32f7f6e6 100644 --- a/cookbooks/imagery/templates/default/mapserver.map.erb +++ b/cookbooks/imagery/templates/default/mapserver.map.erb @@ -1,9 +1,25 @@ # DO NOT EDIT - This file is being maintained by Chef MAP +<% if @extension == "os_sv_png" -%> + OUTPUTFORMAT + NAME "os_sv_png" + DRIVER AGG/PNG + MIMETYPE "image/png" + IMAGEMODE RGB + EXTENSION "png" + FORMATOPTION "COMPRESSION=9" + FORMATOPTION "PALETTE_FORCE=on" + FORMATOPTION "PALETTE=/srv/imagery/common/ossv-palette.txt" + END +<% end -%> + NAME "map-<%= @layer %>" STATUS ON SIZE 256 256 UNITS METERS + <% if @background_colour -%> + IMAGECOLOR <%= @background_colour %> + <% end -%> IMAGETYPE <%= @extension %> PROJECTION "init=<%= @projection.downcase %>" @@ -13,7 +29,12 @@ MAP NAME "<%= @layer %>" DATA "<%= @source %>" PROJECTION + <% if @projection == "EPSG:27700" -%> + <%# Override EPSG:27700 to use accurate nadgrid %> + "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs +nadgrids=/srv/imagery/common/ostn02-ntv2-data/OSTN02_NTv2.gsb" + <% else -%> "init=<%= @projection.downcase %>" + <% end -%> END STATUS DEFAULT TYPE RASTER -- 2.39.5