From a1890cb6a6f3d6b39afa2f3e5b3c580e2a7abf29 Mon Sep 17 00:00:00 2001 From: David Arango Date: Fri, 17 May 2013 17:50:25 +0200 Subject: [PATCH] Process custom tag "height" on imported OSM files Trying custom osm2pgsql style Tested with osm2pgsql SVN version 0.83.0 (64bit id space) --- config/osm2pgsql.style | 1 + lib/importer/lib/cartodb-importer/loaders/osm.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/osm2pgsql.style b/config/osm2pgsql.style index 3310298389..01e335908a 100644 --- a/config/osm2pgsql.style +++ b/config/osm2pgsql.style @@ -96,6 +96,7 @@ node,way width text linear node,way wood text linear node,way z_order int4 linear # This is calculated during import way way_area real # This is calculated during import +node,way height text # If you're interested in bicycle routes, you may want the following fields # To make these work you need slim mode or the necessary data won't be remembered. diff --git a/lib/importer/lib/cartodb-importer/loaders/osm.rb b/lib/importer/lib/cartodb-importer/loaders/osm.rb index 04580d36c8..301b27e096 100644 --- a/lib/importer/lib/cartodb-importer/loaders/osm.rb +++ b/lib/importer/lib/cartodb-importer/loaders/osm.rb @@ -41,7 +41,7 @@ module CartoDB # I tried running the -G or --multi-geometry option to force multigeometries # but the result is always a column with mixed types, polygons and multipolgons! - full_osm_command = "#{osm2pgsql_bin_path} #{host} #{port} -U #{db_configuration[:username]} -d #{db_configuration[:database]} -u -I -C #{allowed_cache_size} --multi-geometry --latlong -p #{random_table_prefix} #{path}" + full_osm_command = "#{osm2pgsql_bin_path} #{host} #{port} --style #{Rails.root.join('config', 'os2pgsql.style')} -U #{db_configuration[:username]} -d #{db_configuration[:database]} -u -I -C #{allowed_cache_size} --multi-geometry --latlong -p #{random_table_prefix} #{path}" data_import.log_update(full_osm_command) stdin, stdout, stderr = Open3.popen3(full_osm_command)