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

Use KML to generate geometry

I'm asking if someone has already done the following description. I don't even know if it's possible. I would like to use a KML file to generate a polygon recorded on my PostgreSQL database (with PostGIS).
brcebn
  • 1,571
  • 1
  • 23
  • 46
2
votes
2 answers

RGeo: spatial data in fixtures

I've got a model containing a location attribute, represented by a RGeo::Cartesian::Point object, and stored in my database as spatial data. In order to run tests, I need to create some samples of such a model through fixtures. I tried several…
Miotsu
  • 1,776
  • 18
  • 30
2
votes
1 answer

Point belonging to which Polygon

I'm trying to find out which Region (Polygon) a certain point resides in. I'm trying to follow Daniel Azuma's RubyConf2012 Geospatial analysis screencast. The following code always returns nil: Region.where{st_contains(poly,…
Ben G
  • 128
  • 2
  • 14
2
votes
2 answers

INSERTs and UPDATEs in ruby/rails using PostgreSQL functions

I'm using activerecord-postgis-adapter and squeel in a geo oriented application. Fetching data using various queries based on find and where is working fine and squeel allows me to use PostgreSQL/PostGIS functions to query based on spatial functions…
averas
  • 545
  • 1
  • 6
  • 15
1
vote
0 answers

testing projects that use RGeo on GitHub Actions

For a project that uses RGeo, I can't for the life of me find the magic combination to get it to work on GitHub Actions. Please answer if you've actually got it working on GitHub Actions. Gemfile ... gem…
jnicho02
  • 2,567
  • 1
  • 15
  • 10
1
vote
1 answer

rgeo: distance calculation between a point and a line

I am working on a hotel application (using ruby on rails), and I am trying to calculate the distance between an hotel and the sea. I have gathered the geometry of the shoreline points in a geojson file and I am now trying to calculate the distance…
Quentin Gaultier
  • 279
  • 6
  • 16
1
vote
0 answers

Multi_line_string stay nil after update

I added a multi_line_string field in my database : t.geometry "zmpath", limit: {:srid=>4326, :type=>"multi_line_string", :has_z=>true, :has_m=>true} If I update my table by pgAdmin, the result is persisted but the field stay empty on my update…
Ben
  • 660
  • 5
  • 25
1
vote
1 answer

rgeo point near MULTILINESTRING

Having a geometry column wkb_geometry, srid 4326 that is a MULTILINESTRING I would like to determine which of these records are within a predetermined distance (say 5000m) of a geometry object POINT while the following method allows to determine if…
Jerome
  • 5,583
  • 3
  • 33
  • 76
1
vote
2 answers

Is it possible to Azimuthal equidistant projection and create a buffer polygon in Ruby

I have found this code in stack overflow to do Azimuthal equidistant projection and create a buffer polygon in Python. aeqd_proj = '+proj=aeqd +lat_0={lat} +lon_0={lon} +x_0=0 +y_0=0' project = partial( pyproj.transform, …
Sunil
  • 3,424
  • 2
  • 24
  • 25
1
vote
1 answer

RGeo: How to transform a projected coordinate to lat/lon using SRID

I'd like to transform a point in projected coordinates to lat/lon. I've read this blog post about transformations and I came up with the following code: factory_25831 = RGeo::Cartesian.factory(:srid => 25831) point_25831 =…
elkarel
  • 723
  • 2
  • 7
  • 20
1
vote
1 answer

Find polygons contained inside polygon using RGeo, PostGIS and ST_Contains

I have two models: Search (geom saved on attribute area) and Land (geom saved on attribute geom). Land is imported from an external service and is saved to DB with specific SRID. EG: SRID=28992;POLYGON((84078.122 444751.117,84076.78…
Glenn
  • 540
  • 1
  • 4
  • 16
1
vote
1 answer

RGeo::Geos.supported? true in irb but false with bundler in macOS mojave

In macOS mojave gem install rgeo installs and in irb RGeo::Geos.supported? returns true Now after doing bundle install and going to rails console via bundle exec rails c, it returns false. How to resolve this issue with bundler and rgeo geos…
millisami
  • 9,931
  • 15
  • 70
  • 112
1
vote
0 answers

How to separate POLYGONS from MULTIPOLYGON in Ruby

I was checking RGeo and did not find a way to check if a provided data in a GeoJSON in MultiPolygon is a inner ring or exterior ring (I was checking this to just separate out MultiPolygon into separate polygons from a MultiPolygon. Is there a direct…
ZZzzZZzz
  • 1,800
  • 3
  • 29
  • 51
1
vote
1 answer

How to find the Closest point of a line string to a given location - rgeo

My point coordinates are in geographic coordinate systems. They are in memory. I need to find the nearest point on the line string to a given point using RGeo library from Ruby. My scenario is the points are drawn in googlemap as polyline as road…
channa ly
  • 9,479
  • 14
  • 53
  • 86
1
vote
2 answers

Rails / PostGIS / RGeo Error: NoMethodError: undefined method `factory' for RGeo::GeoJSON::Feature

I am using Ruby on Rails and PostGIS to store GeoJSON map data in a model called, "Map". When I save an object loaded successfully with a simple GeoJSON feature I get the error, "NoMethodError: undefined method `factory' for #". See below for…
1 2 3
8 9