Creates Polygon

@param array $settings []

@return GD
191238
public function polygon(Array $settings = []) : GD
    {
        $points     = $settings['points']     ?? $this->points     ?? 0;
        $pointCount = $settings['pointCount'] ?? $this->pointCount ?? (ceil(count($this->points ?? $points) / 2));
        $color      = $settings['color']      ?? $this->color      ?? '0|0|0';
        $style      = $settings['type']       ?? $this->type       ?? NULL;

        if( $style === NULL )
        {
            imagepolygon($this->canvas, $points, $pointCount, $this->allocate($color));
        }
        else
        {
            imagefilledpolygon($this->canvas, $points, $pointCount, $this->allocate($color));
        }

        $this->defaultRevolvingVariables();

        return $this;
    }
9682
public static function fromFilterArray(array $array): LocationRange
    {
        $coordinates = array_map(function (array $coordinate) {
            return Coordinate::createFromArray($coordinate);
        }, $array['coordinates']);

        return new Polygon($coordinates);
    }
563794
def create_regpoly(self, x0, y0, x1, y1, sides=0, start=90, extent=360, **kw):
        """"""
        coords = self.__regpoly_coords(x0, y0, x1, y1, sides, start, extent)
        return self.canvas.create_polygon(*coords, **kw)
703418
public function resolve(array $settings = [])
    {
        return new SimplifiedXmlDriver(
            Arr::get($settings, 'paths'),
            Arr::get($settings, 'extension', SimplifiedXmlDriver::DEFAULT_FILE_EXTENSION)
        );
    }
430113
public static function make(array $config)
    {
        $builder = self::getBuilder();
        $configObject = $builder->build($config);
        $grid = new Grid($configObject);
        return $grid;
    }
544160
protected function awsS3(Settings $settings)
    {
        return new Adapters\AwsS3(
            new AwsS3Adapter(
                new S3Client([
                    'credentials' => [
                        'key'    => $settings->get('awsS3Key'),
                        'secret' => $settings->get('awsS3Secret'),
                    ],
                    'region'  => empty($settings->get('awsS3Region')) ? null : $settings->get('awsS3Region'),
                    'version' => 'latest',
                ]),
                $settings->get('awsS3Bucket')
            )
        );
    }
86251
public static Polygon createPolygonFromEnvelope( Envelope env ) {
        double minX = env.getMinX();
        double minY = env.getMinY();
        double maxY = env.getMaxY();
        double maxX = env.getMaxX();
        Coordinate[] c = new Coordinate[]{new Coordinate(minX, minY), new Coordinate(minX, maxY), new Coordinate(maxX, maxY),
                new Coordinate(maxX, minY), new Coordinate(minX, minY)};
        return gf().createPolygon(c);
    }
789620
private function constructSettings($settings) {
        $ret = [];

        if(array_key_exists('fields', $settings)) {
            $ret['_source'] = ['include' => $settings['fields']];
        }

        if(array_key_exists('sort', $settings)) {
            $ret['sort'] = array_map(function($x) { return [$x[0] => ['order' => $x[1] ? 'asc':'desc']]; }, $settings['sort']);
        }

        $valid_keys = ['size'];
        foreach($valid_keys as $key) {
            if(array_key_exists($key, $settings)) {
                $ret[$key] = $settings[$key];
            }
        }

        return $ret;
    }
355796
public function setSettings(array $settings = []) : self
    {
        $this->settings = array_merge($this->settings, $settings);
        // loop through checking each setting
        foreach ($this->allowedSettings as $name => $allowed) {
            $this->validateSettings->__invoke($name, $this->settings[$name], $allowed);
        }

        return $this;
    }
449213
public static function create(array $options) {
        $formatterClass = ucfirst(!empty($options['driverOptions']['format']) ? $options['driverOptions']['format'] : 'json');
        $className      = preg_match('/\\\\/', $formatterClass) ? $formatterClass : 'Circle\DoctrineRestDriver\Formatters\\' . $formatterClass;
        Assertions::assertClassExists($className);

        return self::assert(new $className($options));
    }
582796
public function create()
    {
        $instance = self::createCountriesGeoZone($this);
        $this->setId($instance->getId());
        return $instance;
    }
93932
public static MultiPolygon of(Iterable<Polygon> polygons) {
        MultiDimensionalPositions.Builder positionsBuilder = MultiDimensionalPositions.builder();
        for(Polygon polygon : polygons) {
            positionsBuilder.addAreaPosition(polygon.positions());
        }

        return new MultiPolygon(positionsBuilder.build());
    }
213474
public function ellipse(Array $settings = []) : GD
    {
        $x      = $settings['x']       ?? $this->x      ?? 0;
        $y      = $settings['y']       ?? $this->y      ?? 0;
        $width  = $settings['width']   ?? $this->width  ?? 100;
        $height = $settings['height']  ?? $this->height ?? 100;
        $color  = $settings['color']   ?? $this->color  ?? '0|0|0';
        $style  = $settings['type']    ?? $this->type   ?? NULL;

        if( $style === NULL )
        {
            imageellipse($this->canvas, $x, $y, $width, $height, $this->allocate($color));
        }
        else
        {
            imagefilledellipse($this->canvas, $x, $y, $width, $height, $this->allocate($color));
        }

        $this->defaultRevolvingVariables();

        return $this;
    }
1074797
public static function getBoundsOfPolygons($polygons, $margin = 0.0)
    {
        $coords = [];
        /** @var Polygon $polygon */
        foreach ($polygons as $polygon) {
            if (!($polygon instanceof Polygon)) {
                throw new InvalidParamException('"$polygons" must be an array of "' . Polygon::className() . '" objects');
            }
            // merge LatLng arrays
            $coords = ArrayHelper::merge($coords, $polygon->paths);
        }

        return LatLngBounds::getBoundsOfCoordinates($coords, $margin);
    }
485563
public function copy($source, Array $settings = []) : GD
    {
        if( is_file($file = $source) )
        {
            $source = $this->createFrom($source);
        }

        if( ! is_resource($source) )
        {
            throw new InvalidArgumentException(NULL, '[resource]');
        }

        $this->alignImageWatermark($file);

        $xt     = $settings['xt']     ?? $this->target[0] ?? 0;
        $yt     = $settings['yt']     ?? $this->target[1] ?? 0;
        $xs     = $settings['xs']     ?? $this->source[0] ?? 0;
        $ys     = $settings['ys']     ?? $this->source[1] ?? 0;
        $width  = $settings['width']  ?? $this->width     ?? 0;
        $height = $settings['height'] ?? $this->height    ?? 0;

        imagecopy($this->canvas, $source, $xt, $yt, $xs, $ys, $width, $height);
        
        $this->defaultRevolvingVariables();

        return $this;
    }
1144832
public function settings(array $settings)
    {
        $this->settings = array_merge($this->settings, $settings);
        if ($this->serviceClient) $this->buildClient();
        return $this;
    }
158464
public function resolve(array $settings = [])
    {
        return new SimplifiedYamlDriver(
            Arr::get($settings, 'paths'),
            Arr::get($settings, 'extension', SimplifiedYamlDriver::DEFAULT_FILE_EXTENSION)
        );
    }