Class: SpatialFeatures::Importers::File
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- SpatialFeatures::Importers::File
- Defined in:
- lib/spatial_features/importers/file.rb
Instance Method Summary collapse
-
#initialize(data, *args) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(data, *args) ⇒ File
Returns a new instance of File.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/spatial_features/importers/file.rb', line 6 def initialize(data, *args) file = Download.open(data, unzip: %w(.kml .shp)) case ::File.extname(file.path.downcase) when '.kml' __setobj__(KMLFile.new(file, *args)) when '.shp' __setobj__(Shapefile.new(file, *args)) else raise ImportError, "Could not import file. Supported formats are KMZ, KML, and zipped ArcGIS shapefiles" end end |