[postgis-users] RE Importing shapefiles to PostGIS

Ben Madin lists at remoteinformation.com.au
Fri Jan 29 01:15:43 PST 2010


Shreerang,

Here is a quick example of how it looks for me:

minmin:~ $ shp2pgsql -s 4326 -I /Users/minmin/Spatial/country/AUS/australia.shp public.australia > australia.sql
Shapefile type: Polygon
Postgis type: MULTIPOLYGON[2]
minmin:~ $ psql australiapsql (8.4.2)
Type "help" for help.

australia=# \i ./australia.sql
SET
BEGIN
psql:./australia.sql:14: NOTICE:  CREATE TABLE will create implicit sequence "australia_gid_seq" for serial column "australia.gid"
psql:./australia.sql:14: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "australia_pkey" for table "australia"
CREATE TABLE
                       addgeometrycolumn                       
---------------------------------------------------------------
 public.australia.the_geom SRID:4326 TYPE:MULTIPOLYGON DIMS:2 
(1 row)

INSERT 0 1
CREATE INDEX
COMMIT
australia=# VACUUM ANALYZE australia;
VACUUM
australia=# \dt
                List of relations
   Schema   |       Name       | Type  |  Owner   
------------+------------------+-------+----------
 public     | geometry_columns | table | ben
 public     | spatial_ref_sys  | table | ben
 public     | australia        | table | ben


You may want to actually check inside the .sql file you have written to find the commands it created, and try copy / paste them into the psql console if it really isn't working.

cheers

Ben



On 29/01/2010, at 14:18 , Shreerang Patwardhan wrote:

> Hello Ben,
>       Ya!! There are no more authentication errors!! But how do I verify that my data has been uploaded to postgis? In pgadmin I can't see any tables in my database- testdb. However, if I use the PSQL utility in pgadmin for testdb then I am able to see the contains of the 2 tables. Is this sufficient to verify that the data has been loaded into postgis? If not, then pleasse suggest something to verify..
> 
> Thanx,
> Shreerang.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list