automatic geojson file generation

This commit is contained in:
2019-03-07 20:36:23 +01:00
parent 49090d1416
commit dc9a5c82d8
3 changed files with 23 additions and 15 deletions

View File

@@ -8,9 +8,6 @@ class Project extends PhpObject {
const MODE_HISTO = 'H';
const MODES = array('previz'=>self::MODE_PREVIZ, 'blog'=>self::MODE_BLOG, 'histo'=>self::MODE_HISTO);
//Folders
const GEO_FOLDER = 'geo/';
//DB Tables
const PROJ_TABLE = 'projects';
@@ -101,12 +98,11 @@ class Project extends PhpObject {
case 2: $asProject['mode'] = self::MODE_HISTO; break;
}
$sGeoFile = self::GEO_FOLDER.$asProject['geofile'];
if(!file_exists($sGeoFile)) {
if(!Converter::isGeoJsonValid($asProject['geofile'])) {
(new Converter())->convertToGeoJson($asProject['geofile']);
}
$asProject['geofile'] = Spot::addTimestampToFilePath($sGeoFile);
$asProject['geofile'] = Spot::addTimestampToFilePath(Geo::getFilePath($asProject['geofile']));
$asProject['codename'] = $sCodeName;
$asProject['timezone_desc'] = Spot::getTimeZoneDesc($asProject['timezone']);
}