Class: SpatialFeatures::Importers::KMLFile
- Defined in:
- lib/spatial_features/importers/kml_file.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(path_or_url, *args) ⇒ KMLFile
constructor
A new instance of KMLFile.
Methods inherited from Base
#cache_key, create_all, #features
Constructor Details
#initialize(path_or_url, *args) ⇒ KMLFile
Returns a new instance of KMLFile.
4 5 6 7 8 9 10 |
# File 'lib/spatial_features/importers/kml_file.rb', line 4 def initialize(path_or_url, *args) super Download.read(path_or_url, unzip: '.kml'), *args rescue SocketError, Errno::ECONNREFUSED, OpenURI::HTTPError url = URI(path_or_url) raise ImportError, "KML server is not responding. Ensure server is running and accessible at #{[url.scheme, "//#{url.host}", url.port].select(&:present?).join(':')}." end |