ogr 2 ogr使用

3444 ワード

概要
  • org 2 ogrは、データソースをフォーマット変換するためのOGARモジュールに提供される重要なツールである.
    使い方
  • コマンドラインパラメータ
  • [xingxing.dxx@30_28_6_20 J50F001020]$ ogr2ogr --long-usage
    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] [-spat_srs srs_def] [-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|PROMOTE_TO_MULTI|CONVERT_TO_LINEAR]
                   [-dim 2|3|layer_dim] [layer [layer ...]]
    
    Advanced options :
                   [-gt n] [-ds_transaction]
                   [[-oo NAME=VALUE] ...] [[-doo NAME=VALUE] ...]
                   [-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] [-unsetFid]
                   [-relaxedFieldNameMatch] [-forceNullable] [-unsetDefault]
                   [-fieldTypeToString All|(type1[,type2]*)] [-unsetFieldWidth]
                   [-mapFieldType srctype|All=dsttype[,srctype2=dsttype2]*]
                   [-fieldmap identity | index1[,index2]*]
                   [-splitlistfields] [-maxsubfields val]
                   [-explodecollections] [-zfield field_name]
                   [-gcp pixel line easting northing [elevation]]* [-order n | -tps]
                   [-nomd] [-mo "META-TAG=VALUE"]*
     
  • shop-mapinfoファイル
  • ogr2ogr  -f "MapInfo File" -fieldTypeToString "Integer64" road Railway.shp
     
  • shop-GeoJSONフォーマット
  • ogr2ogr  -f "GeoJSON" -fieldTypeToString "Integer64" road Railway.shp
     
  • shape回転wktフォーマット
  • ogr2ogr -lco "GEOMETRY=AS_WKT" -lco "SEPARATOR=TAB" -f CSV railway.csv -sql "select LUA_ID from LandUseArea" LandUseArea.shp