Class: OsmImport::Target::PgBase

Inherits:
Struct
  • Object
show all
Defined in:
lib/osm_import/target/pg_base.rb

Direct Known Subclasses

PgTables, PgViews

Defined Under Namespace

Classes: Connection, TargetEntry

Constant Summary collapse

GEOTYPES =
{ 'point' => 'POINT', 'line' => 'LINESTRING', 'polygon' => 'POLYGON', 'multiline' => 'MULTILINESTRING', 'multipolygon' => 'MULTIPOLYGON' }

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



4
5
6
# File 'lib/osm_import/target/pg_base.rb', line 4

def options
  @options
end

Instance Method Details

#geometry_type(type) ⇒ Object



24
25
26
# File 'lib/osm_import/target/pg_base.rb', line 24

def geometry_type(type)
  GEOTYPES[type.to_s] or raise StandardError.new("Unknown geometry type #{type.inspect}")
end

#new_prefixObject



14
15
16
# File 'lib/osm_import/target/pg_base.rb', line 14

def new_prefix
  options[:new_prefix] or 'new_osm_'
end

#prefixObject



6
7
8
# File 'lib/osm_import/target/pg_base.rb', line 6

def prefix
  options[:prefix] or 'osm_'
end

#projectionObject



18
19
20
# File 'lib/osm_import/target/pg_base.rb', line 18

def projection
  options[:projection]
end

#raw_prefixObject



10
11
12
# File 'lib/osm_import/target/pg_base.rb', line 10

def raw_prefix
  options[:raw_prefix] or 'raw_osm_'
end