简介

  • org2ogr是OGR模块中提供的一个重要工具,用于对数据源进行格式转换

使用方式

  • 命令行参数
  • [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 ||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"]*

例子

  • shape 转mapinfo文件
  • ogr2ogr  -f "MapInfo File" -fieldTypeToString "Integer64" road Railway.shp
  • shape转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 

ogr2ogr使用的更多相关文章

  1. ogr2ogr: Export Well Known Text (WKT) for one feature to a CSV file

    Perhaps you’re looking for this? ogr2ogr -f “CSV” “E:\4_GIS\NorthArkCartoData\UnitedStates\MO_wkt” “ ...

  2. GADL针对矢量数据格式转换的实用工具 —— ogr2ogr

    最初,因为可爱的学弟请教如何将ESRI Shapefile文件导入Google Earth接触到了Ogr2Ogr.粗略了解之后发现,这小东西功能强大. 谷歌地球支持矢量数据的展示,前提是数据符合KML ...

  3. ogr ogr2ogr 矢量数据格式转换 ogrinfo 矢量数据图层信息操作 ogr gdal的一部分 gdal 命令行 库操作

  4. 将SHP导入MySQL中

    ogr2ogr -f MySQL MySQL:smfs,host=127.0.0.1,user=root,password=gis D:\spatialData\HB\HuBeiPicture\HuB ...

  5. 使用FWTools来导入shp数据到mysql

    使用FWTools来导入shp数据到mysql 参考地址 http://forums.mysql.com/read.php?23,122827,206841 软件下载链接 http://fwtools ...

  6. 将数据导入PostGIS

    #!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess # database options db_schema = " ...

  7. UDF2

    问题 根据给定的gps点point(x,y)和北京的shape数据,关联出 AOI ID IO 输入 gps点表 create table gps ( x double, //经度 y double ...

  8. GeoServer+MySQL安装及配置过程

    GeoServer的安装配置请参考 http://simen-net.iteye.com/blog/609078 由于大部分WEBGIS不仅仅只是一个地图的显示,还需要一些业务处理,会有用到数据库地方 ...

  9. 部分GDAL工具功能简介

    主要转自http://blog.csdn.net/liminlu0314?viewmode=contents 部分GDAL工具功能简介 gdalinfo.exe 显示GDAL支持的各种栅格文件的信息. ...

随机推荐

  1. for ++i i++

    study from: https://zhidao.baidu.com/question/339305815.html 处理方式的不同,速度上的微妙不同 有些高手能喜欢用++i,速度上快一点

  2. 基础篇:6.5)形位公差-公差带 Tolerance Zone

    本章目的:了解14个形位公差的公差带形状,其从属关系. 1.定义 公差带-实际被测要素允许变动的区域. 它体现了对被测要素的设计要求,也是加工和检验的根据. 2.公差带四大特征-形状.大小.方向.位置 ...

  3. stark - 1 ⇲一些理念

    ⒈.django项目启动时,自定义执行某个py文件. 在任意的app的apps.py中的Config类中定义ready方法,并调用autodiscover_modules from django.ap ...

  4. 01-复杂度2 Maximum Subsequence Sum (25 分)

    Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to ...

  5. springMVC的一些入门配置

    1.springMVC的描述 1.1.SpringMVC是Spring框架内置的MVC的实现.SpringMVC就是一个Spring内置的MVC子框架. 1.2.SpringMVC的作用是实现页面和后 ...

  6. tomcat各文件夹及作用

    1.bin目录:这个文件夹包含的是启动/关闭tomcat的脚本 2.conf目录:主要是用来存放一些Tomcat的配置文件,都是一些.xml部署文件,其中重要的有: server.xml:是Tomca ...

  7. Java 数组实现堆栈操作

    class Stack { private int stck[] ; private int tos ; Stack(int size) { // 一个参数的构造参数 stck = new int[s ...

  8. DB2 锁问题的监控和解决

    常见的锁问题包括: 锁等待 锁超时 锁升级 死锁 而根据问题的特性通常分为两种: 实时事件:问题正在发生 历史事件:问题已经过去 如果实时事件,DBA 可以通过查看表信息.GET SNAPSHOT 或 ...

  9. 安装和部署Jenkins

    安装和部署Jenkins 环境 操作系统:ubuntu 14.04.4 LTS 下载Jenkins wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/ ...

  10. Java的协变、逆变与不可变

    package javase; import java.util.ArrayList; import java.util.List; class Animal{ } class Cat extends ...