Returns a Universal Transverse Mercator projection representation of the coordinate in meters

@return String
423457
public function toUniversalTransverseMercator()
    {
        $coordinate = self::getBaseCoordinate($this);
        $convert    = new Convert($coordinate);
        $utm        = $convert->toUniversalTransverseMercator();

        return new StringLiteral($utm);
    }
712542
public function getPerimeters()
    {
        if (null === $this->perimeters) {
            $perimeters = array();
            foreach ($this->perimeterManager->findAll() as $network) {
                $perimeter = new BusinessPerimeter($network->getExternalPerimeterId());
                $perimeter->setId($network->getId());
                $this->perimeters[] = $perimeter;
            }
        }

        return $this->perimeters;
    }
212656
public function getCoordinates()
    {
        $coords = [];

        if (!empty($this->spatial)) {
            foreach ($this->spatial as $column) {
                $clear = trim(preg_replace('/[a-zA-Z\(\)]/', '', $this->getLocation($column)));
                if (!empty($clear)) {
                    foreach (explode(',', $clear) as $point) {
                        list($lat, $lng) = explode(' ', $point);
                        $coords[] = [
                            'lat' => $lat,
                            'lng' => $lng,
                        ];
                    }
                }
            }
        }

        return $coords;
    }
1064231
private function _getProjectionSize() {
        $sourceWidth = $this->_params['sourceWidth'];
        $sourceHeight = $this->_params['sourceHeight'];
        $sourceRatio = $sourceWidth / $sourceHeight;

        $canvasWidth = $this->_params['w'];
        $canvasHeight = $this->_params['h'];
        $canvasRatio = $canvasWidth / $canvasHeight;


        //  the image is not allowed to be cut off in any dimension
        if ($sourceRatio < $canvasRatio) {
            //  source is less landscape-like than canvas
            $leadDimension = !$this->_params['crop'] ?
                'Height' : 'Width';
        } else {
            //  source is more landscape-like than canvas
            $leadDimension = !$this->_params['crop'] ?
                'Width' : 'Height';
        }

        if (!$this->_params['grow']
            && ${'source' . $leadDimension} < ${'canvas' . $leadDimension}
        ) {
            ${'projection' . $leadDimension} = ${'source' . $leadDimension};
        } else {
            ${'projection' . $leadDimension} = ${'canvas' . $leadDimension};
        }

        if (isset($projectionWidth)) {
            $projectionHeight = $projectionWidth / $sourceRatio;
        } elseif (isset($projectionHeight)) {
            $projectionWidth = $projectionHeight * $sourceRatio;
        }

        return array(round($projectionWidth), round($projectionHeight));
    }
1137596
public function calDistance(){
		$num = 0;
		foreach ($this->coordinatesArray as $key => $row) {
        	$this->distLat[] = $row['lat'];
	        $this->distLong[] =$row['long'];
    	}
    	//// Get the Leangth of passed array //////
    	$num = sizeof($this->coordinatesArray) - 1; // Fixed the Undefined offset error : offset = sizeofArray - 1
	    for($i=0;$i<$num;$i++){
	    	if($this->distLat[$i+1] != '' and $this->distLong[$i+1] != '') {
	            $distance[]=$this->distance($this->distLat[$i],$this->distLong[$i],$this->distLat[$i+1],$this->distLong[$i+1],$this->unit);
	        }
	    }
		return round(array_sum($distance));
	}
278719
public function dimensions() {
        return $this->_cache(__FUNCTION__, function($file) {
            /** @type \Transit\File $file */

            $dims = null;

            if (!$file->isImage()) {
                return $dims;
            }

            $data = @getimagesize($file->path());

            if ($data && is_array($data)) {
                $dims = array(
                    'width' => $data[0],
                    'height' => $data[1]
                );
            }

            if (!$data) {
                $image = @imagecreatefromstring(file_get_contents($file->path()));
                $dims = array(
                    'width' => @imagesx($image),
                    'height' => @imagesy($image)
                );
            }

            return $dims;
        });
    }
