Pick project from globe
This commit is contained in:
@@ -103,7 +103,6 @@ class GeoJson extends Geo {
|
||||
if($bSimplify) $this->addNotice('Total: '.$iGlobalInvalidPointCount.'/'.$iGlobalPointCount.' points removed ('.round($iGlobalInvalidPointCount / $iGlobalPointCount * 100, 1).'%)');
|
||||
}
|
||||
|
||||
|
||||
public function sortOffTracks() {
|
||||
$this->addNotice('Sorting off-tracks');
|
||||
|
||||
@@ -155,7 +154,19 @@ class GeoJson extends Geo {
|
||||
$this->asTracks = array_values($asTracks);
|
||||
}
|
||||
|
||||
private function parseOptions($sComment){
|
||||
public function getCenter() {
|
||||
$asCoords = array();
|
||||
$asMainTracks = array_filter($this->asTracks, function ($astrack) {return $astrack['properties']['type'] == 'main';});
|
||||
foreach($asMainTracks as $asMainTrack) {
|
||||
foreach($asMainTrack['geometry']['coordinates'] as $aiCoords) {
|
||||
$asCoords[] = $aiCoords;
|
||||
}
|
||||
}
|
||||
|
||||
return $asCoords[(int) floor(count($asCoords) / 2)];
|
||||
}
|
||||
|
||||
private function parseOptions($sComment) {
|
||||
$sComment = strip_tags(html_entity_decode($sComment));
|
||||
$asOptions = array(self::OPT_SIMPLE=>'');
|
||||
foreach(explode("\n", $sComment) as $sLine) {
|
||||
|
||||
Reference in New Issue
Block a user