wiki:RNABE download and load

Version 17 (modified by celine, 15 years ago) (diff)

--

back to first page ..
back to CookBook Eda
back to RNABE

In ArcGis merge the different layers

To find : if it's possible to do it in Postgre (not in Qgis) ?

Add the differents layers on ArcGis : A_RWBody, B1_RWBody, B2_RWBody, C_RWBody, D_RWBody, E_RWBody, F_RWBody, G_RWBody, H_RWBody.

In Data Management Tools > General > Merge

  • Input Datasets : A_RWBody, B1_RWBody, B2_RWBody, C_RWBody, D_RWBody, E_RWBody, F_RWBody, G_RWBody, H_RWBody.
  • Output Dataset : change the directory if it's necessary and change the name of the shape file : RWBody_Merge.shp

Download the file RWBody_Merge.shp into Postgre

REM se placer dans le répertoire ou sont les données
D:
cd D:\Celine Jouanin\RNABE\France_RW
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 4258 -I Fr_RWBody_Merge.shp Fr_RWBody > Fr_RWBody.sql
  • Convert it into utf8 (as the database is posgis), in notepad, open the stationsp.sql file and convert it to utf8

Encodage> Convertir en UTF-8

And save the file as : Fr_RWBodyutf8

  • Use psql to restore the file while connecting to eda2.0 ... change the port if necessary (cedric : 5433)
    C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f Fr_RWBodyutf8.sql 
    
  • Create schema RNABE et changement du schéma de la table RWBody (qui est sous public)
    --- In sql editor 
    CREATE SCHEMA RNABE;
    ALTER TABLE fr_rwbody SET SCHEMA rnabe;
    

Problème les couches de RNABE et CCM ne se superposent pas --> pas la bonne projection![[BR]] La projection du RNABE est en fait l'ETRS89 et non pas l'ETRS89-LAEA
Il faut donc changer le srid 4258 (ETRS89) en 3035 ( )

-- Problème de script ne fonctionne pas
select SRID (the_geom) FROM rnabe.fr_rwbody;
SELECT addGeometryColunm('fr_rwbody','the_geom',3035,'MULTILINESTRING',2);
UPDATE rnabe.fr_rwbody SET the_geom = ST_tranform(the_geom,3035);

Autre façon d'importer les données

REM se placer dans le répertoire ou sont les données
D:
cd D:\Celine Jouanin\RNABE\France_GW
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -I A_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -I -a B1_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I B2_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I C_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I D_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I E_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I F_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I G_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 3035 -a -I H_GWBody.shp GWBody > GWBody.sql
C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0 -h localhost -U postgres -p 5432 -f GWBodyutf8.sql