Class: SpatialFeatures::Importers::KMLFileArcGIS

Inherits:
KMLFile show all
Defined in:
lib/spatial_features/importers/kml_file_arcgis.rb

Constant Summary

Constants inherited from KML

SpatialFeatures::Importers::KML::COORDINATES_WITH_ALTITUDE, SpatialFeatures::Importers::KML::IMAGE_METADATA_KEYS

Instance Attribute Summary

Attributes inherited from Base

#errors, #source_identifier

Instance Method Summary collapse

Methods inherited from KMLFile

#cache_key

Methods inherited from Base

#cache_key, create_all, #features

Constructor Details

#initialize(data, **options) ⇒ KMLFileArcGIS

Returns a new instance of KMLFileArcGIS.



6
7
8
9
10
11
12
13
14
# File 'lib/spatial_features/importers/kml_file_arcgis.rb', line 6

def initialize(data, **options)
  super

rescue SocketError, Errno::ECONNREFUSED
  url = URI(data)
  raise ImportError, "ArcGIS Server is not responding. Ensure ArcGIS Server is running and accessible at #{[url.scheme, "//#{url.host}", url.port].select(&:present?).join(':')}."
rescue OpenURI::HTTPError
  raise ImportError, "ArcGIS Map Service not found. Ensure ArcGIS Server is running and accessible at #{path_or_url}."
end