proj4rb 4.1.1 → 5.0.0

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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +98 -0
  3. data/Gemfile +4 -4
  4. data/README.md +53 -0
  5. data/lib/api/proj.rb +750 -0
  6. data/lib/api/proj_experimental.rb +7 -0
  7. data/lib/api/proj_ffi.rb +47 -0
  8. data/lib/api/proj_version.rb +26 -0
  9. data/lib/examples/axis_order_normalization.rb +13 -0
  10. data/lib/examples/batch_transformation.rb +25 -0
  11. data/lib/examples/context_logging.rb +26 -0
  12. data/lib/examples/crs_identification.rb +18 -0
  13. data/lib/examples/database_query.rb +27 -0
  14. data/lib/examples/geodetic_distance.rb +38 -0
  15. data/lib/examples/geodetic_to_projected.rb +18 -0
  16. data/lib/examples/operation_factory_context.rb +19 -0
  17. data/lib/examples/pipeline_operator.rb +21 -0
  18. data/lib/examples/promote_demote_3d.rb +23 -0
  19. data/lib/examples/serialization_formats.rb +17 -0
  20. data/lib/examples/transform_bounds.rb +18 -0
  21. data/lib/examples/transformation_with_area.rb +18 -0
  22. data/lib/proj/area.rb +74 -74
  23. data/lib/proj/axis_info.rb +44 -44
  24. data/lib/proj/bounds.rb +22 -0
  25. data/lib/proj/bounds3d.rb +45 -0
  26. data/lib/proj/context.rb +57 -23
  27. data/lib/proj/conversion.rb +94 -91
  28. data/lib/proj/coordinate.rb +304 -281
  29. data/lib/proj/coordinate_metadata.rb +38 -38
  30. data/lib/proj/coordinate_operation_mixin.rb +464 -381
  31. data/lib/proj/coordinate_system.rb +143 -137
  32. data/lib/proj/crs.rb +688 -680
  33. data/lib/proj/crs_info.rb +47 -47
  34. data/lib/proj/database.rb +310 -305
  35. data/lib/proj/datum.rb +32 -32
  36. data/lib/proj/datum_ensemble.rb +34 -34
  37. data/lib/proj/domain.rb +82 -0
  38. data/lib/proj/ellipsoid.rb +77 -77
  39. data/lib/proj/error.rb +7 -8
  40. data/lib/proj/file_api_callbacks.rb +165 -0
  41. data/lib/proj/grid.rb +121 -121
  42. data/lib/proj/grid_cache.rb +65 -64
  43. data/lib/proj/grid_info.rb +19 -19
  44. data/lib/proj/life_span.rb +21 -0
  45. data/lib/proj/network_api_callbacks.rb +86 -0
  46. data/lib/proj/operation.rb +66 -42
  47. data/lib/proj/operation_factory_context.rb +4 -2
  48. data/lib/proj/options.rb +41 -0
  49. data/lib/proj/parameter.rb +37 -37
  50. data/lib/proj/parameters.rb +106 -107
  51. data/lib/proj/pj_axis_description.rb +26 -0
  52. data/lib/proj/pj_object.rb +602 -672
  53. data/lib/proj/pj_objects.rb +45 -45
  54. data/lib/proj/pj_param_description.rb +28 -0
  55. data/lib/proj/prime_meridian.rb +65 -65
  56. data/lib/proj/projection.rb +54 -25
  57. data/lib/proj/session.rb +2 -0
  58. data/lib/proj/transformation.rb +102 -102
  59. data/lib/proj/unit.rb +81 -108
  60. data/lib/proj.rb +10 -3
  61. data/lib/proj4.rb +5 -5
  62. data/proj4rb.gemspec +10 -5
  63. data/test/abstract_test.rb +7 -5
  64. data/test/context_test.rb +210 -172
  65. data/test/context_validation_test.rb +11 -0
  66. data/test/conversion_test.rb +376 -368
  67. data/test/coordinate_metadata_test.rb +34 -0
  68. data/test/coordinate_system_test.rb +162 -144
  69. data/test/coordinate_test.rb +289 -34
  70. data/test/crs_test.rb +1112 -1082
  71. data/test/database_test.rb +407 -391
  72. data/test/datum_ensemble_test.rb +64 -64
  73. data/test/datum_test.rb +61 -54
  74. data/test/domain_test.rb +72 -0
  75. data/test/ellipsoid_test.rb +80 -80
  76. data/test/examples_test.rb +149 -0
  77. data/test/file_api_example.rb +58 -0
  78. data/test/file_api_test.rb +74 -66
  79. data/test/grid_cache_test.rb +72 -72
  80. data/test/grid_test.rb +126 -141
  81. data/test/network_api_example.rb +48 -0
  82. data/test/network_api_test.rb +33 -45
  83. data/test/operation_factory_context_test.rb +225 -205
  84. data/test/operation_test.rb +40 -29
  85. data/test/options_test.rb +17 -0
  86. data/test/parameters_test.rb +86 -40
  87. data/test/pj_object_test.rb +221 -187
  88. data/test/prime_meridian_test.rb +75 -75
  89. data/test/proj_test.rb +58 -58
  90. data/test/projection_test.rb +680 -650
  91. data/test/session_test.rb +78 -77
  92. data/test/transformation_test.rb +238 -210
  93. data/test/unit_test.rb +114 -76
  94. metadata +44 -32
  95. data/ChangeLog +0 -94
  96. data/README.rdoc +0 -189
  97. data/lib/api/api.rb +0 -117
  98. data/lib/api/api_5_0.rb +0 -338
  99. data/lib/api/api_5_1.rb +0 -7
  100. data/lib/api/api_5_2.rb +0 -5
  101. data/lib/api/api_6_0.rb +0 -146
  102. data/lib/api/api_6_1.rb +0 -5
  103. data/lib/api/api_6_2.rb +0 -10
  104. data/lib/api/api_6_3.rb +0 -6
  105. data/lib/api/api_7_0.rb +0 -69
  106. data/lib/api/api_7_1.rb +0 -73
  107. data/lib/api/api_7_2.rb +0 -14
  108. data/lib/api/api_8_0.rb +0 -6
  109. data/lib/api/api_8_1.rb +0 -24
  110. data/lib/api/api_8_2.rb +0 -6
  111. data/lib/api/api_9_1.rb +0 -7
  112. data/lib/api/api_9_2.rb +0 -9
  113. data/lib/api/api_9_4.rb +0 -6
  114. data/lib/api/api_experimental.rb +0 -201
  115. data/lib/proj/file_api.rb +0 -166
  116. data/lib/proj/network_api.rb +0 -92
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26b50da982077e9d6cd97efc8746bd4e888bccf689d7bb3a8e0a752493165181
4
- data.tar.gz: 3001ce9757d511e27bc4c7c0118bf2da986ab8e811c106c1517d5a5cf3cdd6a9
3
+ metadata.gz: a9f3ec7d85f489dc9b519de25df692d58e30428b4e464a7c1f8f2df8028ee0ab
4
+ data.tar.gz: f4d5d5556a0d40e4226a5c81cee261978da49de5da85a2112f828ab2dbfa9608
5
5
  SHA512:
