From e71e016abee9ae32dd357c4765bb7552d5455dde Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Sun, 17 Jan 2016 23:42:44 +0000 Subject: [PATCH] Imagery: au-agri, hamps-aerial, ossv, surrey-aerial Imagery rubocop fixes Imagery robocop fixes x2 Imagery robocop fixes x3 --- cookbooks/imagery/recipes/au_agri.rb | 32 ++++ .../imagery/recipes/gb_hampshire_aerial.rb | 38 +++++ cookbooks/imagery/recipes/gb_os_sv.rb | 156 ++++++++++++++++++ cookbooks/imagery/recipes/gb_surrey_aerial.rb | 28 ++++ cookbooks/imagery/resources/layer.rb | 6 +- cookbooks/imagery/resources/site.rb | 3 +- 6 files changed, 258 insertions(+), 5 deletions(-) create mode 100644 cookbooks/imagery/recipes/au_agri.rb create mode 100644 cookbooks/imagery/recipes/gb_hampshire_aerial.rb create mode 100644 cookbooks/imagery/recipes/gb_os_sv.rb create mode 100644 cookbooks/imagery/recipes/gb_surrey_aerial.rb diff --git a/cookbooks/imagery/recipes/au_agri.rb b/cookbooks/imagery/recipes/au_agri.rb new file mode 100644 index 000000000..3474c4cda --- /dev/null +++ b/cookbooks/imagery/recipes/au_agri.rb @@ -0,0 +1,32 @@ +# +# Cookbook Name:: imagery +# Recipe:: au-agri +# +# Copyright 2016, OpenStreetMap Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe "imagery" + +imagery_site "agri.openstreetmap.org" do + # aliases ["agri.openstreetmap.org.au"] + + imagery_layer "au_ga_agri" do + site new_resource.name + text "AGRI: The Australian Geographic Reference Image" + copyright "Commonwealth of Australia (Geoscience Australia) - Creative Commons Attribution 4.0 International Licence" + projection "EPSG:3857" + source "/data/imagery/au/agri/combine.vrt" + end +end diff --git a/cookbooks/imagery/recipes/gb_hampshire_aerial.rb b/cookbooks/imagery/recipes/gb_hampshire_aerial.rb new file mode 100644 index 000000000..8209c0d28 --- /dev/null +++ b/cookbooks/imagery/recipes/gb_hampshire_aerial.rb @@ -0,0 +1,38 @@ +# +# Cookbook Name:: imagery +# Recipe:: gb-hampshire-aerial +# +# Copyright 2016, OpenStreetMap Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe "imagery" + +imagery_site "hampshire.aerial.openstreetmap.org.uk" do + imagery_layer "gb_hampshire_aerial-rgb" do + site new_resource.name + text "Hampshire Aerial - Summer 2013" + source "/data/imagery/gb/hampshire-aerial/hampshire-aerial-RGB.tif" + projection "EPSG:27700" + copyright "Hampshire Hub - Open Government Licence (OGL) 2014" + end + + imagery_layer "gb_hampshire_aerial_fcir" do + site new_resource.name + text "Hampshire Aerial - Summer 2013 (FCIR)" + source "/data/imagery/gb/hampshire-aerial/hampshire-aerial-FCIR.tif" + projection "EPSG:27700" + copyright "Hampshire Hub - Open Government Licence (OGL) 2014" + end +end diff --git a/cookbooks/imagery/recipes/gb_os_sv.rb b/cookbooks/imagery/recipes/gb_os_sv.rb new file mode 100644 index 000000000..31ff87a72 --- /dev/null +++ b/cookbooks/imagery/recipes/gb_os_sv.rb @@ -0,0 +1,156 @@ +# +# Cookbook Name:: imagery +# Recipe:: gb-ossv +# +# Copyright 2016, OpenStreetMap Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe "imagery" + +imagery_site "os.openstreetmap.org" do + aliases ["os.openstreetmap.org.uk"] + + imagery_layer "gb_os_sv_2010_04" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2010_11" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2011_05" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2011_11" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2012_05" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2012_11" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2013_05" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2013_11" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2014_04" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2014_10" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2015-05" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end + + imagery_layer "gb_os_sv_2015_11" do + site new_resource.name + projection "EPSG:27700" + 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 "ossv-palette.txt" + extent "5000 5000 660000 1225000" + end +end diff --git a/cookbooks/imagery/recipes/gb_surrey_aerial.rb b/cookbooks/imagery/recipes/gb_surrey_aerial.rb new file mode 100644 index 000000000..97bc879c9 --- /dev/null +++ b/cookbooks/imagery/recipes/gb_surrey_aerial.rb @@ -0,0 +1,28 @@ +# +# Cookbook Name:: imagery +# Recipe:: gb-surrey-aerial +# +# Copyright 2016, OpenStreetMap Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include_recipe "imagery" + +imagery_site "surrey.aerial.openstreetmap.org.uk" do + imagery_layer "gb-surrey-aerial" do + site new_resource.name + projection "EPSG:27700" + source "/data/imagery/gb/surrey-aerial/SurreyMosaicECW.tif" + end +end diff --git a/cookbooks/imagery/resources/layer.rb b/cookbooks/imagery/resources/layer.rb index 9356a77a4..dddd66522 100644 --- a/cookbooks/imagery/resources/layer.rb +++ b/cookbooks/imagery/resources/layer.rb @@ -23,15 +23,15 @@ property :name, String property :site, String, :required => true property :source, String, :required => true property :text, String -property :copyright, String, :default => "Copyright" +property :copyright, String, :default => "Copyright" property :projection, String, :default => "EPSG:3857" property :palette, String property :extent, String property :background, String -property :resample, String, :default => "average" +property :resample, String, :default => "average" property :imagemode, String property :extension, String -property :max_zoom, Fixnum, :default => 23 +property :max_zoom, Fixnum, :default => 23 action :create do template "/srv/imagery/mapserver/layer-#{name}.map" do diff --git a/cookbooks/imagery/resources/site.rb b/cookbooks/imagery/resources/site.rb index 76f6ca13d..dfda20da1 100644 --- a/cookbooks/imagery/resources/site.rb +++ b/cookbooks/imagery/resources/site.rb @@ -22,14 +22,13 @@ default_action :create property :name, String action :create do - directory "/srv/imagery/#{name}" do owner "root" group "root" mode 0755 end - nginx_site "#{name}" do + nginx_site name do template "nginx_imagery.conf.erb" directory "/srv/imagery/#{name}" variables new_resource.to_hash -- 2.43.2