Hi, Adam thanks for the reply and detailed code and
explanation. Yes, it worked.
I implemented as per your instructions but encountered a
small problem. That is sometimes I realized the intersections
points between the linestrings and the polygon are not in a
"consistent" order, e.g. as shown in the below image,
lingstring 1 has P1->P2; However, instead of P3->P4,
linestring 2 is P4->P3. I actually expect linestring 2 is
also along P3->P4 direction. Is this how it is supposed to
be? Any workaround to solve this problem? Thanks.