6
- metadata.gz: 6da17b22219016b19b4e93b78a3bbb01a4794b1a21d57b2ef76cff54eb7d4c5ef50ef73679c9f91497774a10690c359f1d7bdd297892ab5745c0149bf1a3eeec
7
- data.tar.gz: 991f95662e5d10663da570b9e6efed6b37ba2c2b86d94389d485050e385c50ed6a13ad44aa84ac42b29d6a74830350739fa47a2ae5f736b09325fc5db439f5dc
6
+ metadata.gz: 656035d12c0ea84e95e771f6129701e70181e665c7c83a2ba4fee18ab39e77d821c6ff0e41e5149d9193fc9cfaf82f112c09b10abebe1a6929f1515b7e14d235
7
+ data.tar.gz: fa045be9e342f828ff2e6b8e245d13ed0b6eb9cbbcaaf60c64b0dbfe11bc38841f6bd8862f8c946013cb8649150a7772e1f32900eaefa2df8e670d1072a06f20
data/CHANGELOG.md ADDED
@@ -0,0 +1,98 @@
1
+ # Changelog
2
+
3
+ ## 5.0.0 - March 29, 2026
4
+ * Switch to auto-generated FFI bindings via [ruby-bindgen](https://github.com/cfis/ruby-bindgen)
5
+ * Add support for PROJ 9.4 API `proj_crs_has_point_motion_operation`
6
+ * Add support for PROJ 9.5 APIs: `proj_context_set_user_writable_directory`, `proj_coordoperation_requires_per_coordinate_input_time`, and `proj_create_conversion_local_orthographic`
7
+ * Add support for PROJ 9.6 APIs: `proj_trans_bounds_3D`
8
+ * Add support for PROJ 9.7 APIs: `proj_geod_direct`
9
+ * Add `Domain` class to support multiple usage domains per object (PROJ 9.2+ via `proj_get_domain_count`, `proj_get_scope_ex`, `proj_get_area_of_use_ex`; falls back to legacy APIs on older versions)
10
+ * Add 3D bounds support (`Bounds3d` + `transform_bounds_3d`) for PROJ 9.6 `proj_trans_bounds_3D`
11
+ * Fix manual wrapper argument order for `proj_create_conversion_lambert_conic_conformal_1sp_variant_b` (9.4)
12
+ * Fix `Parameter#to_description` passing parameter name instead of unit name
13
+ * Fix pointer lifetime issues in `Parameters#types=`, `PjAxisDescription`, and `PjParamDescription`
14
+ * Fix GC lifetime bugs: option string pointers, `CoordinateSystem.create` axis descriptions, and missing `require 'uri'`
15
+ * Fix context/state lifetime issues in `OperationFactoryContext` and `Context#set_log_function`
16
+ * Expand regression tests for lifecycle safety and new PROJ 9.4/9.5/9.6 wrappers
17
+ * `Unit.built_in` now returns all unit types (91 units) instead of only linear units (24 units)
18
+ * Internal: struct and enum types use Ruby naming conventions (e.g., `PjCoord` instead of `PJ_COORD`)
19
+ * Remove deprecated `Context#database_path` and `Context#database_path=` (use `context.database.path` instead)
20
+ * Internal: method names use Ruby naming conventions (e.g., `proj_create_ellipsoidal_2d_cs` instead of `proj_create_ellipsoidal_2D_cs`)
21
+ * Update to FFI 1.17.4 to fix bug on Mac ARM64
22
+
23
+ ## 4.1.1 - January 30, 2024
24
+ * Update tests for Proj 9.3
25
+ * Initial support for CoordinateMetadata in Proj 9.4 (not released yet)
26
+
27
+ ## 4.1.0 - March 12, 2023
28
+ * Fix YARD warnings
29
+ * Fix YARD types to match RBS types
30
+ * Don't use type as attribute or method name to avoid conflicts with RBS
31
+
32
+ ## 4.0.0 - March 12, 2023
33
+ * Support Proj 9
34
+ * Add support for missing APIs - the gem now provides almost 100% coverage
35
+ * Add support for Proj experimental APIs including the creation of projection conversions
36
+ * Add/updated support for a number of ISO 19111 classes, including PrimeMeridian, Ellipsoid, Datum, DatumEnsemble, CoordinateOperation and Parameters
37
+ * Greatly improved documentation (https://rubydoc.info/github/cfis/proj4rb)
38
+ * Remove old Proj 4.9 support
39
+ * Note this release does have some API changes. These include the removal of Proj 4.9 Point and Coordinate classes, changes to the PrimeMeridian class and changes to the Ellipsoid class. These changes should not impact most users.
40
+
41
+ ## 3.0.0 - September 26, 2021
42
+ * Support Proj 8 which removes the old Proj API (Charlie Savage)
43
+ * Support newer versions of FFI which remove support for returning strings from callbacks (Charlie Savage)
44
+
45
+ ## 2.2.2 - January 10, 2020
46
+ * Move proj_context_set_autoclose_database to api 6.2 (Jan Klimke)
47
+ * Improve search path generation code (Charlie Savage)
48
+
49
+ ## 2.2.1 - January 8, 2020
50
+ * Move proj_as_projjson from version 6.0 to 6.2 api (Charlie Savage)
51
+ * Improve search path generation code (Charlie Savage)
52
+
53
+ ## 2.2.0 - January 7, 2020
54
+ * Fix broken gem - was not including all api files (Jan Klimke)
55
+ * Add paths on MacOS when using Brew (Jan Klimke)
56
+ * Various code cleanups (Charlie Savage)
57
+
58
+ ## 2.1.0 - January 5, 2020
59
+ * Set Ruby 2.4.1 to be the minimum allowed version (Samuel Williams)
60
+ * Fix incorrect use of context, reduce warnings when running tests (Samuel Williams)
61
+ * Fix `bundle exec rake test` (Samuel Williams)
62
+ * Add 2.4.1 to the travis test matrix (Samuel Williams)
63
+
64
+ ## 2.0.0 - December 30, 2019
65
+ * Full rewrite to support API changes in Proj versions 5 and 6 (Charlie Savage)
66
+ * As part of rewrite switch bindings to use FFI versus a C extension (Charlie Savage)
67
+ * Split Ruby code into multiple files based on classes (Charlie Savage)
68
+ * Add in a bunch of new classes including Context, Crs, Coordinate, Ellipsoid, Prime Meridian and Transform (Charlie Savage)
69
+ * Deprecate Projection and Point - these will stop working with Proj 7 since they use an older deprecated API (Charlie Savage)
70
+
71
+ ## 1.0.0 - December 14, 2014
72
+ * Calling this 1.0.0 since its a very stable gem (Charlie Savage)
73
+
74
+ ## 0.4.3 - August 30, 2011
75
+ * Remove reference to now private projects.h header
76
+
77
+ ## 0.4.2 - August 15, 2011
78
+ * Minor build tweak to support MSVC++
79
+
80
+ ## 0.4.1 - July 30, 2011
81
+ * Search first for binaries when using windows gems
82
+ * Add # encoding to test files
83
+ * Reformat tests files to use standard ruby 2 space indenting
84
+
85
+ ## 0.4.0 - July 30, 2011
86
+ * Update to compile on Ruby 1.9.* (Fabio Renzo Panettieri)
87
+ * Add in gemspec file (Charlie Savage)
88
+ * Add rake-compiler as development dependency, remove older MinGW build system (Charlie Savage)
89
+ * Move to GitHub (Charlie Savage)
90
+
91
+ ## 0.3.1 - December 23, 2009
92
+ * Update extconf.conf file to be more flexible to make it easier to build on OS X when using MacPorts
93
+ * Updated windows binary to link against proj4.7
94
+
95
+ ## 0.3.0 - August 14, 2008
96
+ * Removed Proj4::UV class which was previously deprecated
97
+ * New build infrastructure for Windows (Charlie Savage)
98
+ * Fixed memory leaks in forward() and inverse() methods (Charlie Savage)
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in tensorflow-ruby.gemspec
4
- gemspec
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in proj4rb.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # proj4rb
2
+
3
+ Ruby bindings for the [Proj](https://proj.org) coordinate transformation library. The Proj library supports converting coordinates between a number of different coordinate systems and projections.
4
+
5
+ ## Installation
6
+
7
+ Next install the Proj library. This varies per system, but you want to install the latest version possible. Once installed, you'll need to make sure that libproj is on your operating system's load path.
8
+
9
+ Then install the gem:
10
+
11
+ ```console
12
+ gem install proj4rb
13
+ ```
14
+
15
+ ## Quick Start
16
+
17
+ ```ruby
18
+ require 'proj'
19
+
20
+ # Create a transformation between two coordinate systems
21
+ transform = Proj::Transformation.new('EPSG:31467', 'EPSG:4326')
22
+
23
+ # Transform a coordinate
24
+ from = Proj::Coordinate.new(x: 5428192.0, y: 3458305.0, z: -5.1790915237)
25
+ to = transform.forward(from)
26
+
27
+ puts "lat: #{to.x}, lon: #{to.y}"
28
+ ```
29
+
30
+ ## Documentation
31
+
32
+ Full documentation is available at https://cfis.github.io/proj4rb/ including:
33
+
34
+ - [Getting Started](https://cfis.github.io/proj4rb/)
35
+ - [CRS](https://cfis.github.io/proj4rb/crs/)
36
+ - [Coordinate Operations](https://cfis.github.io/proj4rb/coordinate_operations/)
37
+ - [How-To Guides](https://cfis.github.io/proj4rb/examples/)
38
+ - [API Reference](https://cfis.github.io/proj4rb/reference/)
39
+
40
+ ## Environment Variables
41
+
42
+ See [Configuration](https://cfis.github.io/proj4rb/configuration/) for details.
43
+
44
+ - `PROJ_LIB_PATH` - Override the path to the `libproj` shared library.
45
+ - `PROJ_DATA` - Path to the folder containing `proj.db` (Proj 6+). Must be set before Ruby launches.
46
+
47
+ ## License
48
+
49
+ proj4rb is released under the MIT license.
50
+
51
+ ## Authors
52
+
53
+ The proj4rb Ruby bindings were started by Guilhem Vellut with most of the code written by Jochen Topf. Charlie Savage ported the code to Windows, added the Windows build infrastructure, rewrote the code to use FFI and then ruby-bindgen, and updated it to support Proj version 5 through 9.