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
…
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…
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…
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…
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,
…
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:
{
…
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…
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…
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…
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…
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…
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 =…
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 -…
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:…