ffi-gdal 0.0.4 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -1
  3. data/Rakefile +12 -1
  4. data/TODO.md +11 -0
  5. data/ffi-gdal.gemspec +2 -2
  6. data/lib/ext/error_symbols.rb +59 -0
  7. data/lib/ext/float_ext.rb +15 -0
  8. data/lib/ext/narray_ext.rb +16 -0
  9. data/lib/ext/to_bool.rb +2 -0
  10. data/lib/ffi-gdal.rb +139 -4
  11. data/lib/ffi/{gdal/cpl_conv.rb → cpl/conv_h.rb} +2 -3
  12. data/lib/ffi/{gdal/cpl_error.rb → cpl/error_h.rb} +1 -25
  13. data/lib/ffi/cpl/minixml_h.rb +14 -0
  14. data/lib/ffi/{gdal/cpl_string.rb → cpl/string_h.rb} +0 -25
  15. data/lib/ffi/{gdal/cpl_vsi.rb → cpl/vsi_h.rb} +0 -0
  16. data/lib/ffi/cpl/xml_node.rb +13 -0
  17. data/lib/ffi/gdal.rb +57 -593
  18. data/lib/ffi/gdal/alg_h.rb +127 -0
  19. data/lib/ffi/gdal/gdal_grid_data_metrics_options.rb +14 -0
  20. data/lib/ffi/gdal/gdal_grid_inverse_distance_to_a_power_options.rb +19 -0
  21. data/lib/ffi/gdal/gdal_grid_moving_average_options.rb +14 -0
  22. data/lib/ffi/gdal/gdal_grid_nearest_neighbor_options.rb +13 -0
  23. data/lib/ffi/gdal/gdal_h.rb +683 -0
  24. data/lib/ffi/gdal/gdal_rpc_info.rb +27 -0
  25. data/lib/ffi/gdal/gdal_transformer_info.rb +14 -0
  26. data/lib/ffi/gdal/gdal_warp_options.rb +43 -0
  27. data/lib/ffi/gdal/grid_h.rb +51 -0
  28. data/lib/ffi/gdal/version.rb +1 -1
  29. data/lib/ffi/gdal/warper_h.rb +48 -0
  30. data/lib/ffi/ogr.rb +12 -0
  31. data/lib/ffi/ogr/api_h.rb +553 -0
  32. data/lib/ffi/ogr/core_h.rb +148 -0
  33. data/lib/ffi/ogr/featurestyle_h.rb +22 -0
  34. data/lib/ffi/ogr/geocoding_h.rb +21 -0
  35. data/lib/ffi/ogr/ogr_contour_writer_info.rb +14 -0
  36. data/lib/ffi/ogr/ogr_envelope.rb +12 -0
  37. data/lib/ffi/ogr/ogr_envelope_3d.rb +14 -0
  38. data/lib/ffi/ogr/ogr_field.rb +50 -0
  39. data/lib/ffi/ogr/ogr_style_param.rb +12 -0
  40. data/lib/ffi/ogr/ogr_style_value.rb +13 -0
  41. data/lib/ffi/ogr/srs_api_h.rb +325 -0
  42. data/lib/gdal/color_entry.rb +47 -0
  43. data/lib/gdal/color_entry_extensions.rb +30 -0
  44. data/lib/gdal/color_interpretation.rb +15 -0
  45. data/lib/gdal/color_table.rb +146 -0
  46. data/lib/gdal/color_table_extensions.rb +47 -0
  47. data/lib/gdal/color_table_types/cmyk.rb +25 -0
  48. data/lib/gdal/color_table_types/gray.rb +9 -0
  49. data/lib/gdal/color_table_types/hls.rb +21 -0
  50. data/lib/gdal/color_table_types/rgb.rb +25 -0
  51. data/lib/gdal/data_type.rb +38 -0
  52. data/lib/gdal/dataset.rb +437 -0
  53. data/lib/gdal/dataset_extensions.rb +496 -0
  54. data/lib/gdal/driver.rb +244 -0
  55. data/lib/gdal/driver_extensions.rb +56 -0
  56. data/lib/gdal/environment_methods.rb +43 -0
  57. data/lib/{ffi-gdal → gdal}/exceptions.rb +4 -1
  58. data/lib/gdal/geo_transform.rb +188 -0
  59. data/lib/gdal/geo_transform_extensions.rb +90 -0
  60. data/lib/gdal/logger.rb +7 -0
  61. data/lib/{ffi-gdal → gdal}/major_object.rb +15 -14
  62. data/lib/gdal/options.rb +49 -0
  63. data/lib/gdal/raster_attribute_table.rb +185 -0
  64. data/lib/gdal/raster_attribute_table_extensions.rb +40 -0
  65. data/lib/{ffi-gdal → gdal}/raster_band.rb +227 -99
  66. data/lib/gdal/raster_band_extensions.rb +198 -0
  67. data/lib/{ffi-gdal → gdal}/version_info.rb +8 -0
  68. data/lib/gdal/warp_operation.rb +96 -0
  69. data/lib/ogr/coordinate_transformation.rb +108 -0
  70. data/lib/ogr/data_source.rb +172 -0
  71. data/lib/ogr/data_source_extensions.rb +32 -0
  72. data/lib/ogr/driver.rb +119 -0
  73. data/lib/ogr/envelope.rb +80 -0
  74. data/lib/ogr/envelope_extensions.rb +92 -0
  75. data/lib/ogr/exceptions.rb +35 -0
  76. data/lib/ogr/feature.rb +212 -0
  77. data/lib/ogr/feature_definition.rb +120 -0
  78. data/lib/ogr/feature_definition_extensions.rb +36 -0
  79. data/lib/ogr/feature_extensions.rb +31 -0
  80. data/lib/ogr/field.rb +91 -0
  81. data/lib/ogr/field_extensions.rb +23 -0
  82. data/lib/ogr/geocoding_session.rb +84 -0
  83. data/lib/ogr/geometry.rb +617 -0
  84. data/lib/ogr/geometry_extensions.rb +60 -0
  85. data/lib/ogr/geometry_types/collection.rb +45 -0
  86. data/lib/ogr/geometry_types/curve.rb +120 -0
  87. data/lib/ogr/geometry_types/surface.rb +20 -0
  88. data/lib/ogr/layer.rb +226 -0
  89. data/lib/ogr/layer_extensions.rb +55 -0
  90. data/lib/ogr/line_string.rb +7 -0
  91. data/lib/ogr/linear_ring.rb +6 -0
  92. data/lib/ogr/multi_line_string.rb +9 -0
  93. data/lib/ogr/multi_point.rb +7 -0
  94. data/lib/ogr/multi_polygon.rb +14 -0
  95. data/lib/ogr/point.rb +89 -0
  96. data/lib/ogr/polygon.rb +9 -0
  97. data/lib/ogr/spatial_reference.rb +723 -0
  98. data/lib/ogr/spatial_reference_extensions.rb +32 -0
  99. data/lib/ogr/style_table.rb +17 -0
  100. data/lib/ogr/style_table_extensions.rb +16 -0
  101. data/spec/{ffi-gdal/integration → integration}/color_table_info_spec.rb +1 -1
  102. data/spec/{ffi-gdal/integration → integration}/dataset_info_spec.rb +0 -0
  103. data/spec/{ffi-gdal/integration → integration}/driver_info_spec.rb +1 -1
  104. data/spec/{ffi-gdal/integration → integration}/geo_transform_info_spec.rb +0 -0
  105. data/spec/{ffi-gdal/integration → integration}/raster_attribute_table_info_spec.rb +1 -1
  106. data/spec/{ffi-gdal/integration → integration}/raster_band_info_spec.rb +5 -5
  107. data/spec/spec_helper.rb +4 -1
  108. data/spec/support/shapefiles/states_21basic/states.prj +1 -0
  109. data/spec/support/shapefiles/states_21basic/states.sbn +0 -0
  110. data/spec/support/shapefiles/states_21basic/states.sbx +0 -0
  111. data/spec/support/shapefiles/states_21basic/states.shp +0 -0
  112. data/spec/support/worldfiles/SR_50M/SR_50M.VERSION.txt +1 -0
  113. data/spec/support/worldfiles/SR_50M/SR_50M.prj +1 -0
  114. data/spec/support/worldfiles/SR_50M/SR_50M.tfw +6 -0
  115. data/spec/{ext/cpl_error_symbols_spec.rb → unit/ext/error_symbols_spec.rb} +1 -1
  116. data/spec/unit/gdal/color_table_spec.rb +146 -0
  117. data/spec/unit/ogr/layer_spec.rb +97 -0
  118. data/spec/unit/ogr/linear_ring_spec.rb +111 -0
  119. data/spec/unit/ogr/point_spec.rb +321 -0
  120. data/spec/{ffi-gdal/unit → unit}/version_info_spec.rb +1 -1
  121. data/testing_gdal.rb +168 -0
  122. data/testing_gdalwarp.rb +91 -0
  123. data/testing_layer_to_layer.rb +35 -0
  124. data/testing_ndvi.rb +76 -0
  125. data/testing_nir.rb +77 -0
  126. data/testing_ogr.rb +63 -0
  127. metadata +167 -59
  128. data/lib/ext/cpl_error_symbols.rb +0 -37
  129. data/lib/ffi-gdal/color_table.rb +0 -59
  130. data/lib/ffi-gdal/dataset.rb +0 -359
  131. data/lib/ffi-gdal/driver.rb +0 -151
  132. data/lib/ffi-gdal/geo_transform.rb +0 -137
  133. data/lib/ffi-gdal/raster_attribute_table.rb +0 -78
  134. data/lib/ffi/gdal/ogr_api.rb +0 -21
  135. data/lib/ffi/gdal/ogr_core.rb +0 -195
  136. data/lib/ffi/gdal/ogr_srs_api.rb +0 -44
  137. data/meow.rb +0 -144
  138. data/rubby.rb +0 -224
