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
1
vote
1 answer

Try to use Rgeo with rails

I'm a newbie on rails and tried using Rgeo and GeoJSON. I want to extract GeoJSON from my data to use in leaflet. What is the proper way to install GeoJSON (and/or place). Gemfile : gem 'activerecord-postgis-adapter' gem 'rgeo-geojson' gem…
Ben
  • 660
  • 5
  • 25
1
vote
1 answer

How to output geojson from a collection

I want to output a geojson file from my rails app using rgeo-geojson. I have a table of points each with lat and long. I have my controller set up in the standard way respond_to do |format| format.html format.csv { send_data…
Will
  • 4,498
  • 2
  • 38
  • 65
1
vote
1 answer

I want to save GeoJSON polygon

I want to save a polygon. This is Geojson enter link description here str1 = "geojson....." geom = RGeo::GeoJSON.decode(str1, json_parser: :json) l = Limit.new l.multipoligono = geom l.save NoMethodError: undefined methodfactory' for…
hguzman
  • 311
  • 5
  • 15
1
vote
0 answers

How to save google.maps.Data.MultiPolygon to geometry datatype column in postgres database in rails?

I am a beginner in rails framework, so please pardon my naive question. I have a google.maps.Data.MultiPolygon object on my frontend which I want to save in my database. The table searches creates a new entry everytime a user searches, contains…
psr
  • 2,619
  • 4
  • 32
  • 57
1
vote
0 answers

R polygons within boundaries

I am trying to get all polygons that are within leaflet map boundaries. No need to bother about leaflet, the question is more about rgeos or other methods (or primarily about correct function). I tried variety of methods and they work OK if shapes…
Slav
  • 469
  • 4
  • 18
1
vote
1 answer

Heroku: error for PostGIS column in web dyno but not in one-off or worker dynos

I've got the beginnings of a spatial app (PostGIS + Rails + RGeo) with a single line_string column on one of my models. On my local machine everything is good, the problem is on Heroku web dynos, where Rails/activerecord doesn't recognise the…
iftheshoefritz
  • 5,829
  • 2
  • 34
  • 41
1
vote
2 answers

How to rewrite this RGeo query using AR/Arel?

I have the following scope I've gotten to work with raw SQL: class DeliveryZone < ActiveRecord::Base def self.contains(addressable) point = addressable.lonlat where(<<-SQL.squish) ST_Intersects("delivery_zones"."shape",…
neezer
  • 19,720
  • 33
  • 121
  • 220
1
vote
2 answers

Issues with Postgis 2.2.0 and Postgres 9.4.5: PG::UndefinedFile - ERROR: could not access file "$libdir/postgis-2.1"

I, unfortunately, upgraded to postgis to 2.2.0 via homebrew and am now getting the errors below. I would go back to 2.1.0 but the formula doesn't seem to be available anymore. Going to 2.0 tries to downgrade Postgres to 9.2. Any thoughts on what…
geoboy
  • 1,172
  • 1
  • 11
  • 25
1
vote
1 answer

Methods of overcoming "ActiveRecord::StatementInvalid: PG::AmbiguousFunction" in rails or sql. (st_intersects is not a unique function name)

When I run this command in rails: CensusBlockGroup.where{st_interects(:the_geom, buffer)} which runs this command in SQL: SELECT "census_block_groups".* FROM "census_block_groups" WHERE (st_intersects("census_block_groups"."proj_shape_3361",…
boulder_ruby
  • 38,457
  • 9
  • 79
  • 100
1
vote
1 answer

Optimisation of writing join table records

The application is based on PostGIS and stores data using RGeo's simple_mercator_factory. Polygon records are created and associations with points are static (i.e. don't need updating). To reduce overhead on postGIS calculations, it makes sense to…
Jerome
  • 5,583
  • 3
  • 33
  • 76
1
vote
1 answer

activerecord-postgis-adapter returns string instead of geometry after saving the record

I'm having an issue when retrieving the value of a geometry column from the database. I save an RGeo::Cartesian::PolygonImpl instance, reload the record, and when I retrieve the value, I get a String instead of a Geometry. My config/database.yml…
Ruy Diaz
  • 3,084
  • 24
  • 36
1
vote
1 answer

Converting strange lat/lng format to decimal

I have a device reporting its position to me in a format they describe as 'ddmm.mmmm' it looks like this: Latitude: 5108.5837 N Longitude: 00052.6334 E Anyone have an idea how I can convert this to a normal decimal number that I can use with RGeo?
Michael Baldry
  • 1,990
  • 2
  • 14
  • 28
1
vote
0 answers

POINT returning nil with activerecord-postgis-adapter on Heroku

I'm using activerecord-postgis-adapter to save (latitude, longitude) values as POINTs. Points are saved using the following syntax: POINT( lat lng). My model, Foo, has an attribute spot, where the POINT is saved. When deployed to Heroku, spot is…
s1ack3rhack3r
  • 319
  • 2
  • 12
1
vote
1 answer

Find radius from centroid

I'm converting a KML file to a polygon stored on my database thanks to RGeo I need the centroid: @area.centroid and I would like to find the approximative radius on my shape. I don't know if it's possible. My database field is a geometry. That means…
brcebn
  • 1,571
  • 1
  • 23
  • 46
1
vote
0 answers

Rgeo geom nil on production server

I've got a really weird bug that I hope someone here can help with. I've imported a shape file into my rails postgis database. It contains the following columns: search source search2 dups geom The geom column contains an RGeo MultiPolygon…
CaptCheech
  • 85
  • 2
  • 10
1 2 3
8 9