@@ -147,6 +147,7 @@ def _compare_bit_exact(cpp_result, py_result, label=""):
147147_OPS_NAMES = {
148148 "centroid_point" , "centroid_linestring" , "centroid_polygon" ,
149149 "project_linestring_point" , "interpolate_linestring" ,
150+ "interpolate_linestring_normalized" ,
150151 "intersection_area_polygon_polygon" ,
151152 "polygon_exterior" ,
152153 "nearest_points" , "nearest_points_ls_pt" ,
@@ -356,6 +357,14 @@ def _call_ops(api_name, cpp, *args, **kwargs):
356357 py_pt = py_ls .interpolate (dist )
357358 return np .array (c_result ), np .array ((py_pt .x , py_pt .y ))
358359
360+ if api_name == "interpolate_linestring_normalized" :
361+ c_ls = _build_cpp_geom (cpp , * geoms [0 ])
362+ py_ls = _build_py_geom (* geoms [0 ])
363+ t = float (extras [0 ]) if extras else 0.5
364+ c_result = cpp .interpolate_linestring_normalized (c_ls , t )
365+ py_pt = py_ls .interpolate (t , normalized = True )
366+ return np .array (c_result ), np .array ((py_pt .x , py_pt .y ))
367+
359368 if api_name == "intersection_area_polygon_polygon" :
360369 c_a = _build_cpp_geom (cpp , * geoms [0 ])
361370 c_b = _build_cpp_geom (cpp , * geoms [1 ])
@@ -879,6 +888,17 @@ def _catalog_ops():
879888 yield _TestCase ("interpolate_linestring" , (ls , dist ), {}, "f64" , tag ,
880889 "bit_exact" , True , None , "ops" )
881890
891+ # -- interpolate_linestring_normalized --
892+ for ls , t , py_t_expected_tag , tag in [
893+ (("ls" , _L_H ), 0.5 , "h_mid" , "h_mid" ), # t=0.5 → midpoint of 10-length horizontal
894+ (("ls" , _L_H ), 0.0 , "h_start" , "h_start" ), # t=0.0 → start
895+ (("ls" , _L_H ), 1.0 , "h_end" , "h_end" ), # t=1.0 → end
896+ (("ls" , _L_V ), 0.5 , "v_mid" , "v_mid" ), # vertical 10-length, t=0.5
897+ (("ls" , _L_3 ), 1.0 , "v3pt" , "v3pt_end" ), # 3-point L, t=1.0
898+ ]:
899+ yield _TestCase ("interpolate_linestring_normalized" , (ls , t ), {},
900+ "f64" , tag , "bit_exact" , True , None , "ops" )
901+
882902 # -- Centroid --
883903 for name , geom , tag in [
884904 ("centroid_point" , ("pt" , (3 , 4 )), "3-4" ),
0 commit comments