code: public LineString toLineString(Polyline polyline, boolean hasZ, boolean hasM) {
          return toLineString(polyline.getPoints(), hasZ, hasM);
      }
docs: Convert a {@link Polyline} to a {@link LineString}
  
  @param polyline polyline
  @param hasZ     has z flag
  @param hasM     has m flag
  @return line string