OGR应用

OGR应用

sf2gis@163.com

2015年1月26日

 

1 OGR总览

OGR用于矢量处理,作为GDAL/OGR的一部分发布,全局参数中部分与GDAL共享。

1.1 设置编码类型

参见:GDAL应用.docx中GDAL_FILENAME_IS_UTF8。

2 OGR工具

2.1 ogr2ogr:矢量格式转换,并可以设置各种属性(坐标系转换、属性设置等)

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”

2.2 ogrInfo

2.3 ogrTIndex

2.4 ogrLineRef

 

 

转载自:https://blog.csdn.net/sf2gis2/article/details/43320889

You may also like...