21647
def _get_tile_when_web_mercator_crs(self, x_tile, y_tile, zoom,
                                        bands=None, masked=None,
                                        resampling=Resampling.cubic):
        
        roi = GeoVector.from_xyz(x_tile, y_tile, zoom)
        coordinates = roi.get_bounds(WEB_MERCATOR_CRS)
        window = self._window(coordinates, to_round=False)
        bands = bands or list(range(1, self.num_bands + 1))
        # we know the affine the result should produce becuase we know where
        # it is located by the xyz, therefore we calculate it here
        ratio = MERCATOR_RESOLUTION_MAPPING[zoom] / self.resolution()

        # the affine should be calculated before rounding the window values
        affine = self.window_transform(window)
        affine = affine * Affine.scale(ratio, ratio)

        window = Window(round(window.col_off),
                        round(window.row_off),
                        round(window.width),
                        round(window.height))
        return self.get_window(window, bands=bands, xsize=256, ysize=256, masked=masked, affine=affine)
740544
public function generateMapping()
	{
		$mapping = array();
		$lines = explode("\n", $this->mime_types_text);
		foreach ($lines as $line) {
			$line = trim(preg_replace('~\\#.*~', '', $line));
			$parts = $line ? array_values(array_filter(explode("\t", $line))) : array();
			if (count($parts) === 2) {
				$mime = trim($parts[0]);
				$extensions = explode(' ', $parts[1]);
				foreach ($extensions as $extension) {
					$extension = trim($extension);
					if ($mime && $extension) {
						$mapping['mimes'][$extension][] = $mime;
						$mapping['extensions'][$mime][] = $extension;
						$mapping['mimes'][$extension] = array_unique($mapping['mimes'][$extension]);
						$mapping['extensions'][$mime] = array_unique($mapping['extensions'][$mime]);
					}
				}
			}
		}
		return $mapping;
	}
637393
public function getDimension() {
        $w = 0.0;
        $h = 0.0;
        $box = $this->getBox();

        if ($box !== null) {
            $minX = min(array($box[0], $box[2], $box[4], $box[6]));
            $maxX = max(array($box[0], $box[2], $box[4], $box[6]));
            $minY = min(array($box[1], $box[3], $box[5], $box[7]));
            $maxY = max(array($box[1], $box[3], $box[5], $box[7]));

            $w = $maxX - $minX;
            $h = $maxY - $minY;
        }

        $rotationAngle = $this->getRotationAngle();
        if ($rotationAngle === 90 || $rotationAngle === 270) {
            return array($h + self::PHP_BOX_FIX, $w);
        } else {
            return array($w + self::PHP_BOX_FIX, $h);
        }
    }
696106
public function getDescription()
    {
        if ($this->max !== -1) {
            return vsprintf(
                'The value is expected to have a length between %d and %d'
                . ' (%d <= x <= %d).',
                [
                    $this->min,
                    $this->max,
                    $this->min,
                    $this->max,
                ]
            );
        }

        return vsprintf(
            'The value is expected to have a length greater or equal to %d'
            . ' (%d <= x).',
            [
                $this->min,
                $this->min,
            ]
        );
    }
241990
public function getFloatMajor()
    {
        if ($this->startsWith($this->major, '0'))
            return (float) ('0.'.substr($this->major, 1));
        return (float) $this->major;
    }
1008455
private function getSubTotDTE()
    {
        $SubTotDTE = [];
        $subtotales = [];
        foreach ($this->dtes as &$DTE) {
            if (!isset($subtotales[$DTE->getTipo()]))
                $subtotales[$DTE->getTipo()] = 0;
            $subtotales[$DTE->getTipo()]++;
        }
        foreach ($subtotales as $tipo => $subtotal) {
            $SubTotDTE[] = [
                'TpoDTE' => $tipo,
                'NroDTE' => $subtotal,
            ];
        }
        return $SubTotDTE;
    }
672340
private function getTmpPath(): string
    {
        $tmpDir = sys_get_temp_dir();
        if (!empty($this->prefix)) {
            $tmpDir .= '/' . $this->prefix;
        }
        $tmpDir .= '/' . $this->id;
        return $tmpDir;
    }
67673
public function toDegreesMinutesSeconds()
    {
        $coordinate = self::getBaseCoordinate($this);
        $convert    = new Convert($coordinate);
        $dms        = $convert->toDegreesMinutesSeconds();

        return new StringLiteral($dms);
    }
674820
protected function getMetricsToggles()
    {
        $i = 0;
        $metrics = array();
        foreach ($this->availableMetrics as $metric => $metricData) {
            $unit = Metrics::getUnit($metric, $this->idSite);
            $change = isset($metricData['change']) ? $metricData['change'] : false;

            list($first, $last) = $this->getFirstAndLastDataPointsForMetric($metric);
            $fractionDigits = max($this->getFractionDigits($first), $this->getFractionDigits($last));

            $details = Piwik::translate('RowEvolution_MetricBetweenText', array(
                NumberFormatter::getInstance()->format($first, $fractionDigits, $fractionDigits) . $unit,
                NumberFormatter::getInstance()->format($last, $fractionDigits, $fractionDigits) . $unit,
            ));

            if ($change !== false) {
                $lowerIsBetter = Metrics::isLowerValueBetter($metric);
                if (substr($change, 0, 1) == '+') {
                    $changeClass = $lowerIsBetter ? 'bad' : 'good';
                    $changeImage = $lowerIsBetter ? 'arrow_up_red' : 'arrow_up';
                } else if (substr($change, 0, 1) == '-') {
                    $changeClass = $lowerIsBetter ? 'good' : 'bad';
                    $changeImage = $lowerIsBetter ? 'arrow_down_green' : 'arrow_down';
                } else {
                    $changeClass = 'neutral';
                    $changeImage = false;
                }

                $change = '<span class="' . $changeClass . '">'
                    . ($changeImage ? '<img src="plugins/MultiSites/images/' . $changeImage . '.png" /> ' : '')
                    . $change . '</span>';

                $details .= ', ' . Piwik::translate('RowEvolution_MetricChangeText', $change);
            }

            // set metric min/max text (used as tooltip for details)
            $max = isset($metricData['max']) ? $metricData['max'] : 0;
            $min = isset($metricData['min']) ? $metricData['min'] : 0;
            $minmax = Piwik::translate('RowEvolution_MetricMinMax', array(
                $metricData['name'],
                NumberFormatter::getInstance()->formatNumber($min, $fractionDigits, $fractionDigits) . $unit,
                NumberFormatter::getInstance()->formatNumber($max, $fractionDigits, $fractionDigits) . $unit,
            ));

            $newMetric = array(
                'label'     => $metricData['name'],
                'details'   => $details,
                'minmax'    => $minmax,
                'sparkline' => $this->getSparkline($metric),
            );
            // Multi Rows, each metric can be for a particular row and display an icon
            if (!empty($metricData['logo'])) {
                $newMetric['logo'] = $metricData['logo'];
            }

            // TODO: this check should be determined by metric metadata, not hardcoded here
            if ($metric == 'nb_users'
                && $first == 0
                && $last == 0
            ) {
                $newMetric['hide'] = true;
            }

            $metrics[] = $newMetric;
            $i++;
        }

        return $metrics;
    }
514700
private function getSoundExtensionConstant()
    {
        $retour = [];
        if (empty($this->const_sndsExt)) {
            $constants = $this->getConstants();
            foreach ($constants as $key => $constant) {
                $pos = strpos($key, 'EXT_SNDS');
                if ($pos !== false) {
                    $retour[$key] = $constant;
                }
            }
            $this->const_sndsExt = $retour;
        } else {
            $retour = $this->const_sndsExt;
        }
        return $retour;
    }
1310081
public function getCenterOfBounds()
    {
        $path = ArrayHelper::getValue($this->options, 'path');

        return is_array($path) && !empty($path)
            ? LatLngBounds::getBoundsOfCoordinates($path)->getCenterCoordinates()
            : null;
    }