Line 118... |
Line 118... |
118 |
$obsAAjouter['annotation'] = isset($obs['notes']) && trim($obs['notes']) !== "" ? $obs['notes'] : null;
|
118 |
$obsAAjouter['annotation'] = isset($obs['notes']) && trim($obs['notes']) !== "" ? $obs['notes'] : null;
|
Line 119... |
Line 119... |
119 |
|
119 |
|
120 |
// Pays est pour le moment sur un varchar(2) dans la base
|
120 |
// Pays est pour le moment sur un varchar(2) dans la base
|
121 |
// alors qu'il est envoyé complet par le script WidgetSaisie
|
121 |
// alors qu'il est envoyé complet par le script WidgetSaisie
|
122 |
$obsAAjouter['osm_country'] = (isset($obs['pays'])) ? $obs['pays'] : null;
|
122 |
$obsAAjouter['osm_country'] = (isset($obs['pays'])) ? $obs['pays'] : null;
|
- |
|
123 |
$obsAAjouter['osm_postcode'] = (isset($obs['code_postal'])) ? $obs['code_postal'] : null;
|
123 |
$obsAAjouter['locality'] = $obs['commune_nom'];
|
124 |
$obsAAjouter['locality'] = isset($obs['commune_nom']) && trim($obs['commune_nom']) !== "" ? $obs['commune_nom'] : null;
|
124 |
$obsAAjouter['locality_insee_code'] = isset($obs['commune_code_insee']) ? $obs['commune_code_insee'] : '';
|
125 |
$obsAAjouter['locality_insee_code'] = isset($obs['commune_code_insee']) && trim($obs['commune_code_insee']) !== "" ? $obs['commune_code_insee'] : null;
|
125 |
$obsAAjouter['sublocality'] = isset($obs['lieudit']) && trim($obs['lieudit']) !== "" ? $obs['lieudit'] : null;
|
126 |
$obsAAjouter['sublocality'] = isset($obs['lieudit']) && trim($obs['lieudit']) !== "" ? $obs['lieudit'] : null;
|
126 |
$obsAAjouter['station'] = isset($obs['station']) && trim($obs['station']) !== "" ? $obs['station'] : null;
|
127 |
$obsAAjouter['station'] = isset($obs['station']) && trim($obs['station']) !== "" ? $obs['station'] : null;
|
127 |
$obsAAjouter['environment'] = isset($obs['milieu']) && trim($obs['milieu']) !== "" ? $obs['milieu'] : null;
|
128 |
$obsAAjouter['environment'] = isset($obs['milieu']) && trim($obs['milieu']) !== "" ? $obs['milieu'] : null;
|
128 |
$obsAAjouter['elevation'] = (! empty($obs['altitude'])) ? $obs['altitude'] : null;
|
129 |
$obsAAjouter['elevation'] = (! empty($obs['altitude'])) ? $obs['altitude'] : null;
|
129 |
$obsAAjouter['geometry'] = $obs['geometry'] ?? json_encode([
|
130 |
$obsAAjouter['geometry'] = $obs['geometry'] ?? json_encode([
|
- |
|
131 |
'type' => 'Point',
|
130 |
'type' => 'Point',
|
132 |
'coordinates' => [
|
- |
|
133 |
round((float)str_replace(',', '.', $obs['longitude']), 6),
|
- |
|
134 |
round((float)str_replace(',', '.', $obs['latitude']), 6)
|
131 |
'coordinates' => [ (float)str_replace(',', '.', $obs['longitude']),(float)str_replace(',', '.', $obs['latitude']) ]
|
135 |
]
|
132 |
]); // CONCAT('{\"type\":\"Point\",\"coordinates\":[', longitude, ',', latitude,']}'),
|
136 |
]); // CONCAT('{\"type\":\"Point\",\"coordinates\":[', longitude, ',', latitude,']}'),
|
133 |
$obsAAjouter['geodatum'] = 'WGS84';
|
137 |
$obsAAjouter['geodatum'] = 'WGS84';
|
134 |
$obsAAjouter['published_location'] = ($this->tagsObs != null && in_array('sensible', $this->tagsObs) == true) ?
|
138 |
$obsAAjouter['published_location'] = ($this->tagsObs != null && in_array('sensible', $this->tagsObs) == true) ?
|