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
2
votes
2 answers

Convert Polygon to MultiPolygon using RGeo gem

I have a legacy areas data, where some records are in Polygon and some in MultiPolygon format stored in noSQL DB in JSON format. I need to migrate that data to a PostGIS database with area column, which has type of ST_MultiPolygon. So, my question…
nattfodd
  • 1,790
  • 1
  • 17
  • 35
2
votes
1 answer

How to edit GeoJSON data in rails view?

I want to have ability to edit GeoJSON data as text, in edit page. I use Rails, PostgreSQL with activerecord-postgis-adapter. For encoding data I use rgeo-geojson. My show view works fine, I encode: <%= RGeo::GeoJSON.encode(@field.shape,…
2
votes
2 answers

Using activerecord-postgis-adapter and point is not cast as spherical

I'm trying to create a basic app using the activerecord-postgis-adapter gem and am following the instructions in the readme. According to the readme, a point is supposed to use the spherical factory, but I get a CAPIPointImpl type instead of a…
wildrhombus
  • 113
  • 7
2
votes
0 answers

ArgumentError when storing point using RGeo

I'm having some trouble storing a point in RGeo. initializer/rgeo.rb RGeo::ActiveRecord::SpatialFactoryStore.instance.tap do |config| # By default, use the GEOS implementation for spatial columns. config.default = RGeo::Geos.factory_generator …
Ivan
  • 93
  • 1
  • 5
2
votes
1 answer

Storing Google Maps geo data with Rails / PostGIS / RGeo

Having trouble implementing Daniel Azuma's solution for handling Google Maps geo data with RGeo / Rails. SETUP locations table: create_table "locations", force: :cascade do |t| t.string "name", t.geometry "polygon", limit:…
Yarin
  • 173,523
  • 149
  • 402
  • 512
2
votes
1 answer

How to set up a postgis-adaptered Ruby on Rails app for Heroku deployment?

I have the following: Gems: gem 'pg', '~> 0.18' gem 'activerecord-postgis-adapter', '4.0.0' gem 'rgeo-geojson' Initializer: config/initializers/rgeo.rb require 'rgeo-activerecord' RGeo::ActiveRecord::SpatialFactoryStore.instance.tap do |config| …
2
votes
2 answers

polygon 'contains' and other operations on geometries not supported

I'm quite new to postgis and rgeo. I suspect I may be tackling things in the wrong way but I have been a bit surprised to find out a few operations, in particular contains & within, aren't possible on spherical based objects. I have a bunch of…
Conor
  • 775
  • 3
  • 10
  • 23
2
votes
1 answer

Order by Nearest using PostGIS, RGeo, Spatial Adapter

I'm asking this question because the answers I've found in Order by nearest - PostGIS, GeoRuby, spatial_adapter wasn't able to provide a solution. I'm trying to create a controller method that can return the n closest records to a certain record's…
brianbancroft
  • 463
  • 3
  • 17
2
votes
0 answers

RGEo cast error after update Rails

I updated Rails version to 4.2 and then my test are failing when Rgeo gem is used. It seems that there is something wrong with the attributes types on the tables. can't cast RGeo::Geographic::SphericalPointImpl to point Following this link…
matiasdim
  • 527
  • 5
  • 14
2
votes
1 answer

Specify point type for RGeo-ActiveRecord column

there is a typical schema when Address model has an RGeo attribute: t.st_point :coordinates, geographic: true, srid: 4326 and normally it is wrapped in the RGeo::Geographic::SphericalPointImpl…
lessless
  • 866
  • 10
  • 27
2
votes
1 answer

Getting RGeo GEOS support to work in a Rails app deployed to Dokku

I have a rails app that uses the RGeo gem and I'm having a hard time getting the gem to install with support for the underlying GEOS library which my app requires to work properly. Typically you can run RGeo::Geos.supported? from the rails console…
sethdeckard
  • 499
  • 11
  • 24
2
votes
2 answers

natural neighbour interpolation. error in calculating polygon intersection area

I am trying to write this algorithm in R. Does it exist in any package already?!? This is what I did (with help from SO and various blog posts): library(rgdal) library(ggmap) require("maptools") require("plyr") locations<- unique(cbind(data22[,1],…
Irene
  • 744
  • 1
  • 12
  • 36
2
votes
1 answer

lat/long Coordinate insertion with form_for in Rails

I'm using Rails 4.4.1, Ruby 2.1.2, RGeo 0.3.20 and activerecord-mysql2spatial-adapter 0.4.3 My problem is probably very simple since I'm new to both Ruby and Rails, but I could not find anything useful in the web so far. I want to create a form to…
sparviero19
  • 63
  • 2
  • 5
2
votes
1 answer

Rspec model methods return nil when created by let

Ok, so this may seem like a total newbie ask, but when I create an instance of my model with let, for some reason all of the getter methods on it return nil. Here's my example: Model: class Parcel < ActiveRecord::Base extend UUIDHelper …
treznick
  • 25
  • 3
2
votes
1 answer

RGeo: Projecting polygons onto a google map with a different SRID

I have a polygon that represents a school district, which I have imported from NYC Open Data. I believe that the coordinates are in epsg projection 2263 - nad83 / new york long island I am having trouble converting the coordinates to a format usable…
dmanaster
  • 579
  • 1
  • 6
  • 16
1 2
3
8 9