ffi-gdal 1.0.0.beta3 → 1.0.0.beta4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.rubocop.yml +62 -0
  4. data/Gemfile +1 -1
  5. data/History.md +53 -28
  6. data/README.md +6 -0
  7. data/Rakefile +23 -1
  8. data/examples/extract_and_colorize.rb +21 -22
  9. data/examples/geometries.rb +2 -2
  10. data/examples/gridding.rb +106 -0
  11. data/examples/ogr_layer_to_layer.rb +1 -1
  12. data/examples/points.txt +127 -0
  13. data/examples/testing_gdal.rb +3 -4
  14. data/ffi-gdal.gemspec +3 -2
  15. data/lib/ext/error_symbols.rb +2 -57
  16. data/lib/ext/ffi_library_function_checks.rb +26 -0
  17. data/lib/ext/float_ext.rb +2 -2
  18. data/lib/ext/narray_ext.rb +2 -0
  19. data/lib/ext/numeric_as_data_type.rb +19 -0
  20. data/lib/ext/to_bool.rb +4 -4
  21. data/lib/ffi/cpl/conv.rb +132 -0
  22. data/lib/ffi/cpl/error.rb +67 -0
  23. data/lib/ffi/cpl/hash_set.rb +39 -0
  24. data/lib/ffi/cpl/http.rb +25 -0
  25. data/lib/ffi/cpl/http_result.rb +18 -0
  26. data/lib/ffi/cpl/list.rb +38 -0
  27. data/lib/ffi/cpl/mime_part.rb +11 -0
  28. data/lib/ffi/cpl/minixml.rb +47 -0
  29. data/lib/ffi/cpl/port.rb +23 -0
  30. data/lib/ffi/cpl/quad_tree.rb +51 -0
  31. data/lib/ffi/{ogr/ogr_envelope.rb → cpl/rect_obj.rb} +3 -3
  32. data/lib/ffi/cpl/string.rb +95 -0
  33. data/lib/ffi/cpl/vsi.rb +115 -0
  34. data/lib/ffi/cpl/xml_node.rb +6 -6
  35. data/lib/ffi/gdal/alg.rb +385 -0
  36. data/lib/ffi/gdal/{gdal_color_entry.rb → color_entry.rb} +1 -2
  37. data/lib/ffi/gdal/exceptions.rb +6 -0
  38. data/lib/ffi/gdal/{gdal_gcp.rb → gcp.rb} +1 -3
  39. data/lib/ffi/gdal/{gdal_h.rb → gdal.rb} +253 -252
  40. data/lib/ffi/gdal/grid.rb +58 -0
  41. data/lib/ffi/gdal/{gdal_grid_data_metrics_options.rb → grid_data_metrics_options.rb} +1 -2
  42. data/lib/ffi/gdal/{gdal_grid_inverse_distance_to_a_power_options.rb → grid_inverse_distance_to_a_power_options.rb} +1 -2
  43. data/lib/ffi/gdal/{gdal_grid_moving_average_options.rb → grid_moving_average_options.rb} +1 -2
  44. data/lib/ffi/gdal/{gdal_grid_nearest_neighbor_options.rb → grid_nearest_neighbor_options.rb} +1 -2
  45. data/lib/ffi/gdal/matching.rb +20 -0
  46. data/lib/ffi/gdal/{gdal_rpc_info.rb → rpc_info.rb} +1 -2
  47. data/lib/ffi/gdal/{gdal_transformer_info.rb → transformer_info.rb} +1 -2
  48. data/lib/ffi/gdal/version.rb +1 -1
  49. data/lib/ffi/gdal/vrt.rb +92 -0
  50. data/lib/ffi/gdal/{gdal_warp_options.rb → warp_options.rb} +8 -4
  51. data/lib/ffi/gdal/warper.rb +70 -0
  52. data/lib/ffi/gdal.rb +56 -69
  53. data/lib/ffi/ogr/api.rb +567 -0
  54. data/lib/ffi/ogr/{ogr_contour_writer_info.rb → contour_writer_info.rb} +2 -3
  55. data/lib/ffi/ogr/core.rb +181 -0
  56. data/lib/ffi/ogr/envelope.rb +12 -0
  57. data/lib/ffi/ogr/{ogr_envelope_3d.rb → envelope_3d.rb} +2 -2
  58. data/lib/ffi/ogr/featurestyle.rb +29 -0
  59. data/lib/ffi/ogr/field.rb +63 -0
  60. data/lib/ffi/ogr/geocoding.rb +30 -0
  61. data/lib/ffi/ogr/srs_api.rb +407 -0
  62. data/lib/ffi/ogr/style_param.rb +13 -0
  63. data/lib/ffi/ogr/{ogr_style_value.rb → style_value.rb} +4 -3
  64. data/lib/ffi/ogr.rb +7 -7
  65. data/lib/ffi-gdal.rb +7 -145
  66. data/lib/gdal/color_entry.rb +18 -14
  67. data/lib/gdal/color_entry_mixins/extensions.rb +32 -0
  68. data/lib/gdal/color_interpretation.rb +2 -2
  69. data/lib/gdal/color_table.rb +37 -32
  70. data/lib/gdal/color_table_mixins/extensions.rb +48 -0
  71. data/lib/gdal/cpl_error_handler.rb +119 -0
  72. data/lib/gdal/data_type.rb +7 -7
  73. data/lib/gdal/dataset.rb +131 -238
  74. data/lib/gdal/dataset_mixins/algorithm_methods.rb +182 -0
  75. data/lib/gdal/dataset_mixins/extensions.rb +542 -0
  76. data/lib/gdal/dataset_mixins/matching.rb +26 -0
  77. data/lib/gdal/driver.rb +68 -92
  78. data/lib/gdal/driver_mixins/extensions.rb +93 -0
  79. data/lib/gdal/exceptions.rb +32 -4
  80. data/lib/gdal/geo_transform.rb +63 -43
  81. data/lib/gdal/geo_transform_mixins/extensions.rb +57 -0
  82. data/lib/gdal/grid.rb +144 -0
  83. data/lib/gdal/grid_types/data_metrics_base.rb +14 -0
  84. data/lib/gdal/grid_types/inverse_distance_to_a_power.rb +19 -0
  85. data/lib/gdal/grid_types/metric_average_distance.rb +12 -0
  86. data/lib/gdal/grid_types/metric_average_distance_pts.rb +12 -0
  87. data/lib/gdal/grid_types/metric_count.rb +12 -0
  88. data/lib/gdal/grid_types/metric_maximum.rb +12 -0
  89. data/lib/gdal/grid_types/metric_minimum.rb +12 -0
  90. data/lib/gdal/grid_types/metric_range.rb +12 -0
  91. data/lib/gdal/grid_types/moving_average.rb +19 -0
  92. data/lib/gdal/grid_types/nearest_neighbor.rb +19 -0
  93. data/lib/gdal/grid_types.rb +22 -0
  94. data/lib/gdal/internal_helpers.rb +94 -0
  95. data/lib/gdal/major_object.rb +4 -7
  96. data/lib/gdal/options.rb +14 -7
  97. data/lib/gdal/raster_attribute_table.rb +38 -47
  98. data/lib/gdal/raster_attribute_table_mixins/extensions.rb +41 -0
  99. data/lib/gdal/raster_band.rb +193 -227
  100. data/lib/gdal/raster_band_classifier.rb +107 -0
  101. data/lib/gdal/raster_band_mixins/algorithm_methods.rb +292 -0
  102. data/lib/gdal/raster_band_mixins/extensions.rb +238 -0
  103. data/lib/gdal/rpc_info.rb +35 -0
  104. data/lib/gdal/transformer.rb +15 -0
  105. data/lib/gdal/transformers/approximate_transformer.rb +48 -0
  106. data/lib/gdal/transformers/base_general_image_projection_transformer.rb +45 -0
  107. data/lib/gdal/transformers/gcp_transformer.rb +55 -0
  108. data/lib/gdal/transformers/general_image_projection_transformer.rb +31 -0
  109. data/lib/gdal/transformers/general_image_projection_transformer2.rb +52 -0
  110. data/lib/gdal/transformers/general_image_projection_transformer3.rb +25 -0
  111. data/lib/gdal/transformers/geolocation_transformer.rb +42 -0
  112. data/lib/gdal/transformers/reprojection_transformer.rb +39 -0
  113. data/lib/gdal/transformers/rpc_transformer.rb +56 -0
  114. data/lib/gdal/transformers/tps_transformer.rb +40 -0
  115. data/lib/gdal/virtual_dataset.rb +96 -0
  116. data/lib/gdal/warp_operation.rb +20 -23
  117. data/lib/gdal.rb +17 -0
  118. data/lib/ogr/coordinate_transformation.rb +16 -41
  119. data/lib/ogr/data_source.rb +103 -58
  120. data/lib/ogr/data_source_extensions.rb +5 -6
  121. data/lib/ogr/data_source_mixins/capability_methods.rb +27 -0
  122. data/lib/ogr/driver.rb +61 -33
  123. data/lib/ogr/driver_mixins/capability_methods.rb +16 -0
  124. data/lib/ogr/envelope.rb +29 -18
  125. data/lib/ogr/envelope_extensions.rb +70 -49
  126. data/lib/ogr/error_handling.rb +46 -0
  127. data/lib/ogr/exceptions.rb +58 -12
  128. data/lib/ogr/feature.rb +334 -86
  129. data/lib/ogr/feature_definition.rb +94 -51
  130. data/lib/ogr/feature_definition_extensions.rb +36 -13
  131. data/lib/ogr/feature_extensions.rb +62 -11
  132. data/lib/ogr/field.rb +175 -54
  133. data/lib/ogr/field_definition.rb +110 -0
  134. data/lib/ogr/{field_extensions.rb → field_definition_extensions.rb} +4 -5
  135. data/lib/ogr/{geocoding_session.rb → geocoder.rb} +14 -13
  136. data/lib/ogr/geometries/geometry_collection.rb +13 -0
  137. data/lib/ogr/geometries/line_string.rb +35 -0
  138. data/lib/ogr/geometries/linear_ring.rb +11 -0
  139. data/lib/ogr/geometries/multi_line_string.rb +16 -0
  140. data/lib/ogr/geometries/multi_point.rb +14 -0
  141. data/lib/ogr/geometries/multi_polygon.rb +21 -0
  142. data/lib/ogr/geometries/none_geometry.rb +13 -0
  143. data/lib/ogr/geometries/point.rb +65 -0
  144. data/lib/ogr/geometries/point_extensions.rb +32 -0
  145. data/lib/ogr/geometries/polygon.rb +14 -0
  146. data/lib/ogr/geometries/unknown_geometry.rb +10 -0
  147. data/lib/ogr/geometry.rb +270 -242
  148. data/lib/ogr/geometry_extensions.rb +8 -9
  149. data/lib/ogr/geometry_field_definition.rb +99 -0
  150. data/lib/ogr/geometry_field_definition_extensions.rb +19 -0
  151. data/lib/ogr/geometry_types/container.rb +75 -0
  152. data/lib/ogr/geometry_types/curve.rb +25 -28
  153. data/lib/ogr/geometry_types/surface.rb +13 -4
  154. data/lib/ogr/internal_helpers.rb +57 -0
  155. data/lib/ogr/layer.rb +60 -181
  156. data/lib/ogr/layer_mixins/capability_methods.rb +102 -0
  157. data/lib/ogr/layer_mixins/extensions.rb +59 -0
  158. data/lib/ogr/layer_mixins/ogr_feature_methods.rb +127 -0
  159. data/lib/ogr/layer_mixins/ogr_field_methods.rb +143 -0
  160. data/lib/ogr/layer_mixins/ogr_layer_method_methods.rb +163 -0
  161. data/lib/ogr/layer_mixins/ogr_query_filter_methods.rb +89 -0
  162. data/lib/ogr/layer_mixins/ogr_sql_methods.rb +48 -0
  163. data/lib/ogr/spatial_reference.rb +108 -589
  164. data/lib/ogr/spatial_reference_extensions.rb +29 -3
  165. data/lib/ogr/spatial_reference_mixins/coordinate_system_getter_setters.rb +494 -0
  166. data/lib/ogr/spatial_reference_mixins/exporters.rb +134 -0
  167. data/lib/ogr/spatial_reference_mixins/importers.rb +243 -0
  168. data/lib/ogr/spatial_reference_mixins/morphers.rb +25 -0
  169. data/lib/ogr/spatial_reference_mixins/parameter_getter_setters.rb +122 -0
  170. data/lib/ogr/spatial_reference_mixins/type_checks.rb +62 -0
  171. data/lib/ogr/style_table.rb +53 -5
  172. data/lib/ogr/style_table_extensions.rb +21 -5
  173. data/lib/ogr/style_tool.rb +118 -0
  174. data/lib/ogr.rb +8 -0
  175. data/spec/ffi-gdal_spec.rb +1 -2
  176. data/spec/integration/{color_table_info_spec.rb → gdal/color_table_info_spec.rb} +12 -12
  177. data/spec/integration/{dataset_info_spec.rb → gdal/dataset_info_spec.rb} +2 -6
  178. data/spec/integration/{driver_info_spec.rb → gdal/driver_info_spec.rb} +5 -5
  179. data/spec/integration/{geo_transform_info_spec.rb → gdal/geo_transform_info_spec.rb} +1 -14
  180. data/spec/integration/{raster_attribute_table_info_spec.rb → gdal/raster_attribute_table_info_spec.rb} +1 -2
  181. data/spec/integration/{raster_band_info_spec.rb → gdal/raster_band_info_spec.rb} +30 -42
  182. data/spec/integration/ogr/layer_spec.rb +97 -0
  183. data/spec/spec_helper.rb +94 -5
  184. data/spec/support/integration_help.rb +1 -0
  185. data/spec/support/shared_contexts.rb +26 -0
  186. data/spec/support/shared_examples/{major_object_examples.rb → gdal/major_object_examples.rb} +5 -5
  187. data/spec/support/shared_examples/ogr/a_25D_geometry.rb +7 -0
  188. data/spec/support/shared_examples/ogr/a_container_geometry.rb +47 -0
  189. data/spec/support/shared_examples/ogr/a_geometry.rb +404 -0
  190. data/spec/support/shared_examples/ogr/a_line_string.rb +16 -0
  191. data/spec/support/test_style_table.txt +3 -0
  192. data/spec/unit/ext/error_symbols_spec.rb +41 -53
  193. data/spec/unit/ext/numeric_as_data_type_spec.rb +113 -0
  194. data/spec/unit/ffi/gdal_spec.rb +70 -0
  195. data/spec/unit/gdal/color_entry_spec.rb +5 -0
  196. data/spec/unit/gdal/color_interpretation_spec.rb +5 -0
  197. data/spec/unit/gdal/{color_table_extensions_spec.rb → color_table_mixins/extensions_spec.rb} +3 -3
  198. data/spec/unit/gdal/color_table_spec.rb +14 -16
  199. data/spec/unit/gdal/data_type_spec.rb +10 -17
  200. data/spec/unit/gdal/dataset_spec.rb +4 -7
  201. data/spec/unit/gdal/driver_mixins/extensions_spec.rb +22 -0
  202. data/spec/unit/gdal/driver_spec.rb +49 -0
  203. data/spec/unit/gdal/environment_methods_spec.rb +6 -0
  204. data/spec/unit/gdal/geo_transform_spec.rb +276 -0
  205. data/spec/unit/gdal/grid_spec.rb +5 -0
  206. data/spec/unit/gdal/internal_helpers_spec.rb +112 -0
  207. data/spec/unit/gdal/major_object_spec.rb +6 -0
  208. data/spec/unit/gdal/options_spec.rb +5 -0
  209. data/spec/unit/gdal/raster_attribute_table_spec.rb +5 -0
  210. data/spec/unit/gdal/raster_band_classifier_spec.rb +134 -0
  211. data/spec/unit/gdal/raster_band_spec.rb +5 -0
  212. data/spec/unit/gdal/rpc_info_spec.rb +5 -0
  213. data/spec/unit/gdal/version_info_spec.rb +6 -0
  214. data/spec/unit/gdal/virtual_dataset_spec.rb +32 -0
  215. data/spec/unit/gdal/warp_operation_spec.rb +5 -0
  216. data/spec/unit/ogr/data_source_mixins/capability_methods_spec.rb +30 -0
  217. data/spec/unit/ogr/data_source_spec.rb +209 -0
  218. data/spec/unit/ogr/driver_mixins/capability_methods_spec.rb +18 -0
  219. data/spec/unit/ogr/driver_spec.rb +150 -0
  220. data/spec/unit/ogr/envelope_spec.rb +322 -0
  221. data/spec/unit/ogr/feature_definition_spec.rb +313 -0
  222. data/spec/unit/ogr/feature_spec.rb +379 -0
  223. data/spec/unit/ogr/field_definition_spec.rb +135 -0
  224. data/spec/unit/ogr/field_spec.rb +193 -0
  225. data/spec/unit/ogr/geometries/geometry_collection_spec.rb +186 -0
  226. data/spec/unit/ogr/geometries/line_string_spec.rb +105 -0
  227. data/spec/unit/ogr/{linear_ring_spec.rb → geometries/linear_ring_spec.rb} +10 -31
  228. data/spec/unit/ogr/geometries/multi_line_string_spec.rb +14 -0
  229. data/spec/unit/ogr/geometries/multi_point_spec.rb +14 -0
  230. data/spec/unit/ogr/geometries/multi_polygon_spec.rb +41 -0
  231. data/spec/unit/ogr/geometries/none_geometry_spec.rb +12 -0
  232. data/spec/unit/ogr/{point_spec.rb → geometries/point_spec.rb} +19 -25
  233. data/spec/unit/ogr/geometries/polygon_spec.rb +17 -0
  234. data/spec/unit/ogr/geometries/unknown_geometry_spec.rb +10 -0
  235. data/spec/unit/ogr/geometry_field_definition_spec.rb +87 -0
  236. data/spec/unit/ogr/geometry_spec.rb +542 -0
  237. data/spec/unit/ogr/internal_helpers_spec.rb +57 -0
  238. data/spec/unit/ogr/layer_mixins/capability_methods_spec.rb +88 -0
  239. data/spec/unit/ogr/layer_mixins/ogr_feature_methods_spec.rb +145 -0
  240. data/spec/unit/ogr/layer_mixins/ogr_field_methods_spec.rb +432 -0
  241. data/spec/unit/ogr/layer_mixins/ogr_layer_method_methods_spec.rb +20 -0
  242. data/spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb +42 -0
  243. data/spec/unit/ogr/layer_mixins/ogr_sql_methods_spec.rb +12 -0
  244. data/spec/unit/ogr/layer_spec.rb +66 -67
  245. data/spec/unit/ogr/spatial_reference_mixins/coordinate_system_getter_setters_spec.rb +46 -0
  246. data/spec/unit/ogr/spatial_reference_mixins/exporters_spec.rb +139 -0
  247. data/spec/unit/ogr/spatial_reference_mixins/importers_spec.rb +38 -0
  248. data/spec/unit/ogr/spatial_reference_mixins/morphers_spec.rb +36 -0
  249. data/spec/unit/ogr/spatial_reference_mixins/parameter_getter_setters_spec.rb +102 -0
  250. data/spec/unit/ogr/spatial_reference_mixins/type_checks_spec.rb +157 -0
  251. data/spec/unit/ogr/spatial_reference_spec.rb +42 -0
  252. data/spec/unit/ogr/style_table_spec.rb +132 -0
  253. data/spec/unit/ogr/style_tool_spec.rb +157 -0
  254. data/spec/unit/version_info_spec.rb +1 -1
  255. metadata +285 -75
  256. data/lib/ffi/cpl/conv_h.rb +0 -143
  257. data/lib/ffi/cpl/error_h.rb +0 -63
  258. data/lib/ffi/cpl/minixml_h.rb +0 -14
  259. data/lib/ffi/cpl/string_h.rb +0 -81
  260. data/lib/ffi/cpl/vsi_h.rb +0 -112
  261. data/lib/ffi/gdal/alg_h.rb +0 -127
  262. data/lib/ffi/gdal/grid_h.rb +0 -51
  263. data/lib/ffi/gdal/warper_h.rb +0 -48
  264. data/lib/ffi/ogr/api_h.rb +0 -553
  265. data/lib/ffi/ogr/core_h.rb +0 -148
  266. data/lib/ffi/ogr/featurestyle_h.rb +0 -22
  267. data/lib/ffi/ogr/geocoding_h.rb +0 -21
  268. data/lib/ffi/ogr/ogr_field.rb +0 -50
  269. data/lib/ffi/ogr/ogr_style_param.rb +0 -12
  270. data/lib/ffi/ogr/srs_api_h.rb +0 -325
  271. data/lib/gdal/color_entry_extensions.rb +0 -30
  272. data/lib/gdal/color_table_extensions.rb +0 -47
  273. data/lib/gdal/dataset_extensions.rb +0 -496
  274. data/lib/gdal/driver_extensions.rb +0 -56
  275. data/lib/gdal/geo_transform_extensions.rb +0 -90
  276. data/lib/gdal/raster_attribute_table_extensions.rb +0 -40
  277. data/lib/gdal/raster_band_extensions.rb +0 -198
  278. data/lib/ogr/geometry_types/collection.rb +0 -45
  279. data/lib/ogr/layer_extensions.rb +0 -55
  280. data/lib/ogr/line_string.rb +0 -7
  281. data/lib/ogr/linear_ring.rb +0 -6
  282. data/lib/ogr/multi_line_string.rb +0 -9
  283. data/lib/ogr/multi_point.rb +0 -7
  284. data/lib/ogr/multi_polygon.rb +0 -14
  285. data/lib/ogr/point.rb +0 -89
  286. data/lib/ogr/polygon.rb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e43588d5789cf95019883b698d2b68b67281f35
