Closed kapitan-iglu closed 3 years ago
I just discovered weird behavior of line_segment() when used with MultiLineString:
line_segment()
from turfpy.misc import line_segment from json import dumps mls = { "type": "Feature", "properties": {}, "geometry": { "type": "MultiLineString", "coordinates": [ [ [51,47], [51,43] ], [ [45,47], [45,43] ] ] } } print(dumps(line_segment(mls), indent=4))
result contains only first segment:
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [51,43], [51,47] ] }, "properties": {}, "bbox": [51,43,51,47], "id": 0 } ] }
If I add return True on line misc.py:157 to let iterate over all features (instead of stopping after first feature), line_segment() returns correct result...
return True
Is it bug or feature?
I just discovered weird behavior of
line_segment()
when used with MultiLineString:result contains only first segment:
If I add
return True
on line misc.py:157 to let iterate over all features (instead of stopping after first feature),line_segment()
returns correct result...Is it bug or feature?