Skip to content
Browse files

readme, rakefile, etc

  • Loading branch information...
1 parent 7fdfcbf commit c55dd9471b64c2e09c36960edd34c9ae6e5468fa @igrigorik committed Sep 3, 2010
Showing with 97 additions and 0 deletions.
  1. +26 −0 README.md
  2. +27 −0 Rakefile
  3. +1 −0 VERSION
  4. +43 −0 libgeohash.gemspec
View
26 README.md
@@ -0,0 +1,26 @@
+GeoHash
+=======
+
+FFI Ruby wrapper for [SimpleGeo's libgeohash](http://github.com/simplegeo/libgeohash).
+
+ GeoHash.encode(42.60498046875, -5.60302734375, 5) # => 'ezs42'
+ GeoHash.decode('ezs42') # => {:lat => 42.60498046875, :lng => -5.60302734375}
+ Geohash.neighbors('ezs42) # => ["ezs48", "ezs49", "ezs43", "ezs41", "ezs40", "ezefp", "ezefr", "ezefx"]
+
+What's a GeoHash?
+----------------
+
+Geohash is a latitude/longitude geocode system invented by Gustavo Niemeyer when writing the web service at geohash.org, and put into the public domain. It is a hierarchical spatial data structure which subdivides space into buckets of grid shape.
+Geohashes offer properties like arbitrary precision and the possibility of gradually removing characters from the end of the code to reduce its size (and gradually lose precision).
+
+As a consequence of the gradual precision degradation, nearby places will often (but not always) present similar prefixes. On the other side, the longer a shared prefix is, the closer the two places are.
+
+ - [Wikipedia article](http://en.wikipedia.org/wiki/Geohash)
+ - [GeoHash site](http://geohash.org/site/tips.html)
+ - [JS Demo](http://openlocation.org/geohash/geohash-js/)
+
+Credits
+-------
+
+ - Derek Smith - libgeohash author
+ - Ilya Grigorik - FFI wrapper
View
27 Rakefile
@@ -0,0 +1,27 @@
+require 'rake'
+require 'spec/rake/spectask'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = 'libgeohash'
+ gemspec.summary = 'Ruby FFI wrapper for libgeohash'
+ gemspec.description = gemspec.summary
+ gemspec.email = 'ilya@igvita.com'
+ gemspec.homepage = 'http://github.com/igrigorik/libgeohash'
+ gemspec.authors = ['Ilya Grigorik']
+ gemspec.rubyforge_project = gemspec.name
+ end
+
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts 'Jeweler not available. Install it with: sudo gem install jeweler -s http://gemcutter.org'
+end
+
+task :default => :spec
+
+Spec::Rake::SpecTask.new do |t|
+ t.ruby_opts = ['-rtest/unit']
+ t.spec_files = FileList['spec/**/*_spec.rb']
+end
+
View
1 VERSION
@@ -0,0 +1 @@
+0.1.0
View
43 libgeohash.gemspec
@@ -0,0 +1,43 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{libgeohash}
+ s.version = "0.1.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Ilya Grigorik"]
+ s.date = %q{2010-09-03}
+ s.description = %q{Ruby FFI wrapper for libgeohash}
+ s.email = %q{ilya@igvita.com}
+ s.extra_rdoc_files = [
+ "README.md"
+ ]
+ s.files = [
+ "README.md",
+ "lib/libgeohash.rb",
+ "spec/libgeohash_spec.rb"
+ ]
+ s.homepage = %q{http://github.com/igrigorik/libgeohash}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{libgeohash}
+ s.rubygems_version = %q{1.3.7}
+ s.summary = %q{Ruby FFI wrapper for libgeohash}
+ s.test_files = [
+ "spec/libgeohash_spec.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
+

0 comments on commit c55dd94

Please sign in to comment.
Something went wrong with that request. Please try again.