4
- data.tar.gz: b9b2ab12a3e3c9014ff2bb7d21b8bed1e899fffc
3
+ metadata.gz: 034858e4f3db966a8a5d994ed558d88727b87a3b
4
+ data.tar.gz: d4a624f17336db3eb515c2b3edcf2b5cba6d692a
5
5
  SHA512:
6
- metadata.gz: 9295b6fb9a37c545603887b71cc59b68013b1601543a6623f4a681adb816b7320ca100b7b4de0313ae236d6db3965a0c2b1d03e05eebab6cf25bb00ae5cbe591
7
- data.tar.gz: 22947cf2a0b33db1ef198ac73fcc182259f0746061687cc727ffceeb8f471c17ae1e598966cc34536d41177601ea1dacdc8305af105a814053682f878fee5cef
6
+ metadata.gz: 5eb6d526bf0a2a0d2524426d63d619a5bc44a0ee8a97c2cc1c814dc180257e688fdd7f00b0089720ee9a943468ac6857c4ee546ba0969fc33a5b7a8ab8b4c48c
7
+ data.tar.gz: 4bab75341f049696458a47293ebe6c36977b7d53920db502ee6d6e54a6c3f94415bcbebf53a636a1bef54cae5f57a0773aa69ecc909852319be831400d00cc3d
data/.gitignore CHANGED
@@ -29,3 +29,6 @@ vendor/bundle
29
29
  *.xml
