lib/spatial_features/importers/shapefile.rb in spatial_features-2.0.0 vs lib/spatial_features/importers/shapefile.rb in spatial_features-2.1.0
- old
+ new
@@ -13,10 +13,10 @@
def each_record(&block)
file = Download.open(@data, unzip: '.shp')
proj4 = proj4_from_file(file)
RGeo::Shapefile::Reader.open(file.path) do |records|
records.each do |record|
- yield OpenStruct.new data_from_wkt(record.geometry.as_text, proj4).merge(:metadata => record.attributes)
+ yield OpenStruct.new data_from_wkt(record.geometry.as_text, proj4).merge(:metadata => record.attributes) if record.geometry.present?
end
end
end
def proj4_from_file(file)