protected function parseProperties(array $rawProperties) {
        if (isset($rawProperties['exif:GPSLatitude']) &&
            isset($rawProperties['exif:GPSLongitude'])) {

            // We store coordinates in GeoJSON-format (lng/lat)
            $rawProperties['gps:location'] = [
                $this->parseGpsCoordinate(
                    $rawProperties['exif:GPSLongitude'],
                    $rawProperties['exif:GPSLongitudeRef']
                ),
                $this->parseGpsCoordinate(
                    $rawProperties['exif:GPSLatitude'],
                    $rawProperties['exif:GPSLatitudeRef']
                ),
            ];
        }

        if (isset($rawProperties['exif:GPSAltitude'])) {
            $alt = explode('/', $rawProperties['exif:GPSAltitude'], 2);
            $rawProperties['gps:altitude'] = $alt[0] / (int) $alt[1];
        }

        $properties = [];
        foreach ($rawProperties as $key => $val) {
            // Get rid of dots in property names
            $key = str_replace('.', ':', $key);

            // Replace underscore with dash for png properties
            if (substr($key, 0, 3) === 'png') {
                $key = str_replace('_', '-', $key);
            }

            $properties[$key] = $val;
        }

        return $properties;
    }
protected function parseProperties(array $rawProperties) {
        if (isset($rawProperties['exif:GPSLatitude']) &&
            isset($rawProperties['exif:GPSLongitude'])) {

            // We store coordinates in GeoJSON-format (lng/lat)
            $rawProperties['gps:location'] = [
                $this->parseGpsCoordinate(
                    $rawProperties['exif:GPSLongitude'],
                    $rawProperties['exif:GPSLongitudeRef']
                ),
                $this->parseGpsCoordinate(
                    $rawProperties['exif:GPSLatitude'],
                    $rawProperties['exif:GPSLatitudeRef']
                ),
            ];
        }

        if (isset($rawProperties['exif:GPSAltitude'])) {
            $alt = explode('/', $rawProperties['exif:GPSAltitude'], 2);
            $rawProperties['gps:altitude'] = $alt[0] / (int) $alt[1];
        }

        $properties = [];
        foreach ($rawProperties as $key => $val) {
            // Get rid of dots in property names
            $key = str_replace('.', ':', $key);

            // Replace underscore with dash for png properties
            if (substr($key, 0, 3) === 'png') {
                $key = str_replace('_', '-', $key);
            }

            $properties[$key] = $val;
        }

        return $properties;
    }
protected function parseProperties ( array $ rawProperties ) { if ( isset ( $ rawProperties [ 'exif:GPSLatitude' ] ) && isset ( $ rawProperties [ 'exif:GPSLongitude' ] ) ) { // We store coordinates in GeoJSON-format (lng/lat) $ rawProperties [ 'gps:location' ] = [ $ this -> parseGpsCoordinate ( $ rawProperties [ 'exif:GPSLongitude' ] , $ rawProperties [ 'exif:GPSLongitudeRef' ] ) , $ this -> parseGpsCoordinate ( $ rawProperties [ 'exif:GPSLatitude' ] , $ rawProperties [ 'exif:GPSLatitudeRef' ] ) , ] ; } if ( isset ( $ rawProperties [ 'exif:GPSAltitude' ] ) ) { $ alt = explode ( '/' , $ rawProperties [ 'exif:GPSAltitude' ] , 2 ) ; $ rawProperties [ 'gps:altitude' ] = $ alt [ 0 ] / ( int ) $ alt [ 1 ] ; } $ properties = [ ] ; foreach ( $ rawProperties as $ key => $ val ) { // Get rid of dots in property names $ key = str_replace ( '.' , ':' , $ key ) ; // Replace underscore with dash for png properties if ( substr ( $ key , 0 , 3 ) === 'png' ) { $ key = str_replace ( '_' , '-' , $ key ) ; } $ properties [ $ key ] = $ val ; } return $ properties ; }
Parse an array of properties into a storable format

@param array $rawProperties An array of properties to parse
@return array Parsed array of properties
Parse an array of properties into a storable format