Project

proj4rb

0.02
No release in over a year
Ruby bindings for the Proj coordinate transformation library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
>= 0

Runtime

>= 0
 Project Readme

proj4rb

Ruby bindings for the Proj coordinate transformation library. The Proj library supports converting coordinates between a number of different coordinate systems and projections.

Installation

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.

Then install the gem:

gem install proj4rb

Quick Start

require 'proj'

# Create a transformation between two coordinate systems
transform = Proj::Transformation.new('EPSG:31467', 'EPSG:4326')

# Transform a coordinate
from = Proj::Coordinate.new(x: 5428192.0, y: 3458305.0, z: -5.1790915237)
to = transform.forward(from)

puts "lat: #{to.x}, lon: #{to.y}"

Documentation

Full documentation is available at https://cfis.github.io/proj4rb/ including:

Environment Variables

See Configuration for details.

  • PROJ_LIB_PATH - Override the path to the libproj shared library.
  • PROJ_DATA - Path to the folder containing proj.db (Proj 6+). Must be set before Ruby launches.

License

proj4rb is released under the MIT license.

Authors

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.