src/hdalab/README.txt
author cavaliet
Thu, 26 Jun 2014 15:41:02 +0200
changeset 286 5e98984bbfc9
parent 272 1c774f7a0341
child 355 5d6d75e21634
permissions -rw-r--r--
correct date management (finally fully reworks !)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
130
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     1
== Inclusion géographique ==
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     2
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     3
La migration 0007_geographic_inclusion crée les tables nécessaires
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     4
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     5
Pour récupérer les informations d'inclusion géographique de DBpedia (nécessite le package python SparqlWrapper)
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     6
    python manage.py query_geo_inclusion
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     7
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     8
== Traitement du fichier countries.geo.json ==
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
     9
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    10
Le fichier a été téléchargé sur https://github.com/johan/world.geo.json/
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    11
Afin de faire correspondre les labels des pays aux tags sémantisés, on applique le script
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    12
    python manage.py geojson_transform <chemin/nom_du_fichier.geo.json>
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    13
pour rajouter ces informations dans le fichier
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    14
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    15
== Import des données Insee ==
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    16
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    17
La migration 0008_datasheet_insee crée les tables nécessaires
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    18
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    19
Il faut d'abord importer les fichiers donnant les coordonnées géographiques par code Insee dans la base.
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    20
Le fichier data/villes.csv a été téléchargé sur http://www.pillot.fr/cartographe/fic_villes.php
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    21
Il manque dans ce fichier quelques villes et les codes INSEE pour Paris, Marseille et Lyon n'incluent pas les arrondissements
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    22
Les communes manquantes se trouvent dans additional_cities.csv
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    23
Pour importer chacun de ces fichiers :
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    24
    python manage.py import_insee_csv <chemin/nom_du_fichier.csv>
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    25
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    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
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    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
c8af52e4a047 Information about migrations
veltr
parents: 127
diff changeset
    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
92d733f0d179 Add some trace.
ymh <ymh.work@gmail.com>
parents: 227
diff changeset
    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
92d733f0d179 Add some trace.
ymh <ymh.work@gmail.com>
parents: 227
diff changeset
    47