Browse Source
Création d'un nouveau type de service infrasubdivision pour permettre de gérer la nomenclature des infra subdivisions des pays.
Création d'un nouveau type de service infrasubdivision pour permettre de gérer la nomenclature des infra subdivisions des pays.
Ajout des infra subdivisions de la france : communes et arrondisssements (pas de cantons pour l'instant).svn/root/trunk
15 changed files with 38729 additions and 68 deletions
-
25base/isocode_declarations.php
-
127ezrest/isocode.php
-
87ezrest/isocode_openapi.schema.yaml
-
2formulaires/isocode_peupler.php
-
15inc/isocode.php
-
9isocode_administrations.php
-
32isocode_pipelines.php
-
98lang/isocode_fr.php
-
6paquet.xml
-
14prive/squelettes/contenu/isocode_infrasubdivision.html
-
6prive/squelettes/inclure/inc-navigation_isocode.html
-
3prive/squelettes/navigation/isocode_infrasubdivision.html
-
109services/infrasubdivision/infrasubdivision_api.php
-
333services/infrasubdivision/inseearrond_2019.csv
-
37931services/infrasubdivision/inseecommune_2019.csv
@ -0,0 +1,14 @@ |
|||
[(#AUTORISER{webmestre}|sinon_interdire_acces)] |
|||
<h1 class="grostitre"><:isocode:titre_page_infrasubdivision:></h1> |
|||
|
|||
[(#REM) <!-- Liste des infra subdivisions chargées --> ] |
|||
#SET{type_service, infrasubdivision} |
|||
<INCLURE{fond=prive/squelettes/liste/chargements, |
|||
titre=<:isocode:titre_liste_infrasubdivisions:>, |
|||
type_service=#GET{type_service}, |
|||
sinon=<:isocode:notice_infrasubdivision_aucun_chargement:>, |
|||
env, ajax} /> |
|||
|
|||
[<div class="noajax"> |
|||
(#FORMULAIRE_ISOCODE_PEUPLER{#GET{type_service}}) |
|||
</div>] |
@ -0,0 +1,3 @@ |
|||
[(#REM) <!-- Menu des onglets --> ] |
|||
<INCLURE{fond=prive/squelettes/inclure/inc-navigation_isocode, |
|||
env} /> |
@ -0,0 +1,109 @@ |
|||
<?php |
|||
/** |
|||
* Ce fichier contient l'ensemble des constantes et fonctions implémentant le type de service INFRASUBDIVISION. |
|||
* Les services de INFRASUBDIVISION sont des mécanisme internes à Nomenclatures pour |
|||
* charger les codes nationaux des infra subdivisions fournis par des services divers. |
|||
* |
|||
* @package SPIP\ISOCODE\SERVICES\INFRASUBDIVISION |
|||
*/ |
|||
if (!defined('_ECRIRE_INC_VERSION')) { |
|||
return; |
|||
} |
|||
|
|||
|
|||
$GLOBALS['isocode']['infrasubdivision'] = array( |
|||
'inseearrond' => array( |
|||
'table' => 'infrasubdivisions', |
|||
'type' => 'infra_subdivision', |
|||
'pays' => 'FR', |
|||
'basic_fields' => array( |
|||
'arr' => 'code', |
|||
'dep' => 'parent', |
|||
'nccenr' => 'label_fr', |
|||
), |
|||
'static_fields' => array( |
|||
'service' => '$service', |
|||
'type' => 'arrondissement', |
|||
'country' => '/pays', |
|||
), |
|||
'unused_fields' => array( |
|||
'label_fr' => '', |
|||
), |
|||
'label_field' => true, |
|||
'populating' => 'file_csv', |
|||
'multiple' => true, |
|||
'delimiter' => ",", |
|||
'extension' => '.csv', |
|||
), |
|||
'inseecommune' => array( |
|||
'table' => 'infrasubdivisions', |
|||
'type' => 'infra_subdivision', |
|||
'pays' => 'FR', |
|||
'basic_fields' => array( |
|||
'typecom' => 'type', |
|||
'com' => 'code', |
|||
'arr' => 'parent', |
|||
'nccenr' => 'label_fr', |
|||
'can' => 'can', |
|||
'comparent' => 'comparent', |
|||
), |
|||
'static_fields' => array( |
|||
'service' => '$service', |
|||
'country' => '/pays', |
|||
), |
|||
'unused_fields' => array( |
|||
'can' => '', |
|||
'comparent' => '', |
|||
'label_fr' => '', |
|||
), |
|||
'label_field' => true, |
|||
'populating' => 'file_csv', |
|||
'multiple' => true, |
|||
'delimiter' => ",", |
|||
'extension' => '.csv', |
|||
), |
|||
); |
|||
|
|||
// -----------------------------------------------------------------------------------
|
|||
// ---------- API du type de service INFRASUBDIVISION - Actions principales ----------
|
|||
// -----------------------------------------------------------------------------------
|
|||
|
|||
function inseearrond_completer_element($element, $config) { |
|||
|
|||
// Cette fonction permet d'apporter des corrections au champs déjà compilés : attention on a encore les index source !!!
|
|||
// - modifier l'identifiant de l'arrondissement
|
|||
$element['arr'] = 'FR-' . $element['arr']; |
|||
// - Modifier l'identifiant du parent qui est une subdivision
|
|||
$element['dep'] = 'FR-' . $element['dep']; |
|||
|
|||
return $element; |
|||
} |
|||
|
|||
function inseecommune_completer_element($element, $config) { |
|||
|
|||
// Cette fonction permet d'apporter des corrections au champs déjà compilés : attention on a encore les index source !!!
|
|||
// - modifier l'identifiant de l'arrondissement
|
|||
$element['com'] = 'FR-' . $element['com']; |
|||
// - choisir le "bon" parent et modifier son identifiant
|
|||
if ($element['comparent']) { |
|||
$element['arr'] = 'FR-' . $element['comparent']; |
|||
} else { |
|||
$element['arr'] = 'FR-' . $element['arr']; |
|||
} |
|||
// - affiner l'identifiant du type de commune
|
|||
switch ($element['typecom']) { |
|||
case 'COMD': |
|||
$element['typecom'] = 'delegated_commune'; |
|||
break; |
|||
case 'COMA': |
|||
$element['typecom'] = 'associated_commune'; |
|||
break; |
|||
case 'ARM': |
|||
$element['typecom'] = 'municipal_arrondissement'; |
|||
break; |
|||
default: |
|||
$element['typecom'] = 'commune'; |
|||
} |
|||
|
|||
return $element; |
|||
} |
@ -0,0 +1,333 @@ |
|||
arr,dep,nccenr |
|||
011,01,Belley |
|||
012,01,Bourg-en-Bresse |
|||
013,01,Gex |
|||
014,01,Nantua |
|||
021,02,Château-Thierry |
|||
022,02,Laon |
|||
023,02,Saint-Quentin |
|||
024,02,Soissons |
|||
025,02,Vervins |
|||
031,03,Montluçon |
|||
032,03,Moulins |
|||
033,03,Vichy |
|||
041,04,Barcelonnette |
|||
042,04,Castellane |
|||
043,04,Digne-les-Bains |
|||
044,04,Forcalquier |
|||
051,05,Briançon |
|||
052,05,Gap |
|||
061,06,Grasse |
|||
062,06,Nice |
|||
071,07,Largentière |
|||
072,07,Privas |
|||
073,07,Tournon-sur-Rhône |
|||
081,08,Charleville-Mézières |
|||
082,08,Rethel |
|||
083,08,Sedan |
|||
084,08,Vouziers |
|||
091,09,Foix |
|||
092,09,Pamiers |
|||
093,09,Saint-Girons |
|||
101,10,Bar-sur-Aube |
|||
102,10,Nogent-sur-Seine |
|||
103,10,Troyes |
|||
111,11,Carcassonne |
|||
112,11,Limoux |
|||
113,11,Narbonne |
|||
121,12,Millau |
|||
122,12,Rodez |
|||
123,12,Villefranche-de-Rouergue |
|||
131,13,Aix-en-Provence |
|||
132,13,Arles |
|||
133,13,Marseille |
|||
134,13,Istres |
|||
141,14,Bayeux |
|||
142,14,Caen |
|||
143,14,Lisieux |
|||
144,14,Vire |
|||
151,15,Aurillac |
|||
152,15,Mauriac |
|||
153,15,Saint-Flour |
|||
161,16,Angoulême |
|||
162,16,Cognac |
|||
163,16,Confolens |
|||
171,17,Jonzac |
|||
172,17,Rochefort |
|||
173,17,Rochelle |
|||
174,17,Saintes |
|||
175,17,Saint-Jean-d'Angély |
|||
181,18,Bourges |
|||
182,18,Saint-Amand-Montrond |
|||
183,18,Vierzon |
|||
191,19,Brive-la-Gaillarde |
|||
192,19,Tulle |
|||
193,19,Ussel |
|||
211,21,Beaune |
|||
212,21,Dijon |
|||
213,21,Montbard |
|||
221,22,Dinan |
|||
222,22,Guingamp |
|||
223,22,Lannion |
|||
224,22,Saint-Brieuc |
|||
231,23,Aubusson |
|||
232,23,Guéret |
|||
241,24,Bergerac |
|||
242,24,Nontron |
|||
243,24,Périgueux |
|||
244,24,Sarlat-la-Canéda |
|||
251,25,Besançon |
|||
252,25,Montbéliard |
|||
253,25,Pontarlier |
|||
261,26,Die |
|||
262,26,Nyons |
|||
263,26,Valence |
|||
271,27,Andelys |
|||
272,27,Bernay |
|||
273,27,Évreux |
|||
281,28,Chartres |
|||
282,28,Châteaudun |
|||
283,28,Dreux |
|||
284,28,Nogent-le-Rotrou |
|||
291,29,Brest |
|||
292,29,Châteaulin |
|||
293,29,Morlaix |
|||
294,29,Quimper |
|||
2A1,2A,Ajaccio |
|||
2A4,2A,Sartène |
|||
2B2,2B,Bastia |
|||
2B3,2B,Corte |
|||
2B5,2B,Calvi |
|||
301,30,Alès |
|||
302,30,Nîmes |
|||
303,30,Vigan |
|||
311,31,Muret |
|||
312,31,Saint-Gaudens |
|||
313,31,Toulouse |
|||
321,32,Auch |
|||
322,32,Condom |
|||
323,32,Mirande |
|||
331,33,Blaye |
|||
332,33,Bordeaux |
|||
333,33,Langon |
|||
334,33,Lesparre-Médoc |
|||
335,33,Libourne |
|||
336,33,Arcachon |
|||
341,34,Béziers |
|||
342,34,Lodève |
|||
343,34,Montpellier |
|||
351,35,Fougères-Vitré |
|||
352,35,Redon |
|||
353,35,Rennes |
|||
354,35,Saint-Malo |
|||
361,36,Blanc |
|||
362,36,Châteauroux |
|||
363,36,Châtre |
|||
364,36,Issoudun |
|||
371,37,Chinon |
|||
372,37,Tours |
|||
373,37,Loches |
|||
381,38,Grenoble |
|||
382,38,Tour-du-Pin |
|||
383,38,Vienne |
|||
391,39,Dole |
|||
392,39,Lons-le-Saunier |
|||
393,39,Saint-Claude |
|||
401,40,Dax |
|||
402,40,Mont-de-Marsan |
|||
411,41,Blois |
|||
412,41,Vendôme |
|||
413,41,Romorantin-Lanthenay |
|||
421,42,Montbrison |
|||
422,42,Roanne |
|||
423,42,Saint-Étienne |
|||
431,43,Brioude |
|||
432,43,Puy-en-Velay |
|||
433,43,Yssingeaux |
|||
442,44,Nantes |
|||
443,44,Saint-Nazaire |
|||
445,44,Châteaubriant-Ancenis |
|||
451,45,Montargis |
|||
452,45,Orléans |
|||
453,45,Pithiviers |
|||
461,46,Cahors |
|||
462,46,Figeac |
|||
463,46,Gourdon |
|||
471,47,Agen |
|||
472,47,Marmande |
|||
473,47,Villeneuve-sur-Lot |
|||
474,47,Nérac |
|||
481,48,Florac |
|||
482,48,Mende |
|||
491,49,Angers |
|||
492,49,Cholet |
|||
493,49,Saumur |
|||
494,49,Segré |
|||
501,50,Avranches |
|||
502,50,Cherbourg |
|||
503,50,Coutances |
|||
504,50,Saint-Lô |
|||
511,51,Châlons-en-Champagne |
|||
512,51,Épernay |
|||
513,51,Reims |
|||
514,51,Vitry-le-François |
|||
521,52,Chaumont |
|||
522,52,Langres |
|||
523,52,Saint-Dizier |
|||
531,53,Château-Gontier |
|||
532,53,Laval |
|||
533,53,Mayenne |
|||
541,54,Briey |
|||
542,54,Lunéville |
|||
543,54,Nancy |
|||
544,54,Toul |
|||
551,55,Bar-le-Duc |
|||
552,55,Commercy |
|||
553,55,Verdun |
|||
561,56,Lorient |
|||
562,56,Pontivy |
|||
563,56,Vannes |
|||
573,57,Forbach-Boulay-Moselle |
|||
575,57,Sarrebourg-Château-Salins |
|||
576,57,Sarreguemines |
|||
577,57,Thionville |
|||
579,57,Metz |
|||
581,58,Château-Chinon (Ville) |
|||
582,58,Clamecy |
|||
583,58,Nevers |
|||
584,58,Cosne-Cours-sur-Loire |
|||
591,59,Avesnes-sur-Helpe |
|||
592,59,Cambrai |
|||
593,59,Douai |
|||
594,59,Dunkerque |
|||
595,59,Lille |
|||
596,59,Valenciennes |
|||
601,60,Beauvais |
|||
602,60,Clermont |
|||
603,60,Compiègne |
|||
604,60,Senlis |
|||
611,61,Alençon |
|||
612,61,Argentan |
|||
613,61,Mortagne-au-Perche |
|||
621,62,Arras |
|||
622,62,Béthune |
|||
623,62,Boulogne-sur-Mer |
|||
624,62,Montreuil |
|||
625,62,Saint-Omer |
|||
626,62,Calais |
|||
627,62,Lens |
|||
631,63,Ambert |
|||
632,63,Clermont-Ferrand |
|||
633,63,Issoire |
|||
634,63,Riom |
|||
635,63,Thiers |
|||
641,64,Bayonne |
|||
642,64,Oloron-Sainte-Marie |
|||
643,64,Pau |
|||
651,65,Argelès-Gazost |
|||
652,65,Bagnères-de-Bigorre |
|||
653,65,Tarbes |
|||
661,66,Céret |
|||
662,66,Perpignan |
|||
663,66,Prades |
|||
672,67,Haguenau-Wissembourg |
|||
673,67,Molsheim |
|||
674,67,Saverne |
|||
675,67,Sélestat-Erstein |
|||
678,67,Strasbourg |
|||
681,68,Altkirch |
|||
682,68,Colmar-Ribeauvillé |
|||
684,68,Mulhouse |
|||
686,68,Thann-Guebwiller |
|||
691,69,Lyon |
|||
692,69,Villefranche-sur-Saône |
|||
701,70,Lure |
|||
702,70,Vesoul |
|||
711,71,Autun |
|||
712,71,Chalon-sur-Saône |
|||
713,71,Charolles |
|||
714,71,Louhans |
|||
715,71,Mâcon |
|||
721,72,Flèche |
|||
722,72,Mamers |
|||
723,72,Mans |
|||
731,73,Albertville |
|||
732,73,Chambéry |
|||
733,73,Saint-Jean-de-Maurienne |
|||
741,74,Annecy |
|||
742,74,Bonneville |
|||
743,74,Saint-Julien-en-Genevois |
|||
744,74,Thonon-les-Bains |
|||
751,75,Paris |
|||
761,76,Dieppe |
|||
762,76,Havre |
|||
763,76,Rouen |
|||
771,77,Meaux |
|||
772,77,Melun |
|||
773,77,Provins |
|||
774,77,Fontainebleau |
|||
775,77,Torcy |
|||
781,78,Mantes-la-Jolie |
|||
782,78,Rambouillet |
|||
783,78,Saint-Germain-en-Laye |
|||
784,78,Versailles |
|||
791,79,Bressuire |
|||
792,79,Niort |
|||
793,79,Parthenay |
|||
801,80,Abbeville |
|||
802,80,Amiens |
|||
803,80,Montdidier |
|||
804,80,Péronne |
|||
811,81,Albi |
|||
812,81,Castres |
|||
821,82,Castelsarrasin |
|||
822,82,Montauban |
|||
831,83,Draguignan |
|||
832,83,Toulon |
|||
833,83,Brignoles |
|||
841,84,Apt |
|||
842,84,Avignon |
|||
843,84,Carpentras |
|||
851,85,Fontenay-le-Comte |
|||
852,85,Roche-sur-Yon |
|||
853,85,Sables-d'Olonne |
|||
861,86,Châtellerault |
|||
862,86,Montmorillon |
|||
863,86,Poitiers |
|||
871,87,Bellac |
|||
872,87,Limoges |
|||
873,87,Rochechouart |
|||
881,88,Épinal |
|||
882,88,Neufchâteau |
|||
883,88,Saint-Dié-des-Vosges |
|||
891,89,Auxerre |
|||
892,89,Avallon |
|||
893,89,Sens |
|||
901,90,Belfort |
|||
911,91,Étampes |
|||
912,91,Évry |
|||
913,91,Palaiseau |
|||
921,92,Antony |
|||
922,92,Nanterre |
|||
923,92,Boulogne-Billancourt |
|||
931,93,Bobigny |
|||
932,93,Raincy |
|||
933,93,Saint-Denis |
|||
941,94,Créteil |
|||
942,94,Nogent-sur-Marne |
|||
943,94,Haÿ-les-Roses |
|||
951,95,Argenteuil |
|||
952,95,Sarcelles |
|||
953,95,Pontoise |
|||
9711,971,Basse-Terre |
|||
9712,971,Pointe-à-Pitre |
|||
9721,972,Fort-de-France |
|||
9722,972,Trinité |
|||
9723,972,Marin |
|||
9724,972,Saint-Pierre |
|||
9731,973,Cayenne |
|||
9732,973,Saint-Laurent-du-Maroni |
|||
9741,974,Saint-Denis |
|||
9742,974,Saint-Pierre |
|||
9743,974,Saint-Benoît |
|||
9744,974,Saint-Paul |
37931
services/infrasubdivision/inseecommune_2019.csv
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue