Skip to content

Commit

Permalink
Improvements to line_interpolate_point() docs
Browse files Browse the repository at this point in the history
- Make it more obvious that the distance is in CRS units, not a percentage, on the first example
- Add example that ends up with floating point coordinates
- Add example that returns NULL
  • Loading branch information
kannes authored and nyalldawson committed Aug 21, 2022
1 parent 81ac7eb commit d8d850c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion resources/function_help/json/line_interpolate_point
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
"description": "distance along line to interpolate"
}],
"examples": [{
"expression": "geom_to_wkt(line_interpolate_point(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=5))",
"expression": "geom_to_wkt(line_interpolate_point(geometry:=geom_from_wkt('LineString(0 0, 8 0)'), distance:=5))",
"returns": "'Point (5 0)'"
}, {
"expression": "geom_to_wkt(line_interpolate_point(geometry:=geom_from_wkt('LineString(0 0, 1 1, 2 0)'), distance:=2.1))",
"returns": "'Point (1.48492424 0.51507576)'"
}, {
"expression": "geom_to_wkt(line_interpolate_point(geometry:=geom_from_wkt('LineString(0 0, 1 0)'), distance:=2))",
"returns": "NULL"
}],
"tags": ["distance", "interpolated", "linestring", "point", "specified", "along"]
}

0 comments on commit d8d850c

Please sign in to comment.