Subversion Repositories eFlore/Applications.moissonnage

Compare Revisions

Ignore whitespace Rev 29 → Rev 30

/trunk/scripts/modules/maillage_projet/sources/sophy.ini
1,5 → 1,5
[champs]
 
tbl.champ_longitude = 'lieu_station_longitude'
tbl.champ_latitude = 'lieu_station_latitude'
tbl.champ_id = 'guid'
tbl.champ_longitude = "lieu_station_longitude"
tbl.champ_latitude = "lieu_station_latitude"
tbl.champ_id = "guid"
/trunk/scripts/modules/maillage_projet/sources/baznat.ini
1,5 → 1,5
[champs]
 
tbl.champ_longitude = 'longitude'
tbl.champ_latitude = 'latitude'
tbl.champ_id = 'guid'
tbl.champ_longitude = "longitude"
tbl.champ_latitude = "latitude"
tbl.champ_id = "guid"
/trunk/scripts/modules/maillage_projet/MaillageProjet.php
177,7 → 177,7
$aInserer = $this->mailles->formaterPourInsertionBdd();
$champsTable = Config::get('champs_table_mailles');
$tableInsertion = 'mailles_'.$this->nomSource;
$ordresInsertion = [];
$ordresInsertion = array();
$this->getBdd()->requeter("DELETE FROM {$tableInsertion} WHERE zoom={$aInserer[0]['zoom']}");
foreach ($aInserer as $ligne) {
$codeMaille = $this->nomSource.'.'.$ligne['zoom'].'-'.$ligne['indexLat'].'-'.$ligne['indexLng'];
/trunk/scripts/modules/tuilage/Tuilage.php
51,6 → 51,7
private function genererTuilage() {
if (!$this->estTableCreee()) {
$this->creerStructureTable();
print("Table créée");
}
$niveauxZoom = range(Config::get('zoom_minimal'), Config::get('zoom_maximal'), 1);
foreach ($niveauxZoom as $zoom) {
58,14 → 59,16
$this->resolution = $this->resolutionInitiale / pow(2, $zoom);
$coordonneesLng = $this->calculerCoordonneesLimitesTuiles($zoom, 'lng');
$coordonneesLat = $this->calculerCoordonneesLimitesTuiles($zoom, 'lat');
print("mailles calculées\n");
$this->ajouterMaillesDansBdd($zoom, $coordonneesLng, $coordonneesLat);
}
}
private function estTableCreee() {
print("test table");
$tables = $this->getBdd()->recupererTous("SHOW TABLES FROM ".Config::get('bdd_nom'));
$table = Config::get('eflore_table_mailles');
for ($index = 0; $index < count($tables) && $tables[$index]['Tables_in_tb_eflore'] != $table; $index ++);
for ($index = 0; $index < count($tables) && $tables[$index]['Tables_in_tb_eflore_test'] != $table; $index ++);
return $index < count($tables);
}
113,14 → 116,35
$nomsChamps = Config::get('eflore_champs_table');
$this->getBdd()->requeter("DELETE FROM {$table} WHERE zoom=$zoom");
$insertions = array();
for ($index = 0; $index < count($coordonneesLng)-1; $index ++) {
$insertions[] = "({$zoom},'lng',{$index},".$coordonneesLng[$index].",".$coordonneesLng[$index+1].")";
$j = 10000;
if (count($coordonneesLng) > $j) {
for ($i=0; $i < count($coordonneesLng); $i=$i+$j) {
$insertions = array();print($i." ".$j." ");
if ($i+$j > count($coordonneesLng)) {
$k =count($coordonneesLng) - 1;
} else {
$k = $i+$j;
} print_r($k."\n");
for ($index = $i; $index < $k; $index ++) {
$insertions[] = "({$zoom},'lng',{$index},".$coordonneesLng[$index].",".$coordonneesLng[$index+1].")";
}
for ($index = $i; $index < $k; $index ++) {
$insertions[] = "({$zoom},'lat',{$index},".$coordonneesLat[$index].",".$coordonneesLat[$index+1].")";
}
$requete = "INSERT INTO {$table}({$nomsChamps}) VALUES ".implode(',', $insertions);
$this->getBdd()->requeter($requete);
}
} else {
for ($index = 0; $index < count($coordonneesLng)-1; $index ++) {
$insertions[] = "({$zoom},'lng',{$index},".$coordonneesLng[$index].",".$coordonneesLng[$index+1].")";
}
for ($index = 0; $index < count($coordonneesLat)-1; $index ++) {
$insertions[] = "({$zoom},'lat',{$index},".$coordonneesLat[$index].",".$coordonneesLat[$index+1].")";
}
$requete = "INSERT INTO {$table}({$nomsChamps}) VALUES ".implode(',', $insertions);
$this->getBdd()->requeter($requete);
}
for ($index = 0; $index < count($coordonneesLat)-1; $index ++) {
$insertions[] = "({$zoom},'lat',{$index},".$coordonneesLat[$index].",".$coordonneesLat[$index+1].")";
}
$requete = "INSERT INTO {$table}({$nomsChamps}) VALUES ".implode(',', $insertions);
$this->getBdd()->requeter($requete);
}
private function getBdd() {
/trunk/scripts/modules/tuilage/tuilage.ini
10,5 → 10,5
taille_mailles_px = 32
 
[bdd]
eflore_table_mailles = 'mailles_index'
eflore_champs_table = 'zoom,axe,position,debut,fin'
eflore_table_mailles = "mailles_index"
eflore_champs_table = "zoom,axe,position,debut,fin"