我是 ruby 新手,正在尝试 rgeo。
我有 2 个 geojson 文件: points.geojson 包含许多点 这里是points.geojson的要点
outline.geojson 包含一个多边形,这是我的outline.geojson的要点:
我想要交叉点(轮廓中包含的点)
这是我正在尝试的...
require 'rgeo'
require 'rgeo/geo_json'
points_str = File.read("points.geojson")
points = RGeo::GeoJSON.decode(points_str, json_parser: :json)
puts points
outline_str = File.read("outline.geojson")
outline = RGeo::GeoJSON.decode(outline_str, json_parser: :json)
puts outline
puts points.intersection outline
我得到的错误:intersection.rb:12:in ': undefined method intersection' for #RGeo::GeoJSON::FeatureCollection:0x294ac44 (NoMethodError)