| author | cavaliet |
| Thu, 26 Jun 2014 15:41:02 +0200 | |
| changeset 286 | 5e98984bbfc9 |
| parent 272 | 1c774f7a0341 |
| child 355 | 5d6d75e21634 |
| permissions | -rw-r--r-- |
| 130 | 1 |
== Inclusion géographique == |
2 |
||
3 |
La migration 0007_geographic_inclusion crée les tables nécessaires |
|
4 |
||
5 |
Pour récupérer les informations d'inclusion géographique de DBpedia (nécessite le package python SparqlWrapper) |
|
6 |
python manage.py query_geo_inclusion |
|
7 |
||
8 |
== Traitement du fichier countries.geo.json == |
|
9 |
||
10 |
Le fichier a été téléchargé sur https://github.com/johan/world.geo.json/ |
|
11 |
Afin de faire correspondre les labels des pays aux tags sémantisés, on applique le script |
|
12 |
python manage.py geojson_transform <chemin/nom_du_fichier.geo.json> |
|
13 |
pour rajouter ces informations dans le fichier |
|
14 |
||
15 |
== Import des données Insee == |
|
16 |
||
17 |
La migration 0008_datasheet_insee crée les tables nécessaires |
|
18 |
||
19 |
Il faut d'abord importer les fichiers donnant les coordonnées géographiques par code Insee dans la base. |
|
20 |
Le fichier data/villes.csv a été téléchargé sur http://www.pillot.fr/cartographe/fic_villes.php |
|
21 |
Il manque dans ce fichier quelques villes et les codes INSEE pour Paris, Marseille et Lyon n'incluent pas les arrondissements |
|
22 |
Les communes manquantes se trouvent dans additional_cities.csv |
|
23 |
Pour importer chacun de ces fichiers : |
|
24 |
python manage.py import_insee_csv <chemin/nom_du_fichier.csv> |
|
25 |
||
26 |
Il faut ensuite importer les fichiers donnant la correspondance entre notices HDA (référencées par leur identifiant hda_id) et codes INSEE |
|
27 |
Celles-ci sont fournies dans un fichier Excel donné par Bertrand, que j'ai converti en CSV et corrigé. Il s'agit de data/hda_insee.csv |
|
28 |
Pour importer ce fichier: |
|
|
227
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
29 |
python manage.py import_insee_hda_csv <chemin/nom_du_fichier.csv> |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
30 |
|
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
31 |
|
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
32 |
=== Migration hdabo -> hdalab === |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
33 |
|
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
34 |
0) appliquer les migrations south |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
35 |
1) lancement de la commande query_wikipedia_category |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
36 |
2) lancement de la commande fill_tag_years |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
37 |
3) lancement de la commande query_wikipedia |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
38 |
4) lancement de la commande query_geo_inclusion |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
39 |
5) lancement de la commande geo_json_transform |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
40 |
6) lancement de la commande import_insee_csv |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
41 |
7) lancement de la commande import_hda_insee_csv |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
42 |
8) lancement de la commande query_category_inclusion |
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
43 |
|
| 228 | 44 |
Toutes ces actions sont echaînées dans la commande import_hdabo_db |
|
227
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
45 |
|
|
b0cd3e6e31c7
Update readmin on hdabo -> hdalab migration and update import_hdabo_db management commend
ymh <ymh.work@gmail.com>
parents:
130
diff
changeset
|
46 |
|
| 228 | 47 |