rgeo

Installing GEOS on heroku cedar

耗尽温柔 提交于 2020-01-05 03:50:25
问题 we have troubles in installing the GEOS library on heroku cedar stack. We followed this guide: https://devcenter.spacialdb.com/Heroku.html and it didn't work. We noticed that the path (/app/tmp/geos) stored in the provided geos binaries was wrong, so we built our own binaries with vulcan. We changed parameters (BUNDLE_BUILD__RGEO) accordingly, but we weren't able to make it work. We even hardcoded geos paths in our custom rgeo gem without any success We also tried other buildscripts (https:/

NoMethodError using activerecord_postgis_adapter

落花浮王杯 提交于 2020-01-02 07:03:55
问题 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 look like: Location.rb (the model, updated code) # == Schema Information # # Table name: locations # # id :integer not null, primary key # locatable_id :integer # locatable_type :string # created_at :datetime not null # updated_at :datetime not null #

Geos installation in non-standard location

一世执手 提交于 2019-12-23 02:54:38
问题 I'm running on nitrous.io and trying to install the rgeo gem using ruby 2.0.0-p353. I don't have sudo access, so I tried to compile and install geos from source. Once I downloaded and untarred the source files, I cd into the source folder and run mkdir /home/action/local && ./configure --prefix=/home/action/local make && make install This runs for a bit. I then run gem install rgeo -- --with-geos-dir=/home/action/local Things look alright, but if I hop into a terminal I get RGeo::Geos

RGeo on Ruby under Windows: How to enable GEOS support?

≡放荡痞女 提交于 2019-12-22 11:28:37
问题 I'm trying to do some spatial operations in Ruby with the RGeo gem. Unfortunately, a lot of operations require the GEOS library and I can't find any documentation showing how to integrate this in Windows (I am using Windows 7 64bit). I tried downloading and installing the Windows binaries of GEOS from http://trac.osgeo.org/osgeo4w/ and reinstalling the RGeo gem via gem install rgeo -- --with-geos-dir="C:\OSGeo4W64\bin (<< in this directory there is a file geos_c.dll ). Still, using RGeo::Geos

How to express the projection using pure sql?

╄→гoц情女王★ 提交于 2019-12-13 06:01:49
问题 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 ? 回答1: RGeo simple mercator factory docs state that it uses SRID 4326 to store points and SRID 3785 for projections. PostGIS has ST_Transform for that. Here's a nice tutorial covering the topic. Suppose you store your geom field in 'nodes' table and it's in SRID 4326, then

RGeo error attempting to create point from lat/lon

為{幸葍}努か 提交于 2019-12-12 14:05:54
问题 I'm writing an app which I am attempting to integrate some general geolocation functionality including saving some lat/lon coordinates as a point in a database. The intention of this is to allow the user to either use their location (provided by device) or a google map marker to choose their coordinates. I have succeeded at obtaining the coordinates from the map or device, however I am having trouble now creating a point from them to save into the db. I've read the documentation and tried

Add distance to a particular latitude/longitude position

荒凉一梦 提交于 2019-12-12 09:22:08
问题 Rails 4 + Postgres. New to geospatial. Happy to accept solutions that involve RGeo, Geokit, Geocoder, or any other gem that helps solve this issue. Model contains two fields latitude and longitude . I have an offset attribute that contains a distance in meters and an orientation attribute that contains one of the 4 cardinal directions (N, E, W, S). Example: offset: 525.5 orientation: W What's a standard way of adding the offset distance to the lat-long position, to give me a new lat-long pair

Geos installation in non-standard location

孤街浪徒 提交于 2019-12-08 07:15:29
I'm running on nitrous.io and trying to install the rgeo gem using ruby 2.0.0-p353. I don't have sudo access, so I tried to compile and install geos from source. Once I downloaded and untarred the source files, I cd into the source folder and run mkdir /home/action/local && ./configure --prefix=/home/action/local make && make install This runs for a bit. I then run gem install rgeo -- --with-geos-dir=/home/action/local Things look alright, but if I hop into a terminal I get RGeo::Geos.supported? > false Looking back over the mkmf.log file, I see these lines: /usr/bin/ld: cannot find -lgeos

NoMethodError using activerecord_postgis_adapter

末鹿安然 提交于 2019-12-05 12:14:21
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 look like: Location.rb (the model, updated code) # == Schema Information # # Table name: locations # # id :integer not null, primary key # locatable_id :integer # locatable_type :string # created_at :datetime not null # updated_at :datetime not null # coordinates :geography({:srid point, 4326 # class Location < ActiveRecord::Base #self.rgeo_factory

natural neighbour interpolation. error in calculating polygon intersection area

删除回忆录丶 提交于 2019-12-05 04:27:54
问题 I am trying to write this algorithm in R. Does it exist in any package already?!? This is what I did (with help from SO and various blog posts): library(rgdal) library(ggmap) require("maptools") require("plyr") locations<- unique(cbind(data22[,1], data22[,2])) [,1] [,2] [1,] 24.9317 60.1657 [2,] 24.9415 60.1608 [3,] 24.9331 60.1577 [4,] 24.9228 60.1477 [5,] 24.9370 60.1545 [6,] 24.9491 60.1559 [7,] 24.9468 60.1591 [8,] 24.9494 60.1675 [9,] 24.9561 60.1609 [10,] 24.9218 60.1632 [11,] 24.9213