lib/ogr/layer_mixins/extensions.rb in ffi-gdal-1.0.0.beta8 vs lib/ogr/layer_mixins/extensions.rb in ffi-gdal-1.0.0.beta9
- old
+ new
@@ -22,11 +22,11 @@
feature = next_feature
break unless feature
begin
yield feature
- rescue
+ rescue StandardError
feature.destroy!
raise
end
feature.destroy!
@@ -50,11 +50,11 @@
break
end
begin
yield feature_ptr
- rescue
+ rescue StandardError
FFI::OGR::API.OGR_F_Destroy(feature_ptr)
raise
end
FFI::OGR::API.OGR_F_Destroy(feature_ptr)
@@ -126,11 +126,10 @@
# This block is intentionally long simply for the sake of performance.
# I've tried refactoring chunks of this out to separate methods and
# performance suffers greatly. Since this is a key part of gridding (at
# least at this point), it needs to be as fast as possible.
- # rubocop:disable Metrics/BlockLength
each_feature_pointer do |feature_ptr|
field_values = field_indices.map.with_index do |j, attribute_index|
FFI::OGR::API.send("OGR_F_GetFieldAs#{with_attributes.values[attribute_index].capitalize}", feature_ptr, j)
end
@@ -209,10 +208,9 @@
end
else raise OGR::UnsupportedGeometryType,
"Not sure how to extract point_values for a #{geom_type}"
end
end
- # rubocop:enable Metrics/BlockLength
log "#point_values took #{Time.now - start}s"
values
end