]> git.openstreetmap.org Git - chef.git/commitdiff
Add support for carto v4 to replication command
authorTom Hughes <tom@compton.nu>
Wed, 31 May 2017 10:39:11 +0000 (11:39 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 31 May 2017 10:39:11 +0000 (11:39 +0100)
cookbooks/tile/templates/default/replicate.erb

index 9d86d9534b0bd198140fcffc3ce4b7bafbd45df2..aa69177ecaa2679e8994a25f47242be42f3c2892 100644 (file)
@@ -67,11 +67,16 @@ do
             echo "Fetched new data from ${prevSequenceNumber} to ${sequenceNumber} into ${file}"
 
             # Apply the changes to the database
+            osm2pgsql --database gis --slim --append --number-processes=1 \
 <% if node[:tile][:node_file] -%>
-            osm2pgsql --database gis --slim --append --number-processes=1 --flat-nodes=<%= node[:tile][:node_file] %> ${file}
-<% else -%>
-            osm2pgsql --database gis --slim --append --number-processes=1 ${file}
+                      --flat-nodes=<%= node[:tile][:node_file] %> \
 <% end -%>
+<% if node[:tile][:styles][:default][:revision] >= "v4.0.0" -%>
+                      --multi-geometry --hstore \
+                      --style=/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.style \
+                      --tag-transform-script=/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.lua \
+<% end -%>
+                      ${file}
 
             # No need to rollback now
             rm state-prev.txt