161,10 → 161,10 |
|
private static function coordonneesSontNulles(&$point) { |
|
$coord_nulles = ($point['coord_x'] == '000null' || |
$point['coord_x'] == '' || |
$point['coord_y'] == '000null' || |
$point['coord_y'] == ''); |
$coord_nulles = ($point['latitude'] == '000null' || |
$point['latitude'] == '' || |
$point['longitude'] == '000null' || |
$point['longitude'] == ''); |
return $coord_nulles; |
} |
|
178,12 → 178,18 |
if($point['station'] != '' && $point['station'] != '000null') { |
$station = $point['station']; |
} else { |
$station = $point['location'].(($point['id_location'] != '' && $point['id_location'] != '000null') ? '('.$point['id_location'].')' : ''); |
$station = $point['zone_geo'].(($point['id_zone_geo'] != '' && $point['id_zone_geo'] != '000null') ? ' ('.self::formaterNomZoneGeo($point['id_zone_geo']).')' : ''); |
} |
|
return $station; |
} |
|
private static function formaterNomZoneGeo($zone_geo) { |
$zone_geo = str_replace('INSEE-C:', '', $zone_geo); |
$zone_geo = strlen($zone_geo) >= 2 ? substr($zone_geo, 0, 2) : $zone_geo; |
return $zone_geo; |
} |
|
private static function formaterPointPourAjout(&$point) { |
|
if(isset($point['type_emplacement'])) { |
194,6 → 200,7 |
$point_allege = array(); |
$point_allege['id'] = self::MARQUEUR_COMMUNE.':'.$point['wgs84_latitude'].'|'.$point['wgs84_longitude']; |
$point_allege['type_emplacement'] = 'communes'; |
$point_allege['nom'] = self::formaterNomStation($point); |
$point_allege['lat'] = (float)$point['wgs84_latitude']; |
$point_allege['lng'] = (float)$point['wgs84_longitude']; |
|
200,11 → 207,11 |
$point = $point_allege; |
} else { |
$point_allege = array(); |
$point_allege['id'] = self::MARQUEUR_STATION.':'.$point['coord_x'].'|'.$point['coord_y']; |
$point_allege['id'] = self::MARQUEUR_STATION.':'.$point['latitude'].'|'.$point['longitude']; |
$point_allege['type_emplacement'] = 'stations'; |
$point_allege['nom'] = self::formaterNomStation($point); |
$point_allege['lat'] = (float)$point['coord_x']; |
$point_allege['lng'] = (float)$point['coord_y']; |
$point_allege['lat'] = (float)$point['latitude']; |
$point_allege['lng'] = (float)$point['longitude']; |
|
$point = $point_allege; |
} |