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
17
votes
1 answer

Deserialize RGeo column as SphericalPointImpl

there is a table with an RGeo column in Rails 4.2.4 and activerecord-postgis-adapter 3.1.2 class CreateAddresses < ActiveRecord::Migration def change create_table :addresses do |t| t.st_point :coordinates, geographic: true, srid: 4326 …
lessless
  • 866
  • 10
  • 27
9
votes
2 answers

ActiveRecord Subquery Inner Join

I am trying to convert a "raw" PostGIS SQL query into a Rails ActiveRecord query. My goal is to convert two sequential ActiveRecord queries (each taking ~1ms) into a single ActiveRecord query taking (~1ms). Using the SQL below with…
Ryan
  • 6,432
  • 7
  • 40
  • 54
8
votes
2 answers

How to create RGeo polygon in Ruby from WKT when the polygon has errors

I'm working with a MySQL database with polygons stored in WKT format. Many polygons in the database have duplicate points (e.g. in the below example, the point -122.323502 47.600959 is repeated three times). When attempting to call…
Jesse Rundle
  • 101
  • 1
  • 5
7
votes
1 answer

NoMethodError using activerecord_postgis_adapter

I tried installing activerecord-postgis-adapter as per the README but am unable to create the model instance as I keep getting the error mentioned below: NoMethodError: undefined method `point' for nil:NilClass Here are what my different files…
geoboy
  • 1,172
  • 1
  • 11
  • 25
6
votes
1 answer

RGeo convex hull of list of points

RGeo has convex hull method available, but no documentation at all in this matter. Given set of Points, how to I find their convex hull?
user3292534
6
votes
1 answer

Ruby on Rails PostGIS - insert a polygon record into DB

I'm using RoR with PostGIS to store locations data. I'm trying to store an estimated location using circle (e.g. center point with radius). I've tried something like that, but it doesn't work: @location = Location.new(:place_id => place.id, …
Asaf
  • 2,158
  • 2
  • 25
  • 40
5
votes
1 answer

RGeo - fix self-intersections

I have a bunch of polygons that have self-intersection which causes some errors in further postprocessing them (in particular - I can't calculate intersection area of those polygons with other polygons). Here is an example of broken polygon: { …
nattfodd
  • 1,790
  • 1
  • 17
  • 35
5
votes
1 answer

RGeo The union of two MultyPolygons is returning nil

I want to create a new MultiPolygon from the union of two geometries, but it returns nil. multipolygon_1 = RGeo::Geos.factory(srid: 4326).parse_wkt("MULTIPOLYGON ...") multipolygon_2 = RGeo::Geos.factory(srid: 4326).parse_wkt("MULTIPOLYGON…
babasbot
  • 113
  • 1
  • 7
5
votes
1 answer

RGeo: proj4 not supported error?

I am new to working with geospatial datam and am working with the Rails RGeo gem. I am getting the following error in my rails console: > geo_shape = ES_Zone::FACTORY.parse_wkt RGeo::Error::UnsupportedOperation: Proj4 is not supported because the…
dmanaster
  • 579
  • 1
  • 6
  • 16
5
votes
0 answers

Rgeo, Mysql and Spatial index error

when trying to run migration to add a spatial index, get Unknown key: spatial/Users/ME/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/core_ext/hash/keys.rb:70:in `block in assert_valid_keys' Using Ruby 2.0.353 Rails…
pcasa
  • 3,710
  • 7
  • 39
  • 67
5
votes
1 answer

RGeo Projected Buffer Polygon too small

I have a rails app that is using rgeo 0.3.19 with proj4 support connecting to a PostGIS 1.5 database with the rgeo-activerecord 0.4.5 gem. My app has a model called Region which contains a geographic point, a radius, and a polygon shape. When a new…
MobileOverlord
  • 4,580
  • 3
  • 22
  • 30
4
votes
1 answer

Simplifying polygons in rgeos and maintaining data in SpatialPolygonsDataFrame

Background I'm interested in simplifying polygons with use of the gSimplify function available through the rgeos package. Reproducible example A reproducible example can be generated with use of the code below: # Data sourcing…
Konrad
  • 17,740
  • 16
  • 106
  • 167
4
votes
2 answers

Problems with RGeo intersection functions

I'm getting strange/incorrect results from RGeo polygon intersection functions (Ruby 2.3.0, RGeo 0.5.3) EXAMPLE 1: I have two polygons which I believe share a boundary but do not share any internal space (i.e. they touch but do not overlap): wkt_1 =…
Yarin
  • 173,523
  • 149
  • 402
  • 512
4
votes
1 answer

Error when running rails app incompatible library version rgeo proj4

When I run foreman start, I get this error: ~/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require': incompatible library version -…
Voska
  • 321
  • 1
  • 3
  • 12
3
votes
3 answers

RStudio graphics device really slow for spatial objects on mac

I recently got a new macbook pro and am having some R graphics related problems on it. R is working insanely slowly when plotting sf objects. I found a thread that's a couple of years old on this issue (here:…
Jake L
  • 987
  • 9
  • 21
1
2 3
8 9