@@ -0,0 +1,148 @@
1
+ module FFI
2
+ module GDAL
3
+
4
+ #------------------------------------------------------------------------
5
+ # Enums
6
+ #------------------------------------------------------------------------
7
+ # The C API defines :OGRErr as a function that returns constants. I'm
8
+ # taking the liberty to turn this into an enum.
9
+ OGRErr = enum :OGRERR_NONE,
10
+ :OGRERR_NOT_ENOUGH_DATA,
11
+ :OGRERR_NOT_ENOUGH_MEMORY,
12
+ :OGRERR_UNSUPPORTED_GEOMETRY_TYPE,
13
+ :OGRERR_UNSUPPORTED_OPERATION,
14
+ :OGRERR_CORRUPT_DATA,
15
+ :OGRERR_FAILURE,
16
+ :OGRERR_UNSUPPORTED_SRS,
17
+ :OGRERR_INVALID_HANDLE
18
+
19
+ OGRwkbGeometryType = enum :wkbUnknown, 0,
20
+ :wkbPoint, 1,
21
+ :wkbLineString, 2,
22
+ :wkbPolygon, 3,
23
+ :wkbMultiPoint, 4,
24
+ :wkbMultiLineString, 5,
25
+ :wkbMultiPolygon, 6,
26
+ :wkbGeometryCollection, 7,
27
+ :wkbNone, 100,
28
+ :wkbLinearRing, 101,
29
+ :wkbPoint25D, 0x80000001,
30
+ :wkbLineString25D, 0x80000002,
31
+ :wkbPolygon25D, 0x80000003,
32
+ :wkbMultiPoint25D, 0x80000004,
33
+ :wkbMultiLineString25D, 0x80000005,
34
+ :wkbMultiPolygon25D, 0x80000006,
35
+ :wkbGeometryCollection25D, 0x80000007
36
+
37
+ OGRwkbVariant = enum :wkbVariantOgc, :wkbVariantIso
38
+ OGRwkbByteOrder = enum :wkbXDR, 0,
39
+ :wkbNDR, 1
40
+
41
+ OGRFieldType = enum :OFTInteger, 0,
42
+ :OFTIntegerList, 1,
43
+ :OFTReal, 2,
44
+ :OFTRealList, 3,
45
+ :OFTString, 4,
46
+ :OFTStringList, 5,
47
+ :OFTWideString, 6,
48
+ :OFTWideStringList, 7,
49
+ :OFTBinary, 8,
50
+ :OFTDate, 9,
51
+ :OFTTime, 10,
52
+ :OFTDateTime, 11,
53
+ :OFTMaxType, 11
54
+
55
+ OGRJustification = enum :OJUndefined, 0,
56
+ :OJLeft, 1,
57
+ :OJRight, 2
58
+
59
+ OGRSTClassId = enum :OGRSTCNone, 0,
60
+ :OGRSTCPen, 1,
61
+ :OGRSTCBrush, 2,
62
+ :OGRSTCSymbol, 3,
63
+ :OGRSTCLabel, 4,
64
+ :OGRSTCVector, 5
65
+
66
+ OGRSTUnitId = enum :OGRSTUGround, 0,
67
+ :OGRSTUPixel, 1,
68
+ :OGRSTUPoints, 2,
69
+ :OGRSTUMM, 3,
70
+ :OGRSTUCM, 4,
71
+ :OGRSTUInches, 5
72
+
73
+ OGRSTPenParam = enum :OGRSTPenColor, 0,
74
+ :OGRSTPenWidth, 1,
75
+ :OGRSTPenPattern, 2,
76
+ :OGRSTPenId, 3,
77
+ :OGRSTPenPerOffset, 4,
78
+ :OGRSTPenPerCap, 5,
79
+ :OGRSTPenPerJoin, 6,
80
+ :OGRSTPenPerPriority, 7,
81
+ :OGRSTPenLast, 8
82
+
83
+ OGRSTBrushParam = enum :OGRSTBrushFColor, 0,
84
+ :OGRSTBrushBColor, 1,
85
+ :OGRSTBrushId, 2,
86
+ :OGRSTBrushAngle, 3,
87
+ :OGRSTBrushSize, 4,
88
+ :OGRSTBrushDx, 5,
89
+ :OGRSTBrushDy, 6,
90
+ :OGRSTBrushPriority, 7,
91
+ :OGRSTBrushLast, 8
92
+
93
+ OGRSTSymbolParam = enum :OGRSTSymbolId, 0,
94
+ :OGRSTSymbolAngle, 1,
95
+ :OGRSTSymbolColor, 2,
96
+ :OGRSTSymbolSize, 3,
97
+ :OGRSTSymbolDx, 4,
98
+ :OGRSTSymbolDy, 5,
99
+ :OGRSTSymbolStep, 6,
100
+ :OGRSTSymbolPerp, 7,
101
+ :OGRSTSymbolOffset, 8,
102
+ :OGRSTSymbolPriority, 9,
103
+ :OGRSTSymbolFontName, 10,
104
+ :OGRSTSymbolOColor, 11,
105
+ :OGRSTSymbolLast, 12
106
+
107
+ OGRSTLabelParam = enum :OGRSTLabelFontName, 0,
108
+ :OGRSTLabelSize, 1,
109
+ :OGRSTLabelTextString, 2,
110
+ :OGRSTLabelAngle, 3,
111
+ :OGRSTLabelFColor, 4,
112
+ :OGRSTLabelBColor, 5,
113
+ :OGRSTLabelPlacement, 6,
114
+ :OGRSTLabelAnchor, 7,
115
+ :OGRSTLabelDx, 8,
116
+ :OGRSTLabelDy, 9,
117
+ :OGRSTLabelPerp, 10,
118
+ :OGRSTLabelBold, 11,
119
+ :OGRSTLabelItalic, 12,
120
+ :OGRSTLabelUnderline, 13,
121
+ :OGRSTLabelPriority, 14,
122
+ :OGRSTLabelStrikeout, 15,
123
+ :OGRSTLabelStretch, 16,
124
+ :OGRSTLabelAdjHor, 17,
125
+ :OGRSTLabelAdjVert, 18,
126
+ :OGRSTLabelHColor, 19,
127
+ :OGRSTLabelOColor, 20,
128
+ :OGRSTLabelLast, 21
129
+
130
+ #------------------------------------------------------------------------
131
+ # Typedefs
132
+ #------------------------------------------------------------------------
133
+ typedef :int, :OGRBoolean
134
+
135
+ #------------------------------------------------------------------------
136
+ # Functions
137
+ #------------------------------------------------------------------------
138
+ attach_function :OGRMalloc, [:size_t], :pointer
139
+ attach_function :OGRCalloc, [:size_t, :size_t], :pointer
140
+ attach_function :OGRRealloc, [:pointer, :size_t], :pointer
141
+ attach_function :OGRFree, [:pointer], :void
142
+ attach_function :OGRGeometryTypeToName, [OGRwkbGeometryType], :string
143
+ attach_function :OGRMergeGeometryTypes,
144
+ [OGRwkbGeometryType, OGRwkbGeometryType],
145
+ OGRwkbGeometryType
146
+ attach_function :OGRParseDate, [:string, :pointer, :int], :int
147
+ end
148
+ end
@@ -0,0 +1,22 @@
1
+ module FFI
2
+ module GDAL
3
+ autoload :OGRStyleParam,
4
+ File.expand_path('ogr_style_param', __dir__)
5
+ autoload :OGRStyleValue,
6
+ File.expand_path('ogr_style_value', __dir__)
7
+
8
+ #------------------------------------------------------------------------
9
+ # Enums
10
+ #------------------------------------------------------------------------
11
+ OGRStyleType = enum :OGRSTypeString,
12
+ :OGRSTypeDouble,
13
+ :OGRSTypeInteger,
14
+ :OGRSTypeBoolean
15
+
16
+ #------------------------------------------------------------------------
17
+ # Typedefs
18
+ #------------------------------------------------------------------------
19
+ OGRSType = OGRStyleType
20
+ OGRStyleParamId = OGRStyleParam
21
+ end
22
+ end
@@ -0,0 +1,21 @@
1
+ module FFI
2
+ module GDAL
3
+ #------------------------------------------------------------------------
4
+ # Typedefs
5
+ #------------------------------------------------------------------------
6
+ typedef :pointer, :OGRGeocodingSessionH
7
+
8
+ #------------------------------------------------------------------------
9
+ # Functions
10
+ #------------------------------------------------------------------------
11
+ attach_function :OGRGeocodeCreateSession, %i[pointer], :OGRGeocodingSessionH
12
+ attach_function :OGRGeocodeDestroySession, %i[OGRGeocodingSessionH], :void
13
+ attach_function :OGRGeocode,
14
+ %i[OGRGeocodingSessionH string pointer pointer],
15
+ :OGRLayerH
16
+ attach_function :OGRGeocodeReverse,
17
+ %i[OGRGeocodingSessionH double double pointer],
18
+ :OGRLayerH
19
+ attach_function :OGRGeocodeFreeResult, %i[OGRLayerH], :void
20
+ end
21
+ end
@@ -0,0 +1,14 @@
1
+ require 'ffi'
2
+
3
+
4
+ module FFI
5
+ module GDAL
6
+ class OGRContourWriterInfo < FFI::Struct
7
+ layout :layer, :pointer,
8
+ :geo_transform, [:double, 6],
9
+ :elev_field, :int,
10
+ :id_field, :int,
11
+ :next_id, :int
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ require 'ffi'
2
+
3
+ module FFI
4
+ module GDAL
5
+ class OGREnvelope < FFI::Struct
6
+ layout :min_x, :double,
7
+ :max_x, :double,
8
+ :min_y, :double,
9
+ :max_y, :double
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ require 'ffi'
2
+
3
+ module FFI
4
+ module GDAL
5
+ class OGREnvelope3D < FFI::Struct
6
+ layout :min_x, :double,
7
+ :max_x, :double,
8
+ :min_y, :double,
9
+ :max_y, :double,
10
+ :min_z, :double,
11
+ :max_z, :double
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,50 @@
1
+ module FFI
2
+ module GDAL
3
+ class IntegerList < FFI::Struct
4
+ layout :count, :int,
5
+ :list, :pointer
6
+ end
7
+
8
+ class RealList < FFI::Struct
9
+ layout :count, :int,
10
+ :list, :pointer
11
+ end
12
+
13
+ class StringList < FFI::Struct
14
+ layout :count, :int,
15
+ :list, :pointer
16
+ end
17
+
18
+ class Binary < FFI::Struct
19
+ layout :count, :int,
20
+ :list, :pointer
21
+ end
22
+
23
+ class Set < FFI::Struct
24
+ layout :marker1, :int,
25
+ :marker2, :int
26
+ end
27
+
28
+ class Date < FFI::Struct
29
+ layout :year, :GInt16,
30
+ :month, :GByte,
31
+ :day, :GByte,
32
+ :hour, :GByte,
33
+ :minute, :GByte,
34
+ :second, :GByte,
35
+ :tz_flag, :GByte
36
+ end
37
+
38
+ class OGRField < FFI::Union
39
+ layout :integer, :int,
40
+ :real, :double,
41
+ :string, :string,
42
+ :integer_list, IntegerList,
43
+ :real_list, RealList,
44
+ :string_list, StringList,
45
+ :binary, Binary,
46
+ :set, Set,
47
+ :date, Date
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,12 @@
1
+ require 'ffi'
2
+
3
+ module FFI
4
+ module GDAL
5
+ class OGRStyleParam < FFI::Struct
6
+ layout :param, :int,
7
+ :token, :string,
8
+ :georef, :GBool,
9
+ :type, OGRSType
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ require 'ffi'
2
+
3
+ module FFI
4
+ module GDAL
5
+ class OGRStyleValue < FFI::Struct
6
+ layout :string_value, :string,
7
+ :double_value, :double,
8
+ :int_value, :int,
9
+ :valid, :GBool,
10
+ :unit, OGRSTUnitId
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,325 @@
1
+ module FFI
2
+ module GDAL
3
+
4
+ #------------------------------------------------------------------------
5
+ # Enums
6
+ #------------------------------------------------------------------------
7
+ OGRAxisOrientation = enum :OAO_Other, 0,
8
+ :OAO_North, 1,
9
+ :OAO_South, 2,
10
+ :OAO_East, 3,
11
+ :OAO_West, 4,
12
+ :OAO_Up, 5,
13
+ :OAO_Down, 6
14
+
15
+ OGRDatumType = enum :ODT_HD_Min, 1000,
16
+ :ODT_HD_Other, 1000,
17
+ :ODT_HD_Classic, 1001,
18
+ :ODT_HD_Geocentric, 1002,
19
+ :ODT_HD_Max, 1999,
20
+ :ODT_VD_Min, 2000,
21
+ :ODT_VD_Other, 2000,
22
+ :ODT_VD_Orthometric, 2001,
23
+ :ODT_VD_Ellipsoidal, 2002,
24
+ :ODT_VD_AltitudeBarometric, 2003,
25
+ :ODT_VD_Normal, 2004,
26
+ :ODT_VD_GeoidModelDerived, 2005,
27
+ :ODT_VD_Depth, 2006,
28
+ :ODT_VD_Max, 2999,
29
+ :ODT_LD_Min, 10000,
30
+ :ODT_LD_Max, 32767
31
+
32
+ #------------------------------------------------------------------------
33
+ # Typedefs
34
+ #------------------------------------------------------------------------
35
+ typedef :pointer, :OGRSpatialReferenceH
36
+ typedef :pointer, :OGRCoordinateTransformationH
37
+
38
+ #------------------------------------------------------------------------
39
+ # Functions
40
+ #------------------------------------------------------------------------
41
+ #~~~~~~~~~~~~~~
42
+ # AxisOrientations
43
+ #~~~~~~~~~~~~~~
44
+ attach_function :OSRAxisEnumToName, [OGRAxisOrientation], :string
45
+
46
+ #~~~~~~~~~~~~~~
47
+ # SpatialReference
48
+ #~~~~~~~~~~~~~~
49
+ attach_function :OSRNewSpatialReference, %i[string], :OGRSpatialReferenceH
50
+ attach_function :OSRCloneGeogCS, %i[OGRSpatialReferenceH], :OGRSpatialReferenceH
51
+ attach_function :OSRClone, %i[OGRSpatialReferenceH], :OGRSpatialReferenceH
52
+ attach_function :OSRDestroySpatialReference, %i[OGRSpatialReferenceH], :void
53
+ attach_function :OSRReference, %i[OGRSpatialReferenceH], :int
54
+ attach_function :OSRDereference, %i[OGRSpatialReferenceH], :int
55
+ attach_function :OSRRelease, %i[OGRSpatialReferenceH], :void
56
+
57
+ attach_function :OSRValidate, %i[OGRSpatialReferenceH], OGRErr
58
+ attach_function :OSRFixupOrdering, %i[OGRSpatialReferenceH], OGRErr
59
+ attach_function :OSRFixup, %i[OGRSpatialReferenceH], OGRErr
60
+ attach_function :OSRStripCTParms, %i[OGRSpatialReferenceH], OGRErr
61
+
62
+ attach_function :OSRImportFromEPSG, %i[OGRSpatialReferenceH int], OGRErr
63
+ attach_function :OSRImportFromEPSGA, %i[OGRSpatialReferenceH int], OGRErr
64
+ attach_function :OSRImportFromWkt, %i[OGRSpatialReferenceH pointer], OGRErr
65
+ attach_function :OSRImportFromProj4, %i[OGRSpatialReferenceH string], OGRErr
66
+ attach_function :OSRImportFromESRI, %i[OGRSpatialReferenceH pointer], OGRErr
67
+ attach_function :OSRImportFromPCI,
68
+ %i[OGRSpatialReferenceH string string pointer],
69
+ OGRErr
70
+ attach_function :OSRImportFromUSGS,
71
+ %i[OGRSpatialReferenceH long long pointer long],
72
+ OGRErr
73
+ attach_function :OSRImportFromXML, %i[OGRSpatialReferenceH string], OGRErr
74
+ attach_function :OSRImportFromMICoordSys, %i[OGRSpatialReferenceH string], OGRErr
75
+ attach_function :OSRImportFromERM,
76
+ %i[OGRSpatialReferenceH string string string],
77
+ OGRErr
78
+ attach_function :OSRImportFromUrl, %i[OGRSpatialReferenceH string], OGRErr
79
+
80
+ attach_function :OSRExportToWkt, %i[OGRSpatialReferenceH pointer], OGRErr
81
+ attach_function :OSRExportToPrettyWkt, %i[OGRSpatialReferenceH pointer bool], OGRErr
82
+ attach_function :OSRExportToProj4, %i[OGRSpatialReferenceH pointer], OGRErr
83
+ attach_function :OSRExportToPCI,
84
+ %i[OGRSpatialReferenceH pointer pointer pointer],
85
+ OGRErr
86
+ attach_function :OSRExportToUSGS,
87
+ %i[OGRSpatialReferenceH pointer pointer pointer pointer],
88
+ OGRErr
89
+ attach_function :OSRExportToXML, %i[OGRSpatialReferenceH pointer buffer_out], OGRErr
90
+ attach_function :OSRExportToMICoordSys, %i[OGRSpatialReferenceH pointer], OGRErr
91
+ attach_function :OSRExportToERM,
92
+ %i[OGRSpatialReferenceH buffer_out buffer_out buffer_out],
93
+ OGRErr
94
+ attach_function :OSRMorphToESRI, %i[OGRSpatialReferenceH], OGRErr
95
+ attach_function :OSRMorphFromESRI, %i[OGRSpatialReferenceH], OGRErr
96
+
97
+ attach_function :OSRSetAttrValue, %i[OGRSpatialReferenceH string string], OGRErr
98
+ attach_function :OSRGetAttrValue, %i[OGRSpatialReferenceH string int], :string
99
+ attach_function :OSRSetAngularUnits, %i[OGRSpatialReferenceH string double], OGRErr
100
+ attach_function :OSRGetAngularUnits, %i[OGRSpatialReferenceH pointer], :double
101
+ attach_function :OSRSetLinearUnits, %i[OGRSpatialReferenceH string double], OGRErr
102
+ attach_function :OSRGetLinearUnits, %i[OGRSpatialReferenceH pointer], :double
103
+ attach_function :OSRSetTargetLinearUnits, %i[OGRSpatialReferenceH string string double], OGRErr
104
+ attach_function :OSRGetTargetLinearUnits, %i[OGRSpatialReferenceH string pointer], :double
105
+ attach_function :OSRGetPrimeMeridian, %i[OGRSpatialReferenceH pointer], :double
106
+ attach_function :OSRSetLinearUnitsAndUpdateParameters,
107
+ %i[OGRSpatialReferenceH string double],
108
+ OGRErr
109
+ attach_function :OSRGetSemiMajor, %i[OGRSpatialReferenceH pointer], :double
110
+ attach_function :OSRGetSemiMinor, %i[OGRSpatialReferenceH pointer], :double
111
+ attach_function :OSRGetInvFlattening, %i[OGRSpatialReferenceH pointer], :double
112
+ attach_function :OSRSetAuthority,
113
+ %i[OGRSpatialReferenceH string string int],
114
+ OGRErr
115
+ attach_function :OSRGetAuthorityCode, %i[OGRSpatialReferenceH string], :string
116
+ attach_function :OSRGetAuthorityName, %i[OGRSpatialReferenceH string], :string
117
+ attach_function :OSRSetProjection, %i[OGRSpatialReferenceH string], OGRErr
118
+ attach_function :OSRSetProjParm, %i[OGRSpatialReferenceH string double], OGRErr
119
+ attach_function :OSRGetProjParm,
120
+ %i[OGRSpatialReferenceH string double pointer],
121
+ :double
122
+ attach_function :OSRSetNormProjParm, %i[OGRSpatialReferenceH string double], OGRErr
123
+ attach_function :OSRGetNormProjParm,
124
+ %i[OGRSpatialReferenceH string double pointer],
125
+ :double
126
+ attach_function :OSRSetUTM, %i[OGRSpatialReferenceH int int], OGRErr
127
+ attach_function :OSRGetUTMZone, %i[OGRSpatialReferenceH pointer], :int
128
+ attach_function :OSRSetStatePlane, %i[OGRSpatialReferenceH int int], OGRErr
129
+ attach_function :OSRSetStatePlaneWithUnits,
130
+ %i[OGRSpatialReferenceH int int string double],
131
+ OGRErr
132
+ attach_function :OSRAutoIdentifyEPSG, %i[OGRSpatialReferenceH], OGRErr
133
+ attach_function :OSREPSGTreatsAsLatLong, %i[OGRSpatialReferenceH], :bool
134
+ attach_function :OSREPSGTreatsAsNorthingEasting, %i[OGRSpatialReferenceH], :bool
135
+ attach_function :OSRGetAxis,
136
+ [:OGRSpatialReferenceH, :string, :int, :pointer],
137
+ :string
138
+
139
+ attach_function :OSRSetACEA,
140
+ %i[OGRSpatialReferenceH double double double double double double],
141
+ OGRErr
142
+ attach_function :OSRSetAE,
143
+ %i[OGRSpatialReferenceH double double double double],
144
+ OGRErr
145
+ attach_function :OSRSetBonne,
146
+ %i[OGRSpatialReferenceH double double double double],
147
+ OGRErr
148
+ attach_function :OSRSetCEA,
149
+ %i[OGRSpatialReferenceH double double double double],
150
+ OGRErr
151
+ attach_function :OSRSetCS,
152
+ %i[OGRSpatialReferenceH double double double double],
153
+ OGRErr
154
+ attach_function :OSRSetEC,
155
+ %i[OGRSpatialReferenceH double double double double double double],
156
+ OGRErr
157
+ attach_function :OSRSetEckert,
158
+ %i[OGRSpatialReferenceH int double double double],
159
+ OGRErr
160
+ attach_function :OSRSetEckertIV,
161
+ %i[OGRSpatialReferenceH double double double],
162
+ OGRErr
163
+ attach_function :OSRSetEckertVI,
164
+ %i[OGRSpatialReferenceH double double double],
165
+ OGRErr
166
+ attach_function :OSRSetEquirectangular,
167
+ %i[OGRSpatialReferenceH double double double double],
168
+ OGRErr
169
+ attach_function :OSRSetEquirectangular2,
170
+ %i[OGRSpatialReferenceH double double double double double],
171
+ OGRErr
172
+ attach_function :OSRSetGS,
173
+ %i[OGRSpatialReferenceH double double double],
174
+ OGRErr
175
+ attach_function :OSRSetGH,
176
+ %i[OGRSpatialReferenceH double double double],
177
+ OGRErr
178
+ attach_function :OSRSetIGH,
179
+ %i[OGRSpatialReferenceH],
180
+ OGRErr
181
+ attach_function :OSRSetGEOS,
182
+ %i[OGRSpatialReferenceH double double double double],
183
+ OGRErr
184
+ attach_function :OSRSetGaussSchreiberTMercator,
185
+ %i[OGRSpatialReferenceH double double double double double],
186
+ OGRErr
187
+ attach_function :OSRSetGnomonic,
188
+ %i[OGRSpatialReferenceH double double double double],
189
+ OGRErr
190
+ attach_function :OSRSetOM,
191
+ %i[OGRSpatialReferenceH double double double double double double double],
192
+ OGRErr
193
+ OGRErr
194
+ attach_function :OSRSetHOM,
195
+ %i[OGRSpatialReferenceH double double double double double double double],
196
+ OGRErr
197
+ attach_function :OSRSetHOM2PNO,
198
+ %i[OGRSpatialReferenceH double double double double double double double double],
199
+ OGRErr
200
+ attach_function :OSRSetIWMPolyconic,
201
+ %i[OGRSpatialReferenceH double double double double double],
202
+ OGRErr
203
+ attach_function :OSRSetKrovak,
204
+ %i[OGRSpatialReferenceH double double double double double double double],
205
+ OGRErr
206
+ attach_function :OSRSetLAEA,
207
+ %i[OGRSpatialReferenceH double double double double],
208
+ OGRErr
209
+ attach_function :OSRSetLCC,
210
+ %i[OGRSpatialReferenceH double double double double double double],
211
+ OGRErr
212
+ attach_function :OSRSetLCC1SP,
213
+ %i[OGRSpatialReferenceH double double double double double],
214
+ OGRErr
215
+ attach_function :OSRSetLCCB,
216
+ %i[OGRSpatialReferenceH double double double double double double],
217
+ OGRErr
218
+ attach_function :OSRSetMC,
219
+ %i[OGRSpatialReferenceH double double double double],
220
+ OGRErr
221
+ attach_function :OSRSetMercator,
222
+ %i[OGRSpatialReferenceH double double double double double],
223
+ OGRErr
224
+ attach_function :OSRSetMollweide,
225
+ %i[OGRSpatialReferenceH double double double],
226
+ OGRErr
227
+ attach_function :OSRSetNZMG,
228
+ %i[OGRSpatialReferenceH double double double double],
229
+ OGRErr
230
+ attach_function :OSRSetOS,
231
+ %i[OGRSpatialReferenceH double double double double double],
232
+ OGRErr
233
+ attach_function :OSRSetOrthographic,
234
+ %i[OGRSpatialReferenceH double double double double],
235
+ OGRErr
236
+ attach_function :OSRSetPolyconic,
237
+ %i[OGRSpatialReferenceH double double double double],
238
+ OGRErr
239
+ attach_function :OSRSetPS,
240
+ %i[OGRSpatialReferenceH double double double double double],
241
+ OGRErr
242
+ attach_function :OSRSetRobinson,
243
+ %i[OGRSpatialReferenceH double double double],
244
+ OGRErr
245
+ attach_function :OSRSetSinusoidal,
246
+ %i[OGRSpatialReferenceH double double double],
247
+ OGRErr
248
+ attach_function :OSRSetStereographic,
249
+ %i[OGRSpatialReferenceH double double double double double],
250
+ OGRErr
251
+ attach_function :OSRSetSOC,
252
+ %i[OGRSpatialReferenceH double double double double],
253
+ OGRErr
254
+ attach_function :OSRSetTM,
255
+ %i[OGRSpatialReferenceH double double double double double],
256
+ OGRErr
257
+ attach_function :OSRSetTMVariant,
258
+ %i[OGRSpatialReferenceH string double double double double double],
259
+ OGRErr
260
+ attach_function :OSRSetTMG,
261
+ %i[OGRSpatialReferenceH double double double double],
262
+ OGRErr
263
+ attach_function :OSRSetTMSO,
264
+ %i[OGRSpatialReferenceH double double double double double],
265
+ OGRErr
266
+ attach_function :OSRSetVDG,
267
+ %i[OGRSpatialReferenceH double double double],
268
+ OGRErr
269
+ attach_function :OSRSetWagner,
270
+ %i[OGRSpatialReferenceH int double double],
271
+ OGRErr
272
+
273
+ attach_function :OSRIsGeographic, %i[OGRSpatialReferenceH], :bool
274
+ attach_function :OSRIsLocal, %i[OGRSpatialReferenceH], :bool
275
+ attach_function :OSRIsProjected, %i[OGRSpatialReferenceH], :bool
276
+ attach_function :OSRIsCompound, %i[OGRSpatialReferenceH], :bool
277
+ attach_function :OSRIsGeocentric, %i[OGRSpatialReferenceH], :bool
278
+ attach_function :OSRIsVertical, %i[OGRSpatialReferenceH], :bool
279
+ attach_function :OSRIsSameGeogCS, %i[OGRSpatialReferenceH OGRSpatialReferenceH], :bool
280
+ attach_function :OSRIsSameVertCS, %i[OGRSpatialReferenceH OGRSpatialReferenceH], :bool
281
+ attach_function :OSRIsSame, %i[OGRSpatialReferenceH OGRSpatialReferenceH], :bool
282
+
283
+ attach_function :OSRSetLocalCS, %i[OGRSpatialReferenceH string], OGRErr
284
+ attach_function :OSRSetProjCS, %i[OGRSpatialReferenceH string], OGRErr
285
+ attach_function :OSRSetGeocCS, %i[OGRSpatialReferenceH string], OGRErr
286
+ attach_function :OSRSetWellKnownGeocCS, %i[OGRSpatialReferenceH string], OGRErr
287
+ attach_function :OSRSetFromUserInput, %i[OGRSpatialReferenceH string], OGRErr
288
+ attach_function :OSRCopyGeogCSFrom, %i[OGRSpatialReferenceH OGRSpatialReferenceH], OGRErr
289
+ attach_function :OSRSetTOWGS84,
290
+ %i[OGRSpatialReferenceH double double double double double double double],
291
+ OGRErr
292
+ attach_function :OSRGetTOWGS84, %i[OGRSpatialReferenceH pointer int], OGRErr
293
+ attach_function :OSRSetCompoundCS,
294
+ %i[OGRSpatialReferenceH string OGRSpatialReferenceH OGRSpatialReferenceH],
295
+ OGRErr
296
+
297
+ attach_function :OSRCleanup, [], :void
298
+
299
+ #~~~~~~~~~~~~~~
300
+ # CoordinateTransformations
301
+ #~~~~~~~~~~~~~~
302
+ attach_function :OCTDestroyCoordinateTransformation,
303
+ %i[OGRCoordinateTransformationH],
304
+ :void
305
+ attach_function :OCTNewCoordinateTransformation,
306
+ %i[OGRSpatialReferenceH OGRSpatialReferenceH],
307
+ :OGRCoordinateTransformationH
308
+ attach_function :OCTTransform,
309
+ %i[OGRCoordinateTransformationH int pointer pointer pointer],
310
+ :bool
311
+ attach_function :OCTTransformEx,
312
+ %i[OGRCoordinateTransformationH int pointer pointer pointer pointer],
313
+ :bool
314
+ attach_function :OCTProj4Normalize, %i[string], :string
315
+
316
+ #~~~~~~~~~~~~~~
317
+ # Parameters
318
+ #~~~~~~~~~~~~~~
319
+ attach_function :OPTGetProjectionMethods, %i[], :pointer
320
+ attach_function :OPTGetParameterList, %i[string pointer], :pointer
321
+ attach_function :OPTGetParameterInfo,
322
+ %i[string string pointer pointer pointer],
323
+ :int
324
+ end
325
+ end