rgeo

natural neighbour interpolation. error in calculating polygon intersection area

老子叫甜甜 提交于 2019-12-03 20:30:36
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 60.1605 [12,] 24.9219 60.1557 [13,] 24.9208 60.1704 [14,] 24.9233 60.1714 [15,] 24.9469 60.1737 [16,] 24

activerecord_postgis_adapter: undefined method `point' for nil:NilClass

半腔热情 提交于 2019-11-30 19:55:43
问题 Problem 90% sure it's a setup error on my end, but I can't do self.factory and trying to access lonlat gives me an exception "undefined method `point' for nil:NilClass" I can Set lonlat using: mfactory = RGeo::ActiveRecord::SpatialFactoryStore.instance.factory(:geo_type => 'point') self.lonlat = mfactory.point(long, lat) self.save This gives me values like 0101000020E610000061C3D32B65965DC03657CD7344F64040 in the db. I can't use: self.lonlat = "POINT(#{long},#{lat})" self.save Questions Do I