30
30
  *.dbf
31
31
  *.shx
32
+ .rake_tasks
33
+ valgrind_output.log
34
+ *.xsd
data/.rubocop.yml ADDED
@@ -0,0 +1,62 @@
1
+ Metrics/ClassLength:
2
+ Max: 300
3
+
4
+ Metrics/LineLength:
5
+ Max: 120
6
+
7
+ Metrics/MethodLength:
8
+ Max: 20
9
+
10
+ Metrics/ParameterLists:
11
+ Exclude:
12
+ - lib/gdal/dataset.rb
13
+ - lib/gdal/dataset_mixins/algorithm_methods.rb
14
+ - lib/gdal/dataset_mixins/extensions.rb
15
+ - lib/gdal/driver.rb
16
+ - lib/gdal/raster_band.rb
17
+ - lib/gdal/raster_band_mixins/algorithm_methods.rb
18
+ - lib/gdal/transformers/general_image_projection_transformer.rb
19
+ - lib/gdal/virtual_dataset.rb
20
+ - lib/gdal/warp_operation.rb
21
+ - lib/ogr/spatial_reference_mixins/coordinate_system_getter_setters.rb
22
+
23
+ Style/AccessorMethodName:
24
+ Exclude:
25
+ - lib/ogr/layer_mixins/ogr_field_methods.rb
26
+ - lib/ogr/layer_mixins/ogr_query_filter_methods.rb
27
+ - lib/ogr/spatial_reference_mixins/coordinate_system_getter_setters.rb
28
+
29
+ Style/AlignParameters:
30
+ EnforcedStyle: with_fixed_indentation
31
+
32
+ Style/Documentation:
33
+ Enabled: false
34
+
35
+ Style/DotPosition:
36
+ EnforcedStyle: trailing
37
+
38
+ Style/DoubleNegation:
39
+ Enabled: false
40
+
41
+ Style/FileName:
42
+ Exclude:
43
+ - lib/ffi-gdal.rb
44
+
45
+ Style/FormatString:
46
+ EnforcedStyle: percent
47
+
48
+ Style/PercentLiteralDelimiters:
49
+ PreferredDelimiters:
50
+ '%i': '[]'
51
+ '%w': '[]'
52
+ '%W': '[]'
53
+
54
+ Style/SymbolArray:
55
+ Enabled: true
56
+
57
+ AllCops:
58
+ Include:
59
+ - Gemfile
60
+ - ffi-gdal.gemspec
61
+ Exclude:
62
+ - vendor/bundle/**/*
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in ffi-gdal.gemspec
4
4
  gemspec
5
5
 
6
- gem 'pry'
6
+ gem 'byebug'
data/History.md CHANGED
@@ -1,57 +1,82 @@
1
+ ### 1.0.0.beta4 / 2015-04-22
2
+
3
+ Whoa there's lots of changes here... Many are outlined below, but there's really
4
+ a ton more.
5
+
6
+ * Improvements
7
+ * Full refactor of FFI/C function wrapper. Closer mapping of Ruby functions
8
+ within modules to the C-header files where the functions actually reside.
9
+ * Full redesign of the error handling mechanism; ffi-gdal now hooks in to
10
+ GDAL's error handling, thus errors raised from GDAL automagically get handed
11
+ over as Ruby exceptions. (GDAL only; OGR doesn't provide this.) This also
12
+ entailed adding a bunch of new exceptions and renaming some old ones.
13
+ * Better library finding on Linux.
14
+ * Wrapped most of GDAL's Grid API.
15
+ * Wrapped some of GDAL's Warp API.
16
+ * GDAL::Dataset can now open PostGISRaster datasets.
17
+ * Lots more OGR love. Much of this API has now been vetted.
18
+ * Added `GDAL::RasterClassifier` for classifying raster bands.
19
+ * Added some wrapper methods for classes that support capability testing.
20
+ * Bug fixes
21
+ * Fixed some GDAL::Dataset extension methods (`extract_ndvi` and friends)
22
+ that weren't properly handling various data types.
23
+ * Better handling of large files.
24
+ * Fixed regular crashes when dealing with OGR Geometries and
25
+ SpatialReferences.
26
+
1
27
  ### 1.0.0.beta3 / 2014-11-11
2
28
 
3
29
  * Bug fixes
4
- * `ogr/exceptions` wasn't being required for `ext/error_symbols.rb`, thus
5
- any use of an OGR exception was causing a `NameError`.
30
+ * `ogr/exceptions` wasn't being required for `ext/error_symbols.rb`, thus
31
+ any use of an OGR exception was causing a `NameError`.
6
32
 
7
33
  ### 1.0.0.beta2 / 2014-10-23
8
34
 
9
35
  * Improvements
10
- * Added more documentation
11
- * Uncommented `attach_function` calls that had been commented out due to
12
- lack of support in versions I'd tested on. These get handled now on load.
36
+ * Added more documentation
37
+ * Uncommented `attach_function` calls that had been commented out due to
38
+ lack of support in versions I'd tested on. These get handled now on load.
13
39
 
14
40
  ### 1.0.0.beta1 / 2014-10-23
15
41
 
16
42
  * Lots of changes, so just the highlights here...
17
43
  * API Improvements
18
- * Added C and Ruby wrapper for most of OGR.
19
- * Better handling of CPLErr return values.
20
- * Allow loading, even when C functions aren't defined in the version of
21
- GDAL that you're using.
22
- * Split out additions to GDAL/OGR in `*_extensions.rb` modules. Methods
23
- contained in `Extentions` modules don't directly wrap GDAL/OGR functions,
24
- but either provide new functionality or attempt to make library usage more
25
- Rubyesque.
26
- * Added `#as_json`, `#to_json` to many classes.
44
+ * Added C and Ruby wrapper for most of OGR.
45
+ * Better handling of CPLErr return values.
46
+ * Allow loading, even when C functions aren't defined in the version of
47
+ GDAL that you're using.
48
+ * Split out additions to GDAL/OGR in `*_extensions.rb` modules. Methods
49
+ contained in `Extentions` modules don't directly wrap GDAL/OGR functions,
50
+ but either provide new functionality or attempt to make library usage more
51
+ Rubyesque.
52
+ * Added `#as_json`, `#to_json` to many classes.
27
53
  * Internal Improvements
28
- * Lots of cleanup of class internals.
29
- * `autoload` child GDAL and OGR Ruby classes.
30
- * Renamed files under ffi/ that were derived from GDAL/OGR header files to
31
- include `_h` in the name.
54
+ * Lots of cleanup of class internals.
55
+ * `autoload` child GDAL and OGR Ruby classes.
56
+ * Renamed files under ffi/ that were derived from GDAL/OGR header files to
57
+ include `_h` in the name.
32
58
 
33
59
  ### 0.0.4 / 2014-09-27
34
60
 
35
61
  * Bug fixes
36
- * Fixed failure to load on Ubuntu 12.04 (GDAL v1.7.3).
62
+ * Fixed failure to load on Ubuntu 12.04 (GDAL v1.7.3).
37
63
 
38
64
  ### 0.0.3 / 2014-09-26
39
65
 
40
66
  * Improvements
41
- * The `approx_ok` param for `RasterBand#histogram` should default to
42
- `false` (prefering data exactness over performance).
67
+ * The `approx_ok` param for `RasterBand#histogram` should default to
68
+ `false` (preferring data exactness over performance).
43
69
  * Bug fixes
44
- * Fixed URL silliness introduced in 0.0.2.
45
- * `Dataset#*_band` methods should return `nil` if the band with that color
46
- isn't found.
47
- * `RasterBand#default_histogram` died if the band didn't have any values.
48
- * `RasterBand#histogram` wasn't returning totals.
49
-
70
+ * Fixed URL silliness introduced in 0.0.2.
71
+ * `Dataset#*_band` methods should return `nil` if the band with that color
72
+ isn't found.
73
+ * `RasterBand#default_histogram` died if the band didn't have any values.
74
+ * `RasterBand#histogram` wasn't returning totals.
50
75
 
51
76
  ### 0.0.2 / 2014-09-26
52
77
 
53
78
  * New things
54
- * Added ability to pass a URL into `GDAL::Dataset`.
79
+ * Added ability to pass a URL into `GDAL::Dataset`.
55
80
 
56
81
  ### 0.0.1 / 2014-09-26
57
82
 
data/README.md CHANGED
@@ -40,6 +40,12 @@ To distinguish this gem from the already-existing gdal gem, you
40
40
  Following RubyGem conventions, to get access to the FFI wrapper, you
41
41
  `require ffi/gdal`.
42
42
 
43
+ ### Logging
44
+
45
+ For classes that are enabled with logging capabilities, you can turn logging on
46
+ and off like `GDAL::RasterBand.logging_enabled = true`. If you're using ffi-gdal
47
+ in Rails, you can `GDAL::Logger.logger = Rails.logger`.
48
+
43
49
 
44
50
  Testing
45
51
  -------
data/Rakefile CHANGED
@@ -2,12 +2,17 @@ require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
3
 
4
4
  desc 'Download files for running integration tests against'
5
- task :get_tifs do
5
+ task :get_tiffs do
6
6
  require 'net/ftp'
7
7
  require 'fileutils'
8
8
 
9
9
  base_dest_dir = 'spec/support/images/osgeo/geotiff'
10
10
 
11
+ if Dir.exist? base_dest_dir
12
+ puts 'Tiff dir already exists. Exiting.'
13
+ exit
14
+ end
15
+
11
16
  Net::FTP.open('downloads.osgeo.org') do |ftp|
12
17
  ftp.login
13
18
  ftp.binary = true
@@ -62,6 +67,23 @@ namespace :spec do
62
67
  RSpec::Core::RakeTask.new(:integration) do |t|
63
68
  t.pattern = 'spec/integration/**/*_spec.rb'
64
69
  end
70
+
71
+ desc 'Run specs with valgrind'
72
+ task :valgrind do
73
+ valgrind_options = %w[
74
+ --num-callers=50
75
+ --error-limit=no
76
+ --partial-loads-ok=yes
77
+ --undef-value-errors=no
78
+ --show-leak-kinds=all
79
+ --trace-children=yes
80
+ --log-file=valgrind_output.log
81
+ ].join(' ')
82
+
83
+ cmd = %[valgrind #{valgrind_options} bundle exec rake spec SPEC_OPTS="--format documentation"]
84
+ puts cmd
85
+ system(cmd)
86
+ end
65
87
  end
66
88
 
67
89
  task spec: 'spec:unit'
@@ -5,8 +5,8 @@ require 'ffi-gdal'
5
5
  GDAL::Logger.logging_enabled = true
6
6
 
7
7
  colors = %w[644d1e 745924 856728 95742b a5812d b69930 c8b22d d8cb3c e8e65a
8
- f4ee79 e0e457 c8da42 afd135 97b73c 7e993c 657e36 4b612c 314441 23295e
9
- 282973]
8
+ f4ee79 e0e457 c8da42 afd135 97b73c 7e993c 657e36 4b612c 314441 23295e
9
+ 282973]
10
10
 
11
11
  floyd_path = File.join(__dir__, '../spec/support/images/Floyd/Floyd_1058_20140612_NRGB.tif')
12
12
  floyd = GDAL::Dataset.open(floyd_path, 'r')
@@ -23,37 +23,37 @@ floyd.extract_natural_color('nc.tif', band_order: %i[nir red green blue]).close
23
23
 
24
24
  # NDVI as Float32
25
25
  floyd.extract_ndvi('ndvi_float.tif', band_order: %i[nir red green blue],
26
- data_type: :GDT_Float32,
27
- remove_negatives: true
28
- ).close
26
+ data_type: :GDT_Float32,
27
+ remove_negatives: true
28
+ ).close
29
29
 
