Questions tagged [rgeo]

RGeo is a geospatial data library for Ruby.

RGeo is a geospatial data library for Ruby.

https://github.com/rgeo/rgeo

121 questions
3
votes
3 answers

Point in polygon rgeo

I need to know if a point is in a polygon or not, in my rails app, in order to to that I wan to use rgeo gem. To install this geme i folowed the instructions on rgeo git Then I'm sure that GEOS and Proj4 are properly installed. I also added this…
Facundo Laxalde
  • 305
  • 5
  • 18
3
votes
2 answers

Installing GEOS on Heroku

I'm trying to deploy a Rails app (ruby 2.3.0, rails 4.2.6) to Heroku that uses the RGeo gem, but I'm having no luck installing the underlying GEOS library upon which the RGeo gem relies (See https://github.com/rgeo/rgeo#dependencies). According to…
Yarin
  • 173,523
  • 149
  • 402
  • 512
3
votes
2 answers

RGeo error attempting to create point from lat/lon

I'm writing an app which I am attempting to integrate some general geolocation functionality including saving some lat/lon coordinates as a point in a database. The intention of this is to allow the user to either use their location (provided by…
3
votes
2 answers

RGeo 0.5.2 and RGeo::CoordSys::SRSDatabase::ActiveRecordTable

First of all, apologies if this is really simple, but I just can't seem to figure it out. I am using RGeo to convert between UTM and lat/long, like this; srs_database = RGeo::CoordSys::SRSDatabase::ActiveRecordTable.new # create the coordinate…
benjimix
  • 609
  • 7
  • 18
3
votes
1 answer

check if 2 polygons overlap in ruby

I'm looking for a way to check if 2 polygons (set of lat/lon coordinates) overlap in ruby. So for example if I have a points for the USA and points for California, I should be able to tell that they overlap. I looked into rgeo, but apparently it…
pguardiario
  • 53,827
  • 19
  • 119
  • 159
3
votes
1 answer

activerecord_postgis_adapter: undefined method `point' for nil:NilClass

Problem 90% sure it's a setup error on my end, but I can't do self.factory and trying to access lonlat gives me an exception "undefined method `point' for nil:NilClass" I can Set lonlat using: mfactory =…
AndHeiberg
  • 1,029
  • 1
  • 10
  • 29
3
votes
1 answer

RGeo on Ruby under Windows: How to enable GEOS support?

I'm trying to do some spatial operations in Ruby with the RGeo gem. Unfortunately, a lot of operations require the GEOS library and I can't find any documentation showing how to integrate this in Windows (I am using Windows 7 64bit). I tried…
Dirk
  • 9,381
  • 17
  • 70
  • 98
3
votes
1 answer

Rails Mongoid geo_near sort by distance

What I'm trying to do is to sort mongoid geo_near(or within_circle) max_distance results by distance because I don't know why but it doesn't do that by default. I have mongoid_geospatial, mongoid_spacial and rgeo in my Rails gem file. I know…
Caner
  • 1,448
  • 23
  • 38
3
votes
2 answers

Installing GEOS on heroku cedar

we have troubles in installing the GEOS library on heroku cedar stack. We followed this guide: https://devcenter.spacialdb.com/Heroku.html and it didn't work. We noticed that the path (/app/tmp/geos) stored in the provided geos binaries was wrong,…
cesidio
  • 35
  • 4
3
votes
1 answer

How to test Rails applications using GIS databases

I'm developing a Rails app (3.2.8) that will use the activerecord-postgis-adapter and activerecord-spatialite-adapater gems and various rgeo plugins. I would like to use the Rails unit and functional tests in the traditional way, but this sort of…
jordanpg
  • 6,386
  • 4
  • 46
  • 70
2
votes
2 answers

How do I find the nearest location in a separate list of coordinates in r?

Given a list of event locations: event.coords <- data.frame( event.id = letters[1:5], lats = c(43.155, 37.804, 26.71, 35.466, 40.783), lons = c(-77.616,-122.271, -80.064, -97.513, -73.966)) and the centroids of locales (which happen to…
conflictcoder
  • 383
  • 1
  • 9
2
votes
2 answers

RGeo::Geos.supported? shows as false even with -dev packages and symlink in place

Trying to get the rgeo gem to recognise geos on an ubuntu 16.04 system. I have the following packages installed:- libgeos-dev, libgeos++-dev and libgeos-3.7.1 geos-config --version 3.7.1 I have a symlink in /usr/lib which points to the location of…
user2099762
  • 173
  • 2
  • 12
2
votes
2 answers

Getting InvalidGeometry: LinearRing failed ring test after upgrading rgeo gem

After upgrading the rgeo gem from 0.6.0 to 2.1.1, we've started to get 'LinearRing failed ring test' on certain geometries that never caused us problems before. (The geometry data is generated from external sources outside of our control, and stored…
Yarin
  • 173,523
  • 149
  • 402
  • 512
2
votes
1 answer

Rails RGeo::Geos.supported? false on rails c, but true on irb

I'm using the rgeo gem which gives me troubles on the production server, although it works on my local machine. This outputs are same on both local MacOS and Ubuntu 16.04 production machine: psql --version -> (PostgreSQL) 9.6.15 geos-config…
2
votes
1 answer

RGeo::GeoJSON not decoding and returning geometry as_text for 'doughnut' polygon

Some geographical regions are areas that surround a major metropolitain city, where each is a distinct administrative area. This is the case of the capitals of Switzerland (de facto) and…
Jerome
  • 5,583
  • 3
  • 33
  • 76
1
2
3
8 9