((x y, ...), ...)

@param WKTParser        $parser
@param CoordinateSystem $cs

@return Polygon
778950
private function readPolygonText(WKTParser $parser, CoordinateSystem $cs) : Polygon
    {
        $rings = $this->readMultiLineString($parser, $cs);

        return new Polygon($cs, ...$rings);
    }
943744
def wkt_polygon(value):
    
    points = ['%s %s' % (lon, lat) for lon, lat, dep in coordinates(value)]
    # close the linear polygon ring by appending the first coord to the end
    points.append(points[0])
    return 'POLYGON((%s))' % ', '.join(points)
72820
public function shape($type, $coordinates, array $options = [])
	{
		$parameters = [
			'coordinates' => $coordinates
		];

		$parameters = array_replace_recursive(
			$this->options,
			$parameters,
			$options
		);

		switch ($type) {
			case 'polyline':
				$this->shapes[] = new Polyline($parameters);
				break;
			case 'polygon':
				$this->shapes[] = new Polygon($parameters);
				break;
			case 'rectangle':
				$this->shapes[] = new Rectangle($parameters);
				break;
			case 'circle':
				$this->shapes[] = new Circle($parameters);
				break;
		}

	}
668481
public static function fromParser(SeasonListItemParser $parser): self
    {
        $instance = new self();
        $instance->year = $parser->getYear();
        $instance->seasons = $parser->getSeasons();

        return $instance;
    }
85644
private function buildFromParser(SwaggerParser $parser)
    {
        $context = new DeserializationContext();

        $context->setVersion(
            $parser->getVersion()
        );

        return $this->serializer->deserialize($parser, Swagger::class, 'json', $context);
    }
224589
private function readPoint(WKBBuffer $buffer, CoordinateSystem $cs) : Point
    {
        $coords = $buffer->readDoubles($cs->coordinateDimension());

        return new Point($cs, ...$coords);
    }
18574
private function readLineString(WKBBuffer $buffer, CoordinateSystem $cs) : LineString
    {
        $numPoints = $buffer->readUnsignedLong();

        $points = [];

        for ($i = 0; $i < $numPoints; $i++) {
            $points[] = $this->readPoint($buffer, $cs);
        }

        return new LineString($cs, ...$points);
    }
965201
public function parse(Parser $parser)
    {
        $parser->match(Lexer::T_IDENTIFIER);
        $parser->match(Lexer::T_OPEN_PARENTHESIS);
        $this->first = $parser->ArithmeticPrimary();
        $parser->match(Lexer::T_AS);
        $parser->match(Lexer::T_IDENTIFIER);
        $this->second = $parser->getLexer()->token['value'];
        $parser->match(Lexer::T_CLOSE_PARENTHESIS);
    }
1059227
protected function factor()
    {
        $combinator = null;

        if ($combinator = $this->is("combinator")) {
            if (!$element = $this->is("element")) {
                throw new TextParserException("Invalid expression", $this);
            }
        } elseif ($element = $this->is("element")) {
            // 'descendant' is the default combinator
            $combinator = CssParserCombinatorFactory::getInstance(
                "CssParserCombinatorDescendant"
            );
        } else {
            return false;
        }

        return new CssParserModelFactor($combinator, $element);
    }
1137223
function schemaEndElement($parser, $name)
    {
        // bring depth down a notch
        $this->depth--;
        // position of current element is equal to the last value left in depth_array for my depth
        if (isset($this->depth_array[$this->depth])) {
            $pos = $this->depth_array[$this->depth];
        }
        // get element prefix
        if ($prefix = $this->getPrefix($name)) {
            // get unqualified name
            $name = $this->getLocalPart($name);
        } else {
            $prefix = '';
        }
        // move on...
        if ($name == 'complexType') {
            $this->xdebug('done processing complexType ' . ($this->currentComplexType ? $this->currentComplexType : '(unknown)'));
            $this->xdebug($this->varDump($this->complexTypes[$this->currentComplexType]));
            $this->currentComplexType = array_pop($this->complexTypeStack);
            //$this->currentElement = false;
        }
        if ($name == 'element') {
            $this->xdebug('done processing element ' . ($this->currentElement ? $this->currentElement : '(unknown)'));
            $this->currentElement = array_pop($this->elementStack);
        }
        if ($name == 'simpleType') {
            $this->xdebug('done processing simpleType ' . ($this->currentSimpleType ? $this->currentSimpleType : '(unknown)'));
            $this->xdebug($this->varDump($this->simpleTypes[$this->currentSimpleType]));
            $this->currentSimpleType = array_pop($this->simpleTypeStack);
        }
    }
23500
private Polygon createPolygon(double[][][] coordinates, CrsId crsId) {
        LinearRing[] rings = new LinearRing[coordinates.length];
        for (int i = 0; i < coordinates.length; i++) {
            rings[i] = new LinearRing(createPointSequence(coordinates[i], crsId));
        }
        return new Polygon(rings);
    }
14383
private function readCircularStringText(WKTParser $parser, CoordinateSystem $cs) : CircularString
    {
        $points = $this->readMultiPoint($parser, $cs);

        return new CircularString($cs, ...$points);
    }
73981
private function readCircularString(WKBBuffer $buffer, CoordinateSystem $cs) : CircularString
    {
        $numPoints = $buffer->readUnsignedLong();

        $points = [];

        for ($i = 0; $i < $numPoints; $i++) {
            $points[] = $this->readPoint($buffer, $cs);
        }

        return new CircularString($cs, ...$points);
    }
1269713
private Coordinate[] parseCoordinates(JsonParser jp) throws IOException {
        jp.nextToken(); // START_ARRAY [ to parse the each positions
        ArrayList<Coordinate> coords = new ArrayList<Coordinate>();
        while (jp.getCurrentToken() != JsonToken.END_ARRAY) {
            coords.add(parseCoordinate(jp));
        }
        return coords.toArray(new Coordinate[0]);
    }
630394
public static function fromParser(MoreInfoParser $parser): self
    {
        $instance = new self();
        $instance->moreInfo = $parser->getMoreInfo();

        return $instance;
    }
1331644
public static function fromParser(MangaStatsParser $parser): MangaStats
    {
        $instance = new self();
        $instance->reading = $parser->getReading();
        $instance->completed = $parser->getCompleted();
        $instance->onHold = $parser->getOnHold();
        $instance->dropped = $parser->getDropped();
        $instance->planToRead = $parser->getPlanToRead();
        $instance->total = $parser->getTotal();
        $instance->scores = $parser->getScores();

        return $instance;
    }
330490
private function readTriangle(WKBBuffer $buffer, CoordinateSystem $cs) : Triangle
    {
        $numRings = $buffer->readUnsignedLong();

        $rings = [];

        for ($i = 0; $i < $numRings; $i++) {
            $rings[] = $this->readLineString($buffer, $cs);
        }

        return new Triangle($cs, ...$rings);
    }