Convert a {@link PolylineOptions} to a {@link LineString}

@param polyline polyline options
@param hasZ     has z flag
@param hasM     has m flag
@return line string
506402
public LineString toLineString(PolylineOptions polyline, boolean hasZ,
                                   boolean hasM) {
        return toLineString(polyline.getPoints(), hasZ, hasM);
    }
94625
public static String lineToString (Point p1, Point p2)
    {
        return lineToString(p1.x, p1.y, p2.x, p2.y);
    }
500689
public static MultiPolyline addPolylinesToMap(GoogleMap map,
                                                  MultiPolylineOptions polylines) {
        MultiPolyline multiPolyline = new MultiPolyline();
        for (PolylineOptions polylineOption : polylines.getPolylineOptions()) {
            if (polylines.getOptions() != null) {
                polylineOption.color(polylines.getOptions().getColor());
                polylineOption.geodesic(polylines.getOptions().isGeodesic());
                polylineOption.visible(polylines.getOptions().isVisible());
                polylineOption.zIndex(polylines.getOptions().getZIndex());
                polylineOption.width(polylines.getOptions().getWidth());
            }
            Polyline polyline = addPolylineToMap(map, polylineOption);
            multiPolyline.add(polyline);
        }
        return multiPolyline;
    }
1045813
private static LinearRing checkLineString(Geometry geometry) throws IllegalArgumentException {
        if (geometry instanceof LinearRing) {
            return (LinearRing) geometry;

        } else if (geometry instanceof LineString) {
            LineString lineString = (LineString) geometry;
            if (lineString.isClosed()) {
                return geometry.getFactory().createLinearRing(lineString.getCoordinateSequence());
            } else {
                throw new IllegalArgumentException("The linestring must be closed.");
            }
        } else  {
            throw new IllegalArgumentException("Only support linestring.");
        }
    }
639524
function translateLine (options, line) {
  const { x, y } = Object.assign({ x: 0, y: 0 }, options || {})
  let segments = line.segments
  let segment = null
  let point = null
  for (let i = 0, il = segments.length; i < il; i++) {
    segment = segments[i]
    for (let j = 0, jl = segment.length; j < jl; j++) {
      point = segment[j]
      segment[j] = [point[0] + x, point[1] + y]
    }
  }
  return line
}
917857
public MultiLineString toMultiLineString(List<Polyline> polylineList,
                                             boolean hasZ, boolean hasM) {

        MultiLineString multiLineString = new MultiLineString(hasZ, hasM);

        for (Polyline polyline : polylineList) {
            LineString lineString = toLineString(polyline);
            multiLineString.addLineString(lineString);
        }

        return multiLineString;
    }
1173542
private static Geometry splitMultiLineStringWithLine(MultiLineString input, LineString cut) {
        Geometry lines = input.difference(cut);
        //Only to preserve SQL constrains
        if (lines instanceof LineString) {
            return FACTORY.createMultiLineString(new LineString[]{(LineString) lines.getGeometryN(0)});
        }
        return lines;
    }
721334
public function render(Polyline $polyline)
    {
        return $this->renderPolylineStyle(
            $polyline->hasStaticOption('styles') ? $polyline->getStaticOption('styles') : [],
            $polyline
        );
    }
18176
def _dump_multilinestring(obj, big_endian, meta):
    
    coords = obj['coordinates']
    vertex = coords[0][0]
    num_dims = len(vertex)

    wkb_string, byte_fmt, byte_order = _header_bytefmt_byteorder(
        'MultiLineString', num_dims, big_endian, meta
    )

    ls_type = _WKB[_INT_TO_DIM_LABEL.get(num_dims)]['LineString']
    if big_endian:
        ls_type = BIG_ENDIAN + ls_type
    else:
        ls_type = LITTLE_ENDIAN + ls_type[::-1]

    # append the number of linestrings
    wkb_string += struct.pack('%sl' % byte_order, len(coords))

    for linestring in coords:
        wkb_string += ls_type
        # append the number of vertices in each linestring
        wkb_string += struct.pack('%sl' % byte_order, len(linestring))
        for vertex in linestring:
            wkb_string += struct.pack(byte_fmt, *vertex)

    return wkb_string
619772
public function line($line = '', $params = null)
    {
        if (empty($params)) {
            return parent::line($line);
        }

        //  We have some parameters, sub 'em in or the unicorns will die.
        $line = parent::line($line);

        if ($line !== false) {

            if (is_array($params)) {

                $line = vsprintf($line, $params);

            } else {

                $line = sprintf($line, $params);
            }
        }

        return $line;
    }
1092009
public static LinearRing convert(LineString lineString,int dimension) {
        return gf.createLinearRing(convertSequence(lineString.getCoordinates(),dimension));
    }
344482
def polyline2pathd(polyline_d, is_polygon=False):
    """"""
    points = COORD_PAIR_TMPLT.findall(polyline_d)
    closed = (float(points[0][0]) == float(points[-1][0]) and
              float(points[0][1]) == float(points[-1][1]))

    # The `parse_path` call ignores redundant 'z' (closure) commands
    # e.g. `parse_path('M0 0L100 100Z') == parse_path('M0 0L100 100L0 0Z')`
    # This check ensures that an n-point polygon is converted to an n-Line path.
    if is_polygon and closed:
        points.append(points[0])

    d = 'M' + 'L'.join('{0} {1}'.format(x,y) for x,y in points)
    if is_polygon or closed:
        d += 'z'
    return d
949307
public function setOptions(PolylineOptions $polylineOptions)
    {
        $options = array_filter($polylineOptions->options);
        $this->options = ArrayHelper::merge($this->options, $options);
    }
1160294
private static Collection<Polygon> polygonWithLineSplitter(Polygon polygon, LineString lineString) throws SQLException {
        Collection<Polygon> polygons = splitPolygonizer(polygon, lineString);
        if (polygons != null && polygons.size() > 1) {
            List<Polygon> pols = new ArrayList<Polygon>();
            for (Polygon pol : polygons) {
                if (polygon.contains(pol.getInteriorPoint())) {
                    pols.add(pol);
                }
            }
            return pols;
        }
        return null;
    }
346817
public function render(Polyline $polyline)
    {
        $result = [];
        $style = $this->polylineStyleRenderer->render($polyline);

        if (!empty($style)) {
            $result[] = $style;
        }

        $result[] = $this->polylineLocationRenderer->render($polyline);

        return implode('|', $result);
    }
49598
public static LineString of(Iterable<Point> points) {
        LinearPositions.Builder positionsBuilder = LinearPositions.builder();
        for(Point point : points) {
            positionsBuilder.addSinglePosition(point.positions());
        }
        return new LineString(positionsBuilder.build());

    }
129603
public CompoundCurve toCompoundCurve(List<Polyline> polylineList,
                                         boolean hasZ, boolean hasM) {

        CompoundCurve compoundCurve = new CompoundCurve(hasZ, hasM);

        for (Polyline polyline : polylineList) {
            LineString lineString = toLineString(polyline);
            compoundCurve.addLineString(lineString);
        }

        return compoundCurve;
    }