implement copying of Stations for Seminary copy feature

This commit is contained in:
oliver 2016-01-30 20:15:13 +01:00
commit 40a233fa7d
4342 changed files with 1215466 additions and 0 deletions

View file

@ -0,0 +1,45 @@
<?php
$features = array();
$coordinates = array();
// Add points
foreach($stations as &$station)
{
if(!is_null($station['longitude']) && !is_null($station['latitude'])) {
$coordinate = array(
floatval($station['longitude']),
floatval($station['latitude'])
);
$coordinates[] = $coordinate;
$features[] = array(
'type' => 'Feature',
'id' => $station['id'],
'properties' => array(
'name' => $station['title'],
),
'geometry' => array(
'type' => 'Point',
'coordinates' => $coordinate
)
);
}
}
// Add lines between points
if($hasgroup) {
$features[] = array(
'type' => 'Feature',
'name' => 'Line',
'geometry' => array(
'type' => 'LineString',
'coordinates' => $coordinates
)
);
}
?>
<?=json_encode(array(
'type' => 'FeatureCollection',
'features' => $features
))?>