/* Démarche d'import dans la table des sites d'un nouveau site
 - Créer un shapfile contenant les objets nouveaux
 - Gérer comme on peut l'encodage (de toute façon, ca marche pas...)
 - générer un fichier SQL d'import depuis un shell fwtools :
"shp2pgsql -s 2154 -a -g the_geom -i -I -W UTF-8 monshapefile_new.shp s_sites_niv1 > import.sql"
 - dans Geany, faire les modifications suivantes :
	- passer le nom des champs en majuscule sauf the_geom
	- ajouter le champ "gid" et ajouter une valeur d'increment par objet (se référer aux dernières valeurs de gid dans la table)
 - dans pgadmin, lancer la requête en tant qu'administrateur

*/


SET CLIENT_ENCODING TO UTF8;
SET STANDARD_CONFORMING_STRINGS TO ON;
BEGIN;
INSERT INTO "s_sites_niv1" ("gid","NOM_SITE","TMILIEUX","SURFACQU","SURFBAIL","SURFCONV","SURFTOTSIG","IDFCEN","CEN","ID","CODEREG","CODEDEPT","CODESITE","REFNUM","ECHELLENUM","SURFAUTR","SURFBAILRU","SURFBAILPR","SURFCONVT","SURFTOTTM","SURFTOTTMF","TMBAILRU","TMBAILPR","TMCONVT","TMAUTR","TMACQ","TMBAIL","AUTRES","TMCONV","SUFRTOTMU","RNN","RNR","APPB","CODSIT",the_geom) VALUES ('76','Etang Thomas (L)',NULL,'13.630000','0.000000','0.000000','0.000000','0','Conservatoire du Patrimoine Naturel de la Région Centre','0','24','36','THOM','Plan cadastral informatisé','3000','0.000000','0.000000','0.000000','0.000000','13.630000','13.630000',NULL,NULL,NULL,NULL,'tmacqu',NULL,NULL,NULL,'0.000000',NULL,NULL,NULL,'36015A','01060000206A0800000100000001030000206A080000010000003F00000004A15273083B21418410D41EFE465941D07A58F6233B214147D8A6A600475941394409815B3B21419761AFA5054759419E11614A633B2141B461E79B044759419AA3324C8C3B21414A106432004759417F79C12E893B214193EA9B29FA465941EBB0A0B7973B2141FBC40B17F34659413C7FB832973B2141BAD71A3FF2465941E19155988D3B214137615AC9F0465941FD397396A83B2141E2DD7EEEED465941F261BDD8CA3B2141EA0F0F56EB465941A8FD2C1DD23B21415999157FE5465941BC7EC08AC23B214192D76F1BE5465941479E0352A13B21418E22ACBBE1465941F59095E6953B2141B40F2BD1D94659419FD6A28CA73B2141D585D036D04659410465A465A33B2141C234F5AFC8465941A0544F6DBF3B2141B5539440C04659419102940D9A3B214125DD9A69BA4659418959B65D873B2141E727671DB94659417A85A7DE793B2141147F6DF2B7465941E34281C5403B21412F859840AF46594110FFF3821E3B2141F54C31FCA7465941F2D829A4EB3A214190728742A54659413394DCAFD13A2141F3522454A0465941E8B19F13C13A2141D51AF505984659413DEEE58C973A2141D7D5ABBD934659417FA998987D3A2141BD5240CF8E4659419B95A3151E3A21410178EE328F46594137854E1D3A3A2141A6402FD1A64659413C32D30B1D3A2141B8910A58AE4659412B626BCBDF3921418B3A0483AF465941088F1CFEC939214133026548A9465941B50302B2A6392141F1976D9CA4465941EA68521F9739214152BD53F6A3465941E141C88E6C392141F54C31FCA7465941C25964509C3921411AF646A2B946594164F693469B3921412160CE61C046594181604BA453392141552EAEE6C046594194E1DE1144392141BB8B1700B646594125AEA6C705392141B0A4C338B5465941AB2065A001392141E8AA267DAB465941BEA1F80DF2382141AAF5F230AA46594165AD465271382141E8AA267DAB4659416F07502F37382141B697FDAFA64659418D71078DEF372141056C08839E465941CE2CBA98D53721416FBD8BECA2465941EA562BB6D83721414D85D036AE465941951AE53C023821415B21E85DB246594177B02DDF4938214105E355CBB3465941C2926A7B5A3821415D1BF505BA46594169DC1E603C3821413479B290BE46594169DC1E603C38214180CAFD03C44659416A5ACB405438214139288398C94659419325CC90C9382141552EAEE6C0465941EDDB17ACE7382141E5A4A7BDC6465941F306497BE23821417460EADCD0465941D5E07E9CAF382141765AF784D84659418AFE41009F382141B40F2BD1D9465941367E0E0843392141D9F037CFF4465941223BE13AB539214184B2A53CF6465941952685C79D3A2141FF994D750647594104A15273083B21418410D41EFE465941');
CREATE INDEX "s_sites_niv1_the_geom_gist" ON "s_sites_niv1" using gist ("the_geom" gist_geometry_ops);
END;
