davetroy / geohash Goto Github PK
View Code? Open in Web Editor NEWImproved Geohash Gem for Ruby
Improved Geohash Gem for Ruby
I know this repo isn't really maintained anymore, but it no longer even installs for new versions of ruby.
Delete this if it's not okay, but I built a new version of a ruby geohash gem backed by a C library.
https://rubygems.org/gems/dynamodb_geo
/Users/patrick/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/bundler/gems/geohash-03d655d5bf92/lib/geohash.rb:22: [BUG] Segmentation fault
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
the more detail of.
-- Control frame information -----------------------------------------------
c:0029 p:---- s:0135 e:000134 CFUNC :encode_base
c:0028 p:0017 s:0129 e:000128 METHOD /Users/patrick/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/bundler/gems/geohash-03d655d5bf92/lib/geohash.rb:22
First, thanks for this useful gem. It simply works!
I installed it some time ago following the instruction in the README, and it worked, but now I have to use Bundler and it doesn't.
The Gemfile contains this line...
gem "geohash", '~> 1.1', :git => "https://github.com/davetroy/geohash.git"
and when "bundle install" is run, the result is...
Using geohash (1.1.1) from https://github.com/davetroy/geohash.git (at master) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c geohash_native.c
geohash_native.c: In function 'encode':
geohash_native.c:123: error: 'struct RFloat' has no member named 'float_value'
geohash_native.c:123: error: 'struct RFloat' has no member named 'float_value'
geohash_native.c: In function 'encode':
geohash_native.c:123: error: 'struct RFloat' has no member named 'float_value'
geohash_native.c:123: error: 'struct RFloat' has no member named 'float_value'
lipo: can't open input file: /var/folders/Eo/EoP8v2DDHw4avD+-wzeu6E+++TI/-Tmp-//cc0DIVD8.out (No such file or directory)
make: *** [geohash_native.o] Error 1
Any idea on how to solve it? I would really appreaciate it.
Thanks in advance.
If we try to generate a geohash from a latitude of 90 or -89.99, it causes a segmentation fault, bringing down Ruby.
I'm curious how you settled on your Base32 alphabet (excluding AILO)? RFC4648 style (excluding 0189) and Crockford (excluding ILOU) seem more standard (per Wikipedia) and have active gem implementations. Might be being thick but I couldn't find a ready-made decoder for your scheme.
Thanks for your time.
Hi,
trying to install gem on ruby 1.9, I got the following error:
Building native extensions. This could take a while...
ERROR: Error installing davetroy-geohash:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -fPIC -O2 -g -Wall -Wno-parentheses -o geohash_native.o -c geohash_native.c
geohash_native.c: In function ‘encode’:
geohash_native.c:123: error: ‘struct RFloat’ has no member named ‘value’
geohash_native.c:123: error: ‘struct RFloat’ has no member named ‘value’
geohash_native.c: In function ‘decode_bbox’:
geohash_native.c:135: error: ‘struct RString’ has no member named ‘ptr’
geohash_native.c: In function ‘decode’:
geohash_native.c:158: error: ‘struct RString’ has no member named ‘ptr’
geohash_native.c: In function ‘calculate_adjacent’:
geohash_native.c:196: error: ‘struct RString’ has no member named ‘ptr’
geohash_native.c:199: error: ‘struct RString’ has no member named ‘ptr’
make: *** [geohash_native.o] Błąd 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/davetroy-geohash-1.1.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/davetroy-geohash-1.1.0/ext/gem_make.out
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.