Module: OvertureMaps::Import

Defined in:
lib/overture_maps/import.rb,
lib/overture_maps/import.rb,
lib/overture_maps/import/runner.rb,
lib/overture_maps/import/downloader.rb,
lib/overture_maps/import/record_mapper.rb,
lib/overture_maps/import/parquet_reader.rb,
lib/overture_maps/import/location_based_runner.rb

Defined Under Namespace

Classes: Downloader, Error, LocationBasedRunner, ParquetReader, RecordMapper, Runner

Class Method Summary collapse

Class Method Details

.run!(theme:, model_class:, file_path:, batch_size: nil, transform: nil, release: nil, &block) ⇒ Object

Programmatic file import. The transform may be given as a keyword or a block; it receives each raw record and returns attributes (or nil to skip the record).



20
21
22
23
24
25
# File 'lib/overture_maps/import.rb', line 20

def self.run!(theme:, model_class:, file_path:, batch_size: nil, transform: nil, release: nil, &block)
  transform ||= block
  runner = Runner.new(model_class: model_class, theme: theme, batch_size: batch_size, release: release)
  runner.import_from_file(file_path, theme: theme, transform: transform)
  runner
end