JRuby + GeoGit = Awesome
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
spec
.gitignore
.rspec
Gemfile
LICENSE.md
README.md
Rakefile
geogit.gemspec
pom.xml

README.md

Code Climate

geogit-ruby

Use GeoGit in your JRuby applications

NOTE: JRuby is required

In development: mvn clean install to get Java/Scala dependencies

jruby -S rake console or bin/geogit_console to open IRB with geogit loaded

Import a repo from GitHub (with history):

NOTE: Some repos fail due to to inconsistencies in GeoJSON files and strict processing of GeoJSON in GeoTools

# without a client_id / client_secret, you will be severely rate limited
# ability to import github repos may be affected
GeoGit.configure do |c|
  c.github = {
    client_id: 'yourclientid',
    client_secret: 'yourclientsecret'
  }
end

GeoGit.import_github_repo 'username/reponame'

Create a repo and import a shapefile:

GeoGit.create_or_init_repo '~/Desktop/test_repo'
GeoGit.import_shapefile '~/Desktop/test_repo', '~/Desktop/states/states.shp'
# => ["states"]

#GeoGit.import_geojson '~/Desktop/test_repo', '~/Desktop/states/states.geojson'

To execute a command (get log for previously imported repo):

repo = GeoGit::Repository.new '~/Desktop/test_repo'
# => #<GeoGit::Repository:0x392de91e @repo_path="~/Desktop/test_repo">
log = repo.log
# => {:count=>49, :commits=>[{:id=>"b0524c80b72cf3a7a13ed1edf7114156bae95a3b", :message=>"imported_states/1", :author=>{:name=>"", :email=>""}, :committer=>{:name=>"Scooter Wadsworth", :email=>"scooterwadsworth@gmail.com"}}, {:id=>"838d69be61caffb629373ed9a44a417e5f2b1bfd", :message=>"imported_states/2", :author=>{:name=>"", :email=>""}, :committer=>{:name=>"Scooter Wadsworth", :email=>"scooterwadsworth@gmail.com"}}, ...}

CONTRIBUTORS

milafrerichs (https://github.com/milafrerichs)