shapefile文件转Postgis

1891阅读 0评论2008-08-28 protagonist
分类:

[root@sip home]# cd test/
[root@sip test]# ls
res1_4m.dbf  res1_4m.shp  res1_4m.shx
// -W GBK 解决中文编码的问题
[root@sip test]# shp2pgsql -W GBK res1_4m.shp cities > cities.sql
Shapefile type: Point
Postgis type: POINT[2]
[root@sip test]# ls
cities.sql  res1_4m.dbf  res1_4m.shp  res1_4m.shx
[root@sip test]#
[root@sip test]# su postgres
bash-3.1$
bash-3.1$ psql -d gis -f cities.sql
SET
BEGIN
psql:cities.sql:13: NOTICE:  CREATE TABLE will create implicit sequence "cities_gid_seq" for serial column "cities.gid"
psql:cities.sql:13: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "cities_pkey" for table "cities"
CREATE TABLE
                addgeometrycolumn                 
--------------------------------------------------
 public.cities.the_geom SRID:-1 TYPE:POINT DIMS:2
 
(1 row)

INSERT 0 1
INSERT 0 1
...

INSERT 0 1
INSERT 0 1
COMMIT
bash-3.1$


 
上一篇:postgresql rpm包安装顺序
下一篇:[zt]C compiler cannot create executables