I am integrating PostGIS in a rails application and following their documentation https://github.com/rgeo/activerecord-postgis-adapter.
At this step
rake db:create
I get the following error.
ActiveRecord::StatementInvalid: PG::SyntaxError: ERROR:…
I am new to ruby and experimenting with rgeo.
I have 2 geojson files:
points.geojson contains a number of points
here is a gist of points.geojson
outline.geojson contains a single polygon
here is a gist of my outline.geojson:
I want the intersection…
In R, I have polygon layer A and point layer B. Both have the same number of features, there is one-to-one correspondence (pairing): each polygon of the layer A has a corresponding point in layer B and vice versa.
How do I compute pairwise distances…
I need to execute the PostGIS function st_intersection within an SQL SELECT clause in Ruby. At the moment I am doing it as raw SQL query:
sql_query = "SELECT id, ST_ASEWKT(ST_INTERSECTION(geometry, ?)) FROM trips WHERE…
So I'm trying to get up to speed on location based programming in Rails for a project. In summary, my database data appears to be correct, but I can't get the rails in-memory logic to get correct results.
I have created a lonlat column in my…
When using rasterToPolygons within the raster package each cell that meets the formula criteria becomes its own polygon:
library(raster)
r <- raster(nrow=18, ncol=36)
r[] <- runif(ncell(r)) * 10
r[r>8] <- NA
pol <- rasterToPolygons(r,…
I need to find all the instances of a class Place where its polygon attribute contains a point supplied, as in Place.for_point(pt).
==== added ====
Ok, I can get this query to execute, but with the wrong result:
Place.all.where("ST_Contains(poly,…
I am using the rgeo and rgeo-shapefile gems in my Rails 5 application. My goal is to load in a shapefile of neighborhoods and determine which neighborhood a latitude/longitude point is located within.
In their documentation they have this…
I am using the rgeo ruby library to parse out geojson polygons. The behavior is to return nil when calling decode on a polygon with duplicate points as in the following example:
geom = {:geom=>{"type"=>"Polygon", "coordinates"=>[[[-82.5721,…
I use rgeo and activerecord-postgis-adapter gem. I want to find all records where special point is included in polygon. I marked rectangular on google map and expect that sql return row if point is inside and does not return row when point is…
So I'm running rgeo with activerecord-postgis-adapter and have a Rails 4 app's db.yml file set up correctly.
But when I set the attributes of a ActiveRecord model like:
Place
.create(name: 'some name', geom: RGeo::Geographic.spherical_factory(:srid…
I am trying to get my RoR app up and running on Elastic Beanstalk and am struggling to get the rgeo gem working. The error I am getting on the web server is:
I, [2015-09-28T11:26:54.982049 #21789] INFO -- : Completed 500 Internal Server Error…