30
30
  # NDVI as Byte
31
31
  floyd.extract_ndvi('ndvi_byte.tif', band_order: %i[nir red green blue],
32
- data_type: :GDT_Byte,
33
- remove_negatives: true,
34
- photometric: 'PALETTE'
35
- ).close
32
+ data_type: :GDT_Byte,
33
+ remove_negatives: true,
34
+ photometric: 'PALETTE'
35
+ ).close
36
36
 
37
37
  # NDVI as UInt16
38
38
  floyd.extract_ndvi('ndvi_uint16.tif', band_order: %i[nir red green blue],
39
- data_type: :GDT_UInt16,
40
- remove_negatives: true,
41
- photometric: 'PALETTE'
42
- ).close
39
+ data_type: :GDT_UInt16,
40
+ remove_negatives: true,
41
+ photometric: 'PALETTE'
42
+ ).close
43
43
 
44
44
  # GNDVI as Byte
45
45
  floyd.extract_gndvi('gndvi_byte.tif', band_order: %i[nir red green blue],
46
- data_type: :GDT_Byte,
47
- remove_negatives: true,
48
- photometric: 'PALETTE'
49
- ).close
46
+ data_type: :GDT_Byte,
47
+ remove_negatives: true,
48
+ photometric: 'PALETTE'
49
+ ).close
50
50
 
