I'm not able to add SQL file to postgresql database

المشرف العام

Administrator
طاقم الإدارة
I started with basics and did these steps:

  • createdb -U postgres -E UTF8 -O Peete gis -OK
  • createlang -U postgres plpgsql gis (was already installed) -OK
  • psql -U postgres -d gis -f PATH_TO_POSTGRES/share/contrib/postgis-2.1/postgis.sql -OK
  • psql -U postgres -d gis -f PATH_TO_FILE/4326.sql (I downloaded file from Spatialreference and chose "PostGIS spatial_ref_sys INSERT statement") - OK
  • Then i ran this command shp2pgsql -c -s 4326 -I roads.shp > roads.sql-OK
  • Now i wanted to add this SQL file to my database created above so i ran this command psql -d gis -f roads.sql-FAILED
I got this error message:

ERROR: AddGeometryColumn() - invalid SRID

CONTEXT: SQL statement "SELECT AddGeometryColumn('',$1,$2,$3,$4,$5,$6,$7)"

PL/pgSQL function addgeometrycolumn(character varying,character varying,character varying,integer,character varying,integer,boolean) line 5 at SQL statement********** Error **********

The shapefile i'm using is in WGS84 coordinate system EPSG:4326

Any recommendations?



أكثر...
 
أعلى