.gpx to geo/ folder * 2. Assign file to project: UPDATE projects SET codename = '' WHERE id_project = ; * 3. Load any page * * To force gpx rebuild: * ?a=build_geojson&name= */ class Converter extends PhpObject { public function __construct() { parent::__construct(__CLASS__); } public static function convertToGeoJson($sCodeName) { $oGpx = new Gpx($sCodeName); $oGeoJson = new GeoJson($sCodeName); $oGeoJson->buildTracks($oGpx->getTracks()); if($oGeoJson->isSimplicationRequired()) $oGeoJson->buildTracks($oGpx->getTracks(), true); $oGeoJson->sortOffTracks(); $oGeoJson->saveFile(); return $oGpx->getLog().'
'.$oGeoJson->getLog(); } public static function isGeoJsonValid($sCodeName) { $sGpxFilePath = Gpx::getFilePath($sCodeName); $sGeoJsonFilePath = GeoJson::getFilePath($sCodeName); //No need to generate if gpx is missing return !file_exists($sGpxFilePath) || file_exists($sGeoJsonFilePath) && filemtime($sGeoJsonFilePath) >= filemtime($sGpxFilePath); } }