GithubHelp home page GithubHelp logo

svilenkov / gdal-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhm/gdal-ruby

0.0 2.0 0.0 398 KB

GDAL/OGR bindings for ruby

License: BSD 3-Clause "New" or "Revised" License

Ruby 0.46% Makefile 0.01% C++ 94.83% C 4.70%

gdal-ruby's Introduction

gdal-ruby Build Status

Native bindings for GDAL/OGR for ruby. The GDAL repository contains ruby bindings in the swig/ruby directory, but they aren't compiled or installed with default installations of GDAL. In addition to not typically being installed, the GDAL build system places the files in a global ruby directory which can cause some problems since it's not the way other ruby libraries are typically installed. This gem simply turns the ruby bindings from the GDAL repo into a gem which can be easily managed like all of the other dependencies in your application. This simplifies the process of being able to switch between versions of ruby and use bundler to manage the extension. Also this gem enables you to install GDAL from the standard package managers that don't include the ruby bindings.

Installation

You will first need to install GDAL. There are several ways to install it, but the easiest way is using a package manager.

OS X:

brew install gdal

Ubuntu:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal-dev

Add this line to your application's Gemfile:

gem 'gdal'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gdal

Installing on Mac using The Framework way GDAL :

  • Download and install GDAL Complete dmg from kyngchaos.

  • Export path export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH in your bash or zsh profile

  • Verify the installation gdal-config --version

  • Install the gem using:

    $ gem install gdal -- --with-gdal-lib=/Library/Frameworks/GDAL.framework/unix/lib --with-gdal-includes=/Library/Frameworks/GDAL.framework/Versions/Current/Headers/

Usage

To test it out:

$ ruby -e "require 'gdal-ruby/ogr'; puts Gdal::Ogr.create_geometry_from_wkt('POINT (30 10)').export_to_json"

The best documentation for right now is the autotest code in the GDAL source tree. You can see various patterns for accessing files and using the OGR API from the autotest sources.

License

This gem is BSD. The .c and .cpp files in the ext/gdal-ruby directory are from GDAL. For more info, See ext/gdal-ruby/LICENSE or visit gdal.org.

gdal-ruby's People

Contributors

rohitrox avatar zhm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.