Changes between Version 19 and Version 20 of RNABE download and load
- Timestamp:
- May 25, 2010 9:42:27 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RNABE download and load
v19 v20 17 17 REM se placer dans le répertoire ou sont les données 18 18 D: 19 cd D:\Celine Jouanin\RNABE\France_R W19 cd D:\Celine Jouanin\RNABE\France_RNABE 20 20 }}} 21 21 {{{ 22 22 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_RWBody_Merge.shp Fr_RWBody > Fr_RWBody.sql 23 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_CWBody_Merge.shp Fr_CWBody > Fr_CWBody.sql 24 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_GWBody_Merge.shp Fr_GWBody > Fr_GWBody.sql 25 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_LWBody_Merge.shp Fr_LWBody > Fr_LWBody.sql 26 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_TWBody_Merge.shp Fr_TWBody > Fr_TWBody.sql 23 27 }}} 24 28 * Convert it into utf8 (as the database is posgis), in notepad, open the Fr_RWBody.sql file and convert it to utf8 25 29 Encodage> Convertir en UTF-8 26 30 27 And save the file as : Fr_RWBodyutf8 31 And save the file as : Fr_RWBodyutf8, Fr_CWBodyutf8,... 28 32 29 33 30 34 * Use psql to restore the file while connecting to eda2.0 ... change the port if necessary (cedric : 5433) 31 35 {{{ 32 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_RWBodyutf8.sql 36 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_RWBodyutf8.sql 37 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_CWBodyutf8.sql 38 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_GWBodyutf8.sql 39 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_LWBodyutf8.sql 40 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_TWBodyutf8.sql 33 41 }}} 34 42 … … 38 46 CREATE SCHEMA RNABE; 39 47 ALTER TABLE fr_rwbody SET SCHEMA rnabe; 48 ALTER TABLE fr_cwbody SET SCHEMA rnabe; 49 ALTER TABLE fr_gwbody SET SCHEMA rnabe; 50 ALTER TABLE fr_lwbody SET SCHEMA rnabe; 51 ALTER TABLE fr_twbody SET SCHEMA rnabe; 40 52 }}} 41 53 42 Problème les couches de RNABE et CCM ne se superposent pas --> pas la bonne projection!![[BR]] 54 == Changement de la projection == 43 55 La projection du RNABE est en fait l'ETRS89 et non pas l'ETRS89-LAEA [[BR]] 44 56 Il faut donc changer le srid 4258 (ETRS89) en 3035 ( ) [[BR]] 45 57 {{{ 46 58 -- Problème de script ne fonctionne pas 47 select SRID (the_geom) FROM rnabe.fr_rwbody; 48 SELECT addGeometryColunm('fr_rwbody','the_geom',3035,'MULTILINESTRING',2); 49 UPDATE rnabe.fr_rwbody SET the_geom = ST_tranform(the_geom,3035); 59 ALTER TABLE rnabe.fr_rwbody DROP CONSTRAINT enforce_srid_the_geom; 60 UPDATE rnabe.fr_rwbody SET the_geom = ST_transform(the_geom, 3035); 61 ALTER TABLE rnabe.fr_rwbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 62 63 ALTER TABLE rnabe.fr_cwbody DROP CONSTRAINT enforce_srid_the_geom; 64 UPDATE rnabe.fr_cwbody SET the_geom = ST_transform(the_geom, 3035); 65 ALTER TABLE rnabe.fr_cwbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 66 67 ALTER TABLE rnabe.fr_gwbody DROP CONSTRAINT enforce_srid_the_geom; 68 UPDATE rnabe.fr_gwbody SET the_geom = ST_transform(the_geom, 3035); 69 ALTER TABLE rnabe.fr_gwbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 70 71 ALTER TABLE rnabe.fr_lwbody DROP CONSTRAINT enforce_srid_the_geom; 72 UPDATE rnabe.fr_lwbody SET the_geom = ST_transform(the_geom, 3035); 73 ALTER TABLE rnabe.fr_lwbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 74 75 ALTER TABLE rnabe.fr_twbody DROP CONSTRAINT enforce_srid_the_geom; 76 UPDATE rnabe.fr_twbody SET the_geom = ST_transform(the_geom, 3035); 77 ALTER TABLE rnabe.fr_twbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 50 78 }}} 51 79 52 == Autre façon d'importer les données ==53 {{{54 REM se placer dans le répertoire ou sont les données55 D:56 cd D:\Celine Jouanin\RNABE\France_GW57 }}}58 {{{59 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -I A_GWBody.shp GWBody > GWBody.sql60 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -I -a B1_GWBody.shp GWBody > GWBody.sql61 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I B2_GWBody.shp GWBody > GWBody.sql62 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I C_GWBody.shp GWBody > GWBody.sql63 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I D_GWBody.shp GWBody > GWBody.sql64 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I E_GWBody.shp GWBody > GWBody.sql65 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I F_GWBody.shp GWBody > GWBody.sql66 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I G_GWBody.shp GWBody > GWBody.sql67 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I H_GWBody.shp GWBody > GWBody.sql68 }}}69 70 {{{71 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f GWBodyutf8.sql72 }}}