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;
}