Class: OsmImport::Mapper::Address
- Defined in:
- lib/osm_import/mapper/address.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#after_import(tt) ⇒ Object
13 14 15 16 |
# File 'lib/osm_import/mapper/address.rb', line 13 def after_import(tt) tt.conn.exec "UPDATE #{tt.name} SET city = NULL WHERE city = 'undefined'" tt.conn.exec "UPDATE #{tt.name} SET city = c.name FROM raw_osm_polygon c WHERE geometry && way AND ST_Contains(way, Geometry(geometry)) AND c.place IN ('city','town','village') AND c.name IS NOT NULL AND c.name <> '' AND city IS NULL" end |
#assigns ⇒ Object
5 6 7 |
# File 'lib/osm_import/mapper/address.rb', line 5 def assigns { "street" => "src.tags->'addr:street'", "housenumber" => "src.tags->'addr:housenumber'", "city" => "src.tags->'addr:city'" , "postcode" => "src.tags->'addr:postcode'" } end |
#fields ⇒ Object
9 10 11 |
# File 'lib/osm_import/mapper/address.rb', line 9 def fields { "street" => "VARCHAR(255)", "housenumber" => 'VARCHAR(255)', "city" => "VARCHAR(255)", "postcode" => "VARCHAR(100)" } end |