SHP导入POSTGIS数据库

引用
直接导入数据库 shp2pgsql  -I -s 2437 -W GBK shop_point.shp public.ntable | psql -U postgres -w -d jwsz 导出sql再导入数据库 shp2pgsql -s "2437" -W "GBK" -I D:\shop_point.shp newTable > D:\shop_point.sql psql -U postgres -f D:/shop_point.sql jwsz -P 123456

POSTGIS数据库导出SHP:生成shp数据 //windows导出乱码解决办法:在环境变量中设置 PGCLIENTENCODING=GBK或PGCLIENTENCODING=GB18030,然后执行pgsql2shp,导出的shape文件中,属性数据编码正确是GBK的,没有显示乱码。

引用
pgsql2shp -f shop_point -h localhost -u postgres -P 123456 jwsz public.shop_point pgsql2shp -g the_geom -f D:\shp.shp -u postgres -P 123456 -h 127.0.0.1 jwsz "select the_geom,name from shop_point" pgsql2shp -f shop_point -h localhost -u postgres -P 123456 jwsz "select the_geom,name from shop_point"
引用
@echo -d 删除现有的表,并重新创建进行插入  @echo -a 向现有的表中插入,表必须存在  @echo -c 创建表并进行插入  @echo -p 只进行表的创建
shp2pgsql -s 4326 -W GBK CheckWell_point.shp public.CheckWell_point>CheckWell_point.sql
shp2pgsql -s 4326 -W GBK CheckWell_point.shp public.CheckWell_point psql -U postgres -w -d jwsz
@echo 导入  shp2pgsql -s 4326 -a -W GBK CheckWell_point.shp public.CheckWell_point>CheckWell_point.sql psql -U postgres -w -d jwsz -f CheckWell_point.sql -e  @echo 导出  pgsql2shp.exe -f CheckWell_point -P 123456 -u postgres jwsz public.CheckWell_point
@echo 删除并更新  点数据 shp2pgsql -s 4326 -d -W GBK CheckWell_point.shp public.CheckWell_point|psql -U postgres -w -d jwsz @echo 尝试创建  线数据 shp2pgsql -s 4326 -p -W GBK CableLine_polyline.shp public.CableLine_polyline|psql -U postgres -w -d jwsz @echo 数据追加  线数据 shp2pgsql -s 4326 -a -W GBK CableLine_polyline.shp public.CableLine_polyline|psql -U postgres -w -d jwsz
@echo 尝试创建  面数据 shp2pgsql -s 4326 -p -W GBK Bridge_region.shp public.Bridge_region|psql -U postgres -w -d jwsz @echo 数据追加  面数据 shp2pgsql -s 4326 -a -W GBK Bridge_region.shp public.Bridge_region|psql -U postgres -w -d jwsz pause

shp2pgsql命令相关参数

引用
RCSID: $Id: shp2pgsql-core.h 5983 2010-09-19 11:27:05Z mcayland $ RELEASE: 1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 USAGE: shp2pgsql [<options>] <shapefile> [<schema>.]<table> OPTIONS:   -s <srid>  Set the SRID field. Defaults to -1.   (-d|a|c|p) These are mutually exclusive options:       -d  Drops the table, then recreates it and populates           it with current shape file data.       -a  Appends shape file into current table, must be           exactly the same table schema.       -c  Creates a new table and populates it, this is the           default if you do not specify any options.       -p  Prepare mode, only creates the table.   -g <geocolumn> Specify the name of the geometry/geography column      (mostly useful in append mode).   -D  Use postgresql dump format (defaults to SQL insert statments.   -G  Use geography type (requires lon/lat data).   -k  Keep postgresql identifiers case.   -i  Use int4 type for all integer dbf fields.   -I  Create a spatial index on the geocolumn.   -S  Generate simple geometries instead of MULTI geometries.   -W <encoding> Specify the character encoding of Shape's      attribute column. (default : "WINDOWS-1252")   -N <policy> NULL geometries handling policy (insert*,skip,abort)   -n  Only import DBF file.   -?  Display this help screen.

pgsql2shp命令相关参数

引用

RCSID: $Id: pgsql2shp.c 5451 2010-03-22 19:38:40Z pramsey $ RELEASE: 1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 USAGE: pgsql2shp [<options>] <database> [<schema>.]<table>        pgsql2shp [<options>] <database> <query>
OPTIONS:   -f <filename>  Use this option to specify the name of the file      to create.   -h <host>  Allows you to specify connection to a database on a      machine other than the default.   -p <port>  Allows you to specify a database port other than the default.   -P <password>  Connect to the database with the specified password.   -u <user>  Connect to the database as the specified user.   -g <geometry_column> Specify the geometry column to be exported.   -b Use a binary cursor.   -r Raw mode. Do not assume table has been created by       the loader. This would not unescape attribute names      and will not skip the 'gid' attribute.   -k Keep postgresql identifiers case.   -? Display this help screen.

PostGIS导入导出SHP文件常用命令的更多相关文章

  1. oracle数据库导入导出dmp文件oracle命令

    在控制台下导入imp scott/密码@orcl file=文件路径 full=Y 导出 整个数据库TEST 用户名system  密码1234 exp system/1234@TEST file=文 ...

  2. MYSQL导入导出.sql文件

    MYSQL导入导出.sql文件   一.MYSQL的命令行模式的设置:桌面->我的电脑->属性->环境变量->新建->PATH=“:path\mysql\bin;”其中p ...

  3. Web直接导入导出SHP/CAD实现探讨。

    1.导入SHP/CAD文件 WEB具有直接美观展现功能,功能实现到可视化最好不要超过3S,那么就要限制导入文件的大小和优化算法了. 1.1.SHP导入实现思路 SHP格式开源,Git上随便可以找到读取 ...

  4. oracle导入导出 dmp文件

    oracle导入导出 dmp文件: 打开cmd窗口,在cmd窗口下,按照个人需要输入以下对应的命令: 1.imp 用户名/密码@网络服务名 file=XXX.dmp fromuser=XXX tous ...

  5. linux 学习3 第四讲 文件常用命令

    好几天没有在网上总结了.我把ppt先誊写在本子上,这样听的时候记录就方便很多,添些东西就可以. 我想先看shell那部分,但是没有之前几章的准备,是没法跟着视频动手操作的.所以还是按部就班得学习. 虽 ...

  6. 【转】 (C#)利用Aspose.Cells组件导入导出excel文件

    Aspose.Cells组件可以不依赖excel来导入导出excel文件: 导入: public static System.Data.DataTable ReadExcel(String strFi ...

  7. (C#)利用Aspose.Cells组件导入导出excel文件

    Aspose.Cells组件可以不依赖excel来导入导出excel文件: 导入: public static System.Data.DataTable ReadExcel(String strFi ...

  8. Orcle导入导出dmp文件

    --Orcle导入导出dmp文件 --------------------------2013/12/06 导出表:   exp scott/tiger@mycon tables=(dept,emp) ...

  9. [转帖]linux下查找文件及查找包含指定内容的文件常用命令。

    linux下查找文件及查找包含指定内容的文件常用命令. https://blog.csdn.net/yangyu19910407/article/details/18266821 最简单的查找 fin ...

随机推荐

  1. [总结] I/O输入,输出

    I/O输入,输出第一:先判断到底是输入还是输出,站在程序的立场第二:判断是传递字节,还是字符,决定管道粗细,字节流是最基本的数据输出管道.字符类型管道专门用来传送文本数据.Java流的四大父类:1.字 ...

  2. zTree Jquery eCharts

    (function(){ var setting = { view:{ dblClickExpand:false, expandSpeed:300 }, data: { simpleData: { e ...

  3. UEFI引导在GPT分区下安装win2008——抓住那只傲娇的win2008

    上周遇到个客户DELL R520的服务器新采购了8块3T硬盘做备份服务器,raid配置5+1,一个磁21.8T.先用普通的装desktop OS的方法发现进去没raid盘,然后就按照官方的文档进入Li ...

  4. Bringing the activity to foreground 将activity切换到前台

    今天遇到这个问题,找了很久,网上一些解决方法不够完全.特做此记录: 经测试以下方法不能将在后台运行的activity切换到前台运行! Intent i = new Intent(); i.setCla ...

  5. mysql 每秒钟查询次数、插入次数、删除次数、更新次数的统计

    -show global status where Variable_name in('com_select','com_insert','com_delete','com_update'); 查询出 ...

  6. 基于bootstrap 的datatable插件的使用(php版)

    Datatables是一款jquery表格插件.它是一个高度灵活的工具,可以将任何HTML表格添加高级的交互功能.详细学习请参考其官网:http://datatables.net/中文网:http:/ ...

  7. Submit Text 快捷键总结

    Ctrl+D : 选择单词,重复可增加选择下一个相同的单词Ctrl+F : 查找内容Ctrl+G : 跳转到指定行Ctrl+H : 替换    Ctrl+J : 合并行(已选择需要合并的多行时)Ctr ...

  8. IE兼容性的注意点

    IE会将注释节点实现为元素,所以在IE中调用getElementsByTagName里面会包含注释节点,这个通常是不应该的 getElementById的参数在IE8及较低的版本不区分大小写 IE7及 ...

  9. Jquery 下实现 图片大图预览效果

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...

  10. 用STM32CubeMX创建FreeRTOS项目

    1. 目标, PG13,PG14双线程双闪灯. 2. 测试平台 stm32f429i-disco keil v5.13.0.0 CubeMx 4.8.0 3. 步骤 3.1 打开cube, PG13, ...