Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEOS is not available, but is required for correct interpretation of polygons in shapefiles in rails console on OS X #25

Closed
wuliwong opened this issue Dec 11, 2017 · 2 comments

Comments

@wuliwong
Copy link

wuliwong commented Dec 11, 2017

When I attempt:

I am running:

os-x "High Sierra" 10.13.2
ruby 2.4.0p0
ruby on rails (5.1.1)
rgeo-shapefile (0.2.3)
dbf (3.1.1)
rgeo (1.0.0)
geos (3.6.2) which installed via brew install geos

In a rails console when I run the example

require 'rgeo/shapefile'

RGeo::Shapefile::Reader.open('my_shapefile.shp') do |file|
  puts "File contains #{file.num_records} records."
  file.each do |record|
    puts "Record number #{record.index}:"
    puts "  Geometry: #{record.geometry.as_text}"
    puts "  Attributes: #{record.attributes.inspect}"
  end
  file.rewind
  record = file.next
  puts "First record geometry was: #{record.geometry.as_text}"
end

I receive the output

File contains 83 records.
RGeo::Error::RGeoError: GEOS is not available, but is required for correct interpretation of polygons in shapefiles.

'my_shapefile.shp' was a Zillow neighborhood file for Georgia.

Additional note is if I open irb in a directory other than this rails app and run:

require 'rgeo'
RGeo::Geos.supported?

it returns true

Running the same commands in irb inside the rails app root directory returns false.

@wuliwong
Copy link
Author

I was able to solve the problem by uninstalling rgeo then running

ARCHFLAGS="-arch x86_64" gem install rgeo

@teeparham
Copy link
Member

Seems like this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants