Class: SpatialFeatures::Importers::Shapefile
- Defined in:
- lib/spatial_features/importers/shapefile.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #cache_key ⇒ Object
-
#initialize(data, *args, proj4: nil, **options) ⇒ Shapefile
constructor
A new instance of Shapefile.
Methods inherited from Base
Constructor Details
#initialize(data, *args, proj4: nil, **options) ⇒ Shapefile
Returns a new instance of Shapefile.
9 10 11 12 |
# File 'lib/spatial_features/importers/shapefile.rb', line 9 def initialize(data, *args, proj4: nil, **) super(data, **) @proj4 = proj4 end |
Class Method Details
.create_all(data, **options) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/spatial_features/importers/shapefile.rb', line 18 def self.create_all(data, **) Download.open_each(data, unzip: [/\.shp$/], downcase: true).map do |file| new(file, **) end rescue Unzip::PathNotFound raise ImportError, INVALID_ARCHIVE end |
Instance Method Details
#cache_key ⇒ Object
14 15 16 |
# File 'lib/spatial_features/importers/shapefile.rb', line 14 def cache_key @cache_key ||= Digest::MD5.file(archive).to_s end |