51
51
  # GNDVI as UInt16
52
52
  floyd.extract_gndvi('gndvi_uint16.tif', band_order: %i[nir red green blue],
53
- data_type: :GDT_UInt16,
54
- remove_negatives: true,
55
- photometric: 'PALETTE'
56
- ).close
53
+ data_type: :GDT_UInt16,
54
+ remove_negatives: true,
55
+ photometric: 'PALETTE'
56
+ ).close
57
57
 
58
58
  #---
59
59
  # Colorize after extraction...
@@ -78,4 +78,3 @@ g_uint16_dataset = GDAL::Dataset.open('gndvi_uint16.tif', 'w')
78
78
  g_uint16_band = g_uint16_dataset.raster_band(1)
79
79
  g_uint16_band.colorize!(*colors)
80
80
  g_uint16_dataset.close
81
-
@@ -14,9 +14,9 @@ line_string = OGR::Geometry.create_from_wkt(line_string_wkt)
14
14
  other_line_string_wkt = 'LINESTRING (10 10, 0 30, 40 10)'
15
15
  other_line_string = OGR::Geometry.create_from_wkt(other_line_string_wkt)
16
16
 
17
- polygon_wkt = "POLYGON ((0 0,4 0,4 4,0 4,0 0), (1 1, 2 1, 2 2, 1 1))"
17
+ polygon_wkt = 'POLYGON ((0 0,4 0,4 4,0 4,0 0), (1 1, 2 1, 2 2, 1 1))'
18
18
  polygon = OGR::Geometry.create_from_wkt(polygon_wkt)
19
- other_polygon_wkt = "POLYGON ((1 1,5 1,5 5,1 5,1 1), (10 10, 20 10, 20 20, 10 10))"
19
+ other_polygon_wkt = 'POLYGON ((1 1,5 1,5 5,1 5,1 1), (10 10, 20 10, 20 20, 10 10))'
20
20
  other_polygon = OGR::Geometry.create_from_wkt(other_polygon_wkt)
21
21
 
22
22
  multi_point_wkt = 'MULTIPOINT ((10 40), (40 30), (20 20), (30 10))'
