OGR应用
2015年1月26日
OGR用于矢量处理,作为GDAL/OGR的一部分发布,全局参数中部分与GDAL共享。
参见:GDAL应用.docx中GDAL_FILENAME_IS_UTF8。
Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update]
[-select field_list] [-where restricted_where]
[-progress] [-sql <sql statement>] [-dialect dialect]
[-preserve_fid] [-fid FID]
[-spat xmin ymin xmax ymax] [-geomfield field]
[-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]
[-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...]
dst_datasource_name src_datasource_name
[-lco NAME=VALUE] [-nln name] [-nlt type] [-dim 2|3|layer_dim] [layer [layer ...]]
Advanced options :
[-gt n]
[-clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent]
[-clipsrcsql sql_statement] [-clipsrclayer layer]
[-clipsrcwhere expression]
[-clipdst [xmin ymin xmax ymax]|WKT|datasource]
[-clipdstsql sql_statement] [-clipdstlayer layer]
[-clipdstwhere expression]
[-wrapdateline] [-datelineoffset val]
[[-simplify tolerance] | [-segmentize max_dist]]
[-addfields]
[-fieldTypeToString All|(type1[,type2]*)] [-unsetFieldWidth]
[-fieldmap identity | index1[,index2]*]
[-splitlistfields] [-maxsubfields val]
[-explodecollections] [-zfield field_name]
[-gcp pixel line easting northing [elevation]]* [-order n | -tps]
示例:将当前文件夹下所有shp文件转换为kml
::only after set utf8=no, you can use gbk
set GDAL_FILENAME_IS_UTF8=NO
md kml
for %%i in (*.shp) do ogr2ogr -f KML"kml\%%i.kml" "%%i"