I am using Rails 4.2 with PostGIS, rgeo and the activerecord-postgis-adapter gem on Ubuntu. I have also installed the following libraries: libgeos++-dev libgeos-3.4.2 libgeos-c1 libgeos-dbg libgeos-dev libgeos-doc libgeos-ruby1.8 ruby-geos. An…
I don't know whether this is some interaction inside my code, or perhaps naming conventions inside the shapefiles I'm using, but the following code results in a Stack level too deep message
def read_shapefile
@shp_path = Dir[File.join( @tmp_path,…
The following query runs fine as raw sql, but because it hits 2 models, I'm not sure how construct it in active record...
sql = "SELECT spots.*
FROM spots, areas
WHERE areas.area = '#{@area.area}'
AND…
Trying to make this example of uploading a shapefile work with my rails setup and, running from the console, i get returned with:
RGeo::Error::RGeoError: GEOS is not available, but is required for correct interpretation of polygons in…
We're using the Postgis adapter with Ruby on Rails, and we're trying to use Puma on Heroku for our production environment. Our test pass flawlessly on the development system. Also, the server works perfectly on every production server but Heroku,…
I am working with Geo Spatial coordinates and was testing my coding in rails console
Looks like it is changing my longitude to -90.0 instead of what it should be -93.291557312011719
Any help would be appreciated.. tried it with just…
I have a project with PostGIS integration through RGeo gem. Rails 4, ruby 2.1.
RGeo has standard method contains? which checks is point is located in polygon. Everything is fine in development (on MacOS X). But when I push my code to production…
I'm using postgis 9.1 and rgeo to develop an map application.
One of the features implies that I find all points that are XXX kms from the current point, and are also on the right of the Point.
I tried with the following query:
Environment.where{…
We are using rails (4.0.4), ruby (2.0.0p247) and activerecord-postgis-adapter (0.6.5) and singular table names set in ./config/environment.rb (ActiveRecord::Base.pluralize_table_names = false)
This works great in development and test environments.…
I'm working with Rails 3.2 and MySQL.
I installed the gems:
gem 'rgeo', '0.3.20'
gem 'rgeo-activerecord', '0.4.6'
gem 'activerecord-mysql2spatial-adapter', '0.4.3'
all other requirements and dependencies are met, or at least I think so.
Yet,…
I'm using PostGIS on ruby/rails, and have created a simple box-like polygon under which I wish to search for land parcels in a county. The st_overlaps tool has worked for this before and it has worked this time, sort of.
So I created the polygon to…
I have a file I'm trying to open in a Rails application. For some reason Ruby is splitting the name of the file.
For example:
root = Rails.root
path = root.join('lib/tasks/filename.shp')
puts path
What is output is /lib/tasks/filename/shp.
Then I…
My setup:
Ruby 2.0.0
Rails 3.2.12
most recent pg gem
most recent activerecord-postgis-adapter gem
most recent rgeo-geojson gem
Postgres 9.1.6
PostGIS 2
I've asked something similar a few days ago. (Need to convert a Boolean from Postgres (==…
I have used
RGEO_FACTORY = RGeo::Geographic.simple_mercator_factory
RGEO_FACTORY.point(lon, lat).projection
But now I want to use sql to implement it. And I have the point(geometry) in the postgis database.
How should I do ?