@@ -0,0 +1,106 @@
1
+ require 'bundler/setup'
2
+ require 'pry'
3
+ require 'ffi-gdal'
4
+
5
+ GDAL::Logger.logging_enabled = true
6
+
7
+ test_points_file = File.expand_path('points.txt', __dir__)
8
+ test_points = File.read(test_points_file).split.map { |point_group| point_group.split(',').map(&:to_f) }
9
+
10
+ output_formatter = lambda do |d, _, _|
11
+ print "#{Time.now}: #{(d * 100).round(2)}%\r"
12
+ true
13
+ end
14
+
15
+ # IDW Test
16
+ def idtap(test_points)
17
+ grid = GDAL::Grid.new(:inverse_distance_to_a_power, data_type: :GDT_Float32)
18
+ grid.points = NArray[*test_points]
19
+
20
+ grid.options[:angle] = 10
21
+ # grid.options[:max_points] = 5
22
+ # grid.options[:min_points] = 1
23
+ grid.options[:no_data_value] = -9999
24
+ grid.options[:power] = 2
25
+ grid.options[:radius1] = 20
26
+ grid.options[:radius2] = 15
27
+ grid.options[:smoothing] = 5
28
+
29
+ [grid, 'gridded-idtap.tif']
30
+ end
31
+
32
+ def moving_average(test_points)
33
+ grid = GDAL::Grid.new(:moving_average, data_type: :GDT_Float32)
34
+ grid.points = NArray[*test_points]
35
+
36
+ grid.options[:angle] = 20
37
+ grid.options[:min_points] = 2
38
+ grid.options[:no_data_value] = -9999
39
+ grid.options[:radius1] = 20
40
+ grid.options[:radius2] = 51
41
+
42
+ [grid, 'gridded-ma.tif']
43
+ end
44
+
45
+ def nearest_neighbor(test_points)
46
+ grid = GDAL::Grid.new(:nearest_neighbor, data_type: :GDT_Float32)
47
+ grid.points = NArray[*test_points]
48
+
49
+ grid.options[:angle] = 30
50
+ grid.options[:no_data_value] = -9999
51
+ grid.options[:radius1] = 20
52
+ grid.options[:radius2] = 15
53
+
54
+ [grid, 'gridded-nn.tif']
55
+ end
56
+
57
+ def metric_range(test_points)
58
+ grid = GDAL::Grid.new(:metric_range, data_type: :GDT_Float32)
59
+ grid.points = NArray[*test_points]
60
+
61
+ grid.options[:angle] = 30
62
+ # grid.options[:no_data_value] = -9999
63
+ grid.options[:radius1] = 20
64
+ grid.options[:radius2] = 15
65
+ [grid, 'gridded-metric-range.tif']
66
+ end
67
+
68
+ def make_file(file_name, grid, data)
69
+ driver = GDAL::Driver.by_name('GTiff')
70
+ dataset = driver.create_dataset(
71
+ file_name,
72
+ grid.x_size.round.to_i,
73
+ grid.y_size.round.to_i,
74
+ data_type: grid.data_type
75
+ )
76
+
77
+ dataset.geo_transform = grid.geo_transform
78
+ dataset.projection = OGR::SpatialReference.new_from_epsg(32_632).to_wkt
79
+
80
+ dataset.raster_io('w', data, data_type: grid.data_type)
81
+ if grid.options[:no_data_value]
82
+ dataset.raster_band(1).no_data_value = grid.options[:no_data_value]
83
+ end
84
+ dataset.close
85
+ puts "\nDone writing #{file_name}"
86
+ end
87
+
88
+ grid, output_file_name = idtap(test_points)
89
+ output = grid.create(&output_formatter)
90
+ puts ''
91
+ make_file(output_file_name, grid, output)
92
+
93
+ grid, output_file_name = moving_average(test_points)
94
+ output = grid.create(&output_formatter)
95
+ puts ''
96
+ make_file(output_file_name, grid, output)
97
+
98
+ grid, output_file_name = nearest_neighbor(test_points)
99
+ output = grid.create(&output_formatter)
100
+ puts ''
101
+ make_file(output_file_name, grid, output)
102
+
103
+ grid, output_file_name = metric_range(test_points)
104
+ output = grid.create(&output_formatter)
105
+ puts ''
106
+ make_file(output_file_name, grid, output)
@@ -12,7 +12,7 @@ data_source = OGR::DataSource.open('../spec/support/shapefiles/states_21basic/st
12
12
  layer = data_source.layer(0)
13
13
  extent = layer.extent
14
14
 
15
- # extent = geometry.envelope.world_to_pixel(floyd.geo_transform)
15
+ # extent = geometry.envelope.world_to_pixels(floyd.geo_transform)
16
16
  # x_min = extent[:x_origin]
17
17
  # x_max = extent[:x_max]
18
18
  # y_min = extent[:y_origin]
@@ -0,0 +1,127 @@
1
+ 53414.28,31421.88,39.555
2
+ 53387.8,31425.02,36.8774
3
+ 53359.06,31426.62,31.225
4
+ 53348.04,31425.53,27.416
5
+ 53344.57,31440.31,27.7945
6
+ 53352.89,31454.84,28.4999
7
+ 53402.88,31442.45,37.951
8
+ 53393.47,31393.86,32.5395
9
+ 53358.85,31387.57,29.426
10
+ 53358.59,31376.62,29.223
11
+ 53348.66,31364.21,28.2538
12
+ 53362.8,31340.89,26.8212
13
+ 53335.73,31347.62,26.2299
14
+ 53331.84,31362.69,26.6612
15
+ 53351.82,31402.35,28.4848
16
+ 53335.09,31399.61,26.6922
17
+ 53331.15,31333.34,24.6894
18
+ 53344.1,31322.26,24.3684
19
+ 53326.8,31381.66,26.7581
20
+ 53396.59,31331.42,28.7137
21
+ 53372.7,31317.25,25.8215
22
+ 53404.54,31313.74,26.9055
23
+ 53416.04,31349.16,31.7509
24
+ 53424.7,31367.77,34.8919
25
+ 53414.85,31383.5,37.4818
26
+ 53399.59,31370.21,32.5866
27
+ 53386.89,31353.32,30.5459
28
+ 53383.23,31336.82,29.2504
29
+ 53421.13,31322.59,27.7593
30
+ 53468.29,31316.53,27.0276
31
+ 53434.93,31313.32,26.5662
32
+ 53456.71,31324.05,28.8742
33
+ 53491.54,31372.23,33.0459
34
+ 53470.83,31363.75,32.6194
35
+ 53414.07,31397.87,39.5041
36
+ 53446.84,31368.77,34.5865
37
+ 53438,31337.25,30.1398
38
+ 53456.08,31344.36,30.1871
39
+ 53472.76,31401.02,38.5963
40
+ 53479.13,31432.82,42.3405
41
+ 53499.63,31422.7,40.7577
42
+ 53492.35,31402.93,37.9286
43
+ 53489.32,31390.16,36.34
44
+ 53449.7,31383.25,36.9367
45
+ 53444.56,31406.78,41.6945
46
+ 53464.5,31427.23,43.5075
47
+ 53503.60,31439.93,41.0365
48
+ 53515.85,31437.89,39.9929
49
+ 53505.89,31493.01,33.8673
50
+ 53485.63,31490.18,36.4479
51
+ 53493.83,31472.49,39.8801
52
+ 53482.52,31450.67,42.3327
53
+ 53508.10,31461.98,40.2172
54
+ 53513.7,31482.32,36.919
55
+ 53532.14,31466.79,37.7726
56
+ 53547.81,31446.42,38.3385
57
+ 53555.09,31429.29,37.5484
58
+ 53550.59,31466.8,37.233
59
+ 53542.39,31490.08,33.8351
60
+ 53562.32,31481.02,34.4659
61
+ 53582.49,31461.23,34.1418
62
+ 53585.43,31474.09,32.5303
63
+ 53596.28,31464.84,31.7542
64
+ 53573.76,31494.1,31.3335
65
+ 53567.67,31505.61,29.5076
66
+ 53435.85,31465.51,40.6101
67
+ 53446.92,31438.86,43.5085
68
+ 53451.21,31462.16,42.1787
69
+ 53425.14,31442.84,42.2289
70
+ 53465.83,31471.64,41.4353
71
+ 53444.54,31478.39,39.4434
72
+ 53436.92,31489.73,35.15
73
+ 53446.87,31502.75,32.0204
74
+ 53424.8,31499.59,31.1902
75
+ 53415.55,31477.23,36.1728
76
+ 53405.41,31459.37,36.2749
77
+ 53407.98,31487.67,31.2808
78
+ 53410.21,31511.39,29.09
79
+ 53392.51,31495.92,29.1024
80
+ 53434.96,31524.73,28.8913
81
+ 53415.92,31523.57,28.6408
82
+ 53381.47,31504.81,28.3432
83
+ 53365.02,31495.85,27.6838
84
+ 53352.99,31500.58,26.1047
85
+ 53348.82,31486.82,26.2623
86
+ 53350.47,31471.08,27.5493
87
+ 53357.64,31521.57,25.8516
88
+ 53387.14,31526.14,25.9322
89
+ 53418.4,31538.09,25.2847
90
+ 53448.49,31533.77,25.8802
91
+ 53465.16,31494.46,34.603
92
+ 53458.79,31508.1,31.0874
93
+ 53503.63,31519.64,28.9581
94
+ 53504.38,31505.74,29.4945
95
+ 53487.85,31513.90,29.3574
96
+ 53473.73,31522.38,28.2401
97
+ 53474.65,31534.46,28.1753
98
+ 53501.33,31537.72,27.601
99
+ 53526.89,31530.08,29.1993
100
+ 53538.63,31519.63,29.2767
101
+ 53327.38,31431.95,26.6129
102
+ 53326.22,31419.39,26.2965
103
+ 53591.41,31400.14,31.3133
104
+ 53580.18,31375.51,30.2236
105
+ 53603.18,31381.36,28.8233
106
+ 53529.15,31341.71,27.0601
107
+ 53583.86,31408.9,33.6867
108
+ 53565.07,31419.84,36.2957
109
+ 53544.34,31402.71,36.3476
110
+ 53568.31,31403.82,34.7975
111
+ 53517.51,31388.7,35.1603
112
+ 53521.11,31366.48,31.672
113
+ 53539.64,31349.28,29.138
114
+ 53506.62,31335.71,26.9185
115
+ 53505.15,31350.97,29.6483
116
+ 53494.79,31379.74,33.5259
117
+ 53511.44,31374.64,33.1928
118
+ 53493.14,31354.75,30.8649
119
+ 53549.66,31508.67,30.3146
120
+ 53369.18,31500.28,27.7
121
+ 53442.8,31431.06,43.90
122
+ 53455.78,31444.08,43.460
123
+ 53461.02,31374.57,35.5
124
+ 53437.30,31388.9,38.2
125
+ 53399.61,31407.54,37
126
+ 53514.12,31450.64,40.1
127
+
@@ -26,11 +26,10 @@ world_file = GDAL::GeoTransform.from_world_file(world_file_path, 'tfw')
26
26
 
27
27
  binding.pry
28
28
 
29
- #floyd.image_warp('meow.tif', 'GTiff', 1, cutline: floyd_geometry )
30
- #extract_ndvi(floyd, 'ndvi.tif', floyd_wkt)
29
+ # floyd.image_warp('meow.tif', 'GTiff', 1, cutline: floyd_geometry )
30
+ # extract_ndvi(floyd, 'ndvi.tif', floyd_wkt)
31
31
 
32
32
  def warp_to_geometry(dataset, wkt_geometry)
33
-
34
33
  # Create an OGR::Geometry from the WKT and convert to dataset's projection.
35
34
  wkt_spatial_ref = OGR::SpatialReference.new_from_epsg(4326)
36
35
  geometry = OGR::Geometry.create_from_wkt(wkt_geometry, wkt_spatial_ref)
@@ -43,4 +42,4 @@ def warp_to_geometry(dataset, wkt_geometry)
43
42
  shape.close
44
43
  end
45
44
 
46
- #warp_to_geometry(floyd, floyd_wkt)
45
+ # warp_to_geometry(floyd, floyd_wkt)
data/ffi-gdal.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.version = FFI::GDAL::VERSION
9
9
  spec.authors = ['Steve Loveless']
10
10
  spec.email = %w[steve.loveless@gmail.com]
11
- spec.summary = %q{FFI wrapper for GDAL/OGR.}
11
+ spec.summary = 'FFI wrapper for GDAL/OGR.'
12
12
  spec.homepage = 'https://github.com/turboladen/ffi-gdal'
13
13
  spec.license = 'MIT'
14
14
 
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'multi_xml'
23
23
  spec.add_dependency 'narray', '~> 0.6.0'
24
24
  spec.add_development_dependency 'bundler', '~> 1.6'
25
+ spec.add_development_dependency 'fakefs'
25
26
  spec.add_development_dependency 'rake'
26
27
  spec.add_development_dependency 'rspec', '~> 3.0'
27
- spec.add_development_dependency 'ruby-progressbar'
28
+ spec.add_development_dependency 'simplecov', '~> 0.9.0'
28
29
  end