Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1137744
  • 博文数量: 209
  • 博客积分: 4069
  • 博客等级: 上校
  • 技术积分: 2025
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-02 13:51
文章分类
文章存档

2011年(2)

2010年(4)

2009年(63)

2008年(140)

我的朋友

分类:

2008-08-28 17:45:41

[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$


 
阅读(1659) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~