Skip to content

Commit

Permalink
add round trip test for project/ interpolate
Browse files Browse the repository at this point in the history
  • Loading branch information
alibby committed Aug 4, 2017
1 parent 9d5255a commit 6dec66b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/geos_capi/line_string_test.rb
Expand Up @@ -18,6 +18,14 @@ class TestLineString < ::Test::Unit::TestCase # :nodoc:
def setup
@factory = ::RGeo::Geos.factory
end

def test_project_interpolate_round_trip
point = @factory.point(2,2)
line_string = @factory.line_string([ [0,0], [5,5] ].map { |x,y| @factory.point(x,y) })
location = line_string.project_point point
interpolated_point = line_string.interpolate_point location
assert_equal point, interpolated_point
end
end
end
end
Expand Down

0 comments on commit 6dec66b

Please sign in to comment.