shp2SQL Server用法简析

栏目:MSSQL 来源:网络 关注:0 时间:2019-09-15

shp2SQL Server用法简析

官方说明:
shp2SQL Server 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.

用法:
代码如下:
shp2SQL Server.exe -h
Usage: shp2SQL Server.exe [OPTIONS]+ "connectionString" "path to shapefile"
Loads a shapefile into Microsoft SQL Server 2008
xx: shp2SQL Server.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

示例:
shp2SQL Server -g="SHAPE" -s="4326" -i "Data Source=.;Initial Catalog=largesite;Integrated Security=false;user id=sa;password=123456;" "D:/-/data/-/xyz.shp"

本文标题:shp2SQL Server用法简析
本文地址:http://www.q0738.com/mssql/1443.html