2,143
社区成员
发帖
与我相关
我的任务
分享
cm运行:
D:\Program Files\FWTools2.4.6\bin>ogr2ogr -f "PostgreSQL" PG:"host=localhost use
r=postgres dbname=template_postgis password=123" d:\states.shp
报错:
ERROR 1: INSERT command for new feature failed.
ERROR: new row for relation "states" violates check constraint "enforce_geotype
_wkb_geometry"
Command: INSERT INTO "states" ("wkb_geometry" , "state_name", "state_fips", "sub
_region", "state_abbr", "land_km", "water_km", "persons", "families", "houshold"
, "male", "female", "workers", "drvalone", "carpool", "pubtrans", "employed", "u
nemploy", "service", "manual", "p_male", "p_female", "samp_pop") VALUES (GeomFro
。。。。。。。。。。。
1.000000000, 2318671.000000000, 2462797.000000000, 1783061.000000000, 17
32837.000000000, 376449.000000000, 202169.000000000, 2481342.000000000,
111536.000000000, 586994.000000000, 260308.000000000, 0.4850000
00, 0.515000000, 684773.000000000)
ERROR 1: Terminating translation prematurely after failed
translation of layer states (use -skipfailures to skip errors)
可以看到在template_postgis中已经创建了表states,但是只有表结构
因为PostgresQL支持事务回滚,所以没有了数据,既然支持事务回滚
那表结构也不应该创建啊?
还想问个,如何把dwg格式地图存入postgis里面?
shp导入到postgis已经能用PostgreSQL完成,但是用 org2ogr不知道如何使用?