- # Did we get any new data?
- if [ "${sequenceNumber}" == "${prevSequenceNumber}" ]
- then
- # Log the lack of data
- echo "No new data available. Sleeping..."
-
- # Remove file, it will just be an empty changeset
- rm ${file}
-
- # No need to rollback now
- rm state-prev.txt
-
- # Sleep for a short while
- sleep 30
- else
- # Log the new data
- echo "Fetched new data from ${prevSequenceNumber} to ${sequenceNumber} into ${file}"
-
- # Apply the changes to the database
-<% 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}
+ # Apply the changes to the database
+ osm2pgsql --database gis --slim --append --number-processes=1 \
+<% if node[:tile][:database][:node_file] -%>
+ --flat-nodes=<%= node[:tile][:database][:node_file] %> \
+<% end -%>
+<% if node[:tile][:database][:multi_geometry] -%>
+ --multi-geometry \
+<% end -%>
+<% if node[:tile][:database][:hstore] -%>
+ --hstore \
+<% end -%>
+<% if node[:tile][:database][:style_file] -%>
+ --style=<%= node[:tile][:database][:style_file] %> \