-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from aloxe/jsonlists
use geojson list and files, not gpx
- Loading branch information
Showing
5 changed files
with
109 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
$velotracks = "json"; | ||
|
||
// An array of the json file names | ||
$tracks = array(); | ||
|
||
//Open images directory | ||
$dir = opendir($velotracks); | ||
|
||
//List files in tracks directory | ||
while (($file = readdir($dir)) !== false) { | ||
$geojson = json_decode(file_get_contents(__DIR__."/".$velotracks."/".$file)); | ||
|
||
if (isset($geojson->slug)) { | ||
$date = $geojson->date; | ||
$title = $geojson->title; | ||
$slug = $geojson->slug; | ||
$countries = $geojson->countries; | ||
array_push($tracks,[ | ||
'date' => $geojson->date, | ||
'title' => $geojson->title, | ||
'slug' => $geojson->slug, | ||
'countries' => $geojson->countries, | ||
]); | ||
} | ||
} | ||
closedir($dir); | ||
// asort($tracks); | ||
echo json_encode($tracks); //, JSON_PRETTY_PRINT); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters