欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

shp2sqlserver 用法简析

程序员文章站 2022-06-11 11:06:22
shp2sqlserver用法简析 官方说明: shp2sqlserver is a command line tool for loading shapefiles in...
shp2sqlserver用法简析

官方说明:
shp2sqlserver is a command line tool for loading shapefiles into microsoft sql server 2008. it is modeled after postgis's shp2pgsql, except that it loads directly into the database instead of writing sql to stdout.



用法:
复制代码 代码如下:

shp2sqlserver.exe -h
usage: shp2sqlserver.exe [options]+ "connectionstring" "path to shapefile"
loads a shapefile into microsoft sql server 2008

example: shp2sqlserver.exe "data source=.\sqlexpress2008;initial catalog=spatialtest;integrated security=true" myshape.shp

options:
-s, --srid=value the spatial reference id (srid). if not specified it defaults to -1.
-g, --geometry_column=value the name of the geometry column
-t, --table_name=value the table name to use
-k, --key_column=value the name of the identity column to create for a primary key
-i, --index create a spatial index
-l, --latlong add spatial data as geography type
-a, --append append data. if not specified, table will be created
-h, --help show this message and exit


示例:

shp2sqlserver -g="shape" -s="4326" -i "data source=.;initial catalog=largesite;integrated security=false;user id=sa;password=123456;" "d:\data\xyz.shp"

作者 彭金华