RGeo/JRuby/Heroku ?

203 views
Skip to first unread message

SimonS

unread,
Aug 10, 2013, 10:37:20 PM8/10/13
to rgeo-...@googlegroups.com
All

What does it take to get this combination running. I've be forced to JRuby (1.7.4, running in Ruby 2.0.0 compatibility mode) due to my concurrency requirements (and using Celluloid).

Per some comments from Daniel, it seems sensible to use JTS (native Java) but find little on how to set that up. Is there any documentation on this anywhere (nothing much from an extensive Google search) ?

I detect that Geos is a C++ library, and conventional its sees that using external C++ libraries from JRuby is not recommended; but if that is my only option.

From a local/development perspective (OSX) I added both ffi-geos and ffi-proj4 to my gemfile and performed the obligatory bundle install. If I fire up the console I get

jruby-1.7.4 :001 > require 'rgeo'
 => true
jruby-1.7.4 :002 > RGeo::Geos.supported?
 => true
jruby-1.7.4 :003 > RGeo::CoordSys::Proj4.supported?
 => false
jruby-1.7.4 :004 >

I'm not sure i "need" Proj4 as I don't expect to be translating between projections ? What diagnostics do I need to resolve this ?

I already have a Heroku custom build pack for JRuby, so adding a second is going to be a challenge to get the Geos libraries installed...(hence the preference to leverage JTS)!

Any and all help greatly appreciated
-Simon

SimonS

unread,
Aug 10, 2013, 10:42:47 PM8/10/13
to rgeo-...@googlegroups.com
Additionally, I als plan to use RGeo standalone (in memory), and then persist data via Mongid ( guessing this gem might help https://github.com/kristianmandrup/mongoid_geospatial)

SimonS

unread,
Aug 11, 2013, 3:07:49 AM8/11/13
to rgeo-...@googlegroups.com
I found this build pack

https://github.com/cyberdelia/heroku-geo-buildpack (via multi-buildpack) that seems to install the GROS, PROJ4 and GDAL libraries in to the Heroku App environment

With these settings in the environment (running 'env' inside a terminal after running 'heroku run bash'):

LIBRARY_PATH=/app/vendor/geos/3.3.8/lib:/app/vendor/gdal/1.10.0/lib:/app/vendor/proj/4.8.0/lib
LD_LIBRARY_PATH=/app/vendor/geos/3.3.8/lib:/app/vendor/gdal/1.10.0/lib:/app/vendor/proj/4.8.0/lib
PROJ4_LIBRARY_PATH=/app/vendor/proj/4.8.0/lib
GDAL_LIBRARY_PATH=/app/vendor/gdal/1.10.0/lib
GEOS_LIBRARY_PATH=/app/vendor/geos/3.3.8/lib

GDAL_DATA=/app/vendor/gdal/1.10.0/share/gdal

CPATH=/app/vendor/geos/3.3.8/include:/app/vendor/gdal/1.10.0/include:/app/vendor/proj/4.8.0/include

However if I fire up a console on heroku, "require 'rgeo'" returns false.

Message has been deleted

SimonS

unread,
Aug 11, 2013, 5:07:44 PM8/11/13
to rgeo-...@googlegroups.com
Given the buildpack usage above, I believe I have Geos working on Heroku, as from a heroku run rails console that although require 'rgeo' returns false, a request to RGeo::Geos.supported? returns true.

However is I run RGeo::CoordSys::Proj4.supported? it returns false.

I see a comment in the gem README.rdoc saying "Proj4 support is expected in the future." it seems that ffi-proj4 is available; but see that it is not referenced in the RGeo code base. Are there any plans to make this integration point work ?

Given perhaps my novice understanding, and a correction to an earlier comment, it seems it maybe a requirements for me to get this working if I'm to be able to create projection of my data that is compatible with Google maps ?

Mauricio Giraldo

unread,
Jul 28, 2014, 3:24:06 PM7/28/14
to rgeo-...@googlegroups.com
Hi

This has not worked for me. I still keep getting RGeo::Geos.supported? false. I am using the multi-buildpack. Do I need to set those env vars via heroku config:add before pushing?

Any help will be appreciated!
Reply all
Reply to author
Forward
0 new messages