Changes between Version 19 and Version 20 of RNABE download and load


Ignore:
Timestamp:
May 25, 2010 9:42:27 AM (15 years ago)
Author:
celine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RNABE download and load

    v19 v20  
    1717REM se placer dans le répertoire ou sont les données 
    1818D: 
    19 cd D:\Celine Jouanin\RNABE\France_RW 
     19cd D:\Celine Jouanin\RNABE\France_RNABE 
    2020}}} 
    2121{{{ 
    2222C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_RWBody_Merge.shp Fr_RWBody > Fr_RWBody.sql 
     23C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_CWBody_Merge.shp Fr_CWBody > Fr_CWBody.sql 
     24C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_GWBody_Merge.shp Fr_GWBody > Fr_GWBody.sql 
     25C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_LWBody_Merge.shp Fr_LWBody > Fr_LWBody.sql 
     26C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_TWBody_Merge.shp Fr_TWBody > Fr_TWBody.sql 
    2327}}} 
    2428    * Convert it into utf8  (as the database is posgis), in notepad, open the Fr_RWBody.sql file and convert it to utf8 
    2529Encodage> Convertir en UTF-8 
    2630 
    27 And save the file as : Fr_RWBodyutf8 
     31And save the file as : Fr_RWBodyutf8, Fr_CWBodyutf8,... 
    2832 
    2933 
    3034    * Use psql to restore the file while connecting to eda2.0 ... change the port if necessary (cedric : 5433) 
    3135{{{ 
    32 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_RWBodyutf8.sql  
     36C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_RWBodyutf8.sql 
     37C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_CWBodyutf8.sql 
     38C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_GWBodyutf8.sql 
     39C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_LWBodyutf8.sql 
     40C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_TWBodyutf8.sql 
    3341}}} 
    3442 
     
    3846CREATE SCHEMA RNABE; 
    3947ALTER TABLE fr_rwbody SET SCHEMA rnabe; 
     48ALTER TABLE fr_cwbody SET SCHEMA rnabe; 
     49ALTER TABLE fr_gwbody SET SCHEMA rnabe; 
     50ALTER TABLE fr_lwbody SET SCHEMA rnabe; 
     51ALTER TABLE fr_twbody SET SCHEMA rnabe; 
    4052}}} 
    4153 
    42 Problème les couches de RNABE et CCM ne se superposent pas --> pas la bonne projection!![[BR]] 
     54== Changement de la projection == 
    4355La projection du RNABE est en fait l'ETRS89 et non pas l'ETRS89-LAEA [[BR]] 
    4456Il faut donc changer le srid 4258 (ETRS89) en 3035 ( ) [[BR]] 
    4557{{{ 
    4658-- 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); 
     59ALTER TABLE rnabe.fr_rwbody DROP CONSTRAINT enforce_srid_the_geom; 
     60UPDATE rnabe.fr_rwbody SET the_geom = ST_transform(the_geom, 3035);  
     61ALTER TABLE rnabe.fr_rwbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 
     62 
     63ALTER TABLE rnabe.fr_cwbody DROP CONSTRAINT enforce_srid_the_geom; 
     64UPDATE rnabe.fr_cwbody SET the_geom = ST_transform(the_geom, 3035);  
     65ALTER TABLE rnabe.fr_cwbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 
     66 
     67ALTER TABLE rnabe.fr_gwbody DROP CONSTRAINT enforce_srid_the_geom; 
     68UPDATE rnabe.fr_gwbody SET the_geom = ST_transform(the_geom, 3035);  
     69ALTER TABLE rnabe.fr_gwbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 
     70 
     71ALTER TABLE rnabe.fr_lwbody DROP CONSTRAINT enforce_srid_the_geom; 
     72UPDATE rnabe.fr_lwbody SET the_geom = ST_transform(the_geom, 3035);  
     73ALTER TABLE rnabe.fr_lwbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 
     74 
     75ALTER TABLE rnabe.fr_twbody DROP CONSTRAINT enforce_srid_the_geom; 
     76UPDATE rnabe.fr_twbody SET the_geom = ST_transform(the_geom, 3035);  
     77ALTER TABLE rnabe.fr_twbody ADD CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 3035); 
    5078}}} 
    5179 
    52 == Autre façon d'importer les données == 
    53 {{{ 
    54 REM se placer dans le répertoire ou sont les données 
    55 D: 
    56 cd D:\Celine Jouanin\RNABE\France_GW 
    57 }}} 
    58 {{{ 
    59 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -I A_GWBody.shp GWBody > GWBody.sql 
    60 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -I -a B1_GWBody.shp GWBody > GWBody.sql 
    61 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I B2_GWBody.shp GWBody > GWBody.sql 
    62 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I C_GWBody.shp GWBody > GWBody.sql 
    63 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I D_GWBody.shp GWBody > GWBody.sql 
    64 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I E_GWBody.shp GWBody > GWBody.sql 
    65 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I F_GWBody.shp GWBody > GWBody.sql 
    66 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I G_GWBody.shp GWBody > GWBody.sql 
    67 C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I H_GWBody.shp GWBody > GWBody.sql 
    68 }}} 
    69  
    70 {{{ 
    71 C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f GWBodyutf8.sql  
    72 }}}