ogrinfo-显示空间数据的相关信息

ogrinfo [-ro] [-q] [-where restricted_where]
               [-spat xmin ymin xmax ymax] [-fid fid]
               [-sql statement] [-al] [-so] [--formats]
               datasource_name [layer [layer ...]]

ogrinfo可将其支持的数据源的各种信息显示到stdout(终端)
-ro: 以只读模式打开
-al: 显示所有层的所有所有元素(参数中不用给出层名)
-so: Summary Only,不显示元素列表,只显示摘要信息,如投影,模式,元素数目和范围
-q: 不显示详细信息,如坐标系统,层模式,元素数目和范围
-where restricted_where: 查询条件
-sql statement: sql查询,"SELECT ... FROM ...",不支持别名
-spat xmin ymin xmax ymax: 仅显示给定范围内的元素
-fid fid: 仅显示指定feature id的feature
--formats: 显示所支持的格式
datasource_name: 数据源名称
layer: 一个或多个需要显示的层名

如果没有给出层名,则会显示可用层的列表及其几何类型,如果指定了层名,则显示它他们的范围,坐标系统,元素数目,几何类型模式以及所有符合查询条件的元素,如果未指定查询条件,则显示所有元素。
显示的几何类型为OGC WKT格式。
Example:

C:\ms4w\Apache\htdocs\workshop\data> ogrinfo airports.shp
INFO: Open of `airports.shp'
      using driver `ESRI Shapefile' successful.
1: airports (Point)

C:\ms4w\Apache\htdocs\workshop\data> ogrinfo -ro -sql "select name,elevation from airports" -where "ELEVATION=1351.0000" airports.shp
INFO: Open of `airports.shp'
      using driver `ESRI Shapefile' successful.

Layer name: airports
Geometry: Point
Feature Count: 1
Extent: (434634.000000, 5228719.000000) - (496393.000000, 5291930.000000)
Layer SRS WKT:
(unknown)
name: String (64.0)
elevation: Real (12.4)
OGRFeature(airports):11
  name (String) = Snells Seaplane Base
  elevation (Real) =    1351.0000
  POINT (444049 5277360)

C:\ms4w\Apache\htdocs\workshop\data> ogrinfo --formats
Supported Formats:
  -> "ESRI Shapefile" (read/write)
  -> "MapInfo File" (read/write)
  -> "UK .NTF" (readonly)
  -> "SDTS" (readonly)
  -> "TIGER" (read/write)
  -> "S57" (read/write)
  -> "DGN" (read/write)
  -> "VRT" (readonly)
  -> "AVCBin" (readonly)
  -> "REC" (readonly)
  -> "Memory" (read/write)
  -> "CSV" (read/write)
  -> "GML" (read/write)
  -> "KML" (read/write)
  -> "SQLite" (read/write)
  -> "ODBC" (read/write)
  -> "PGeo" (readonly)
  -> "PostgreSQL" (read/write)
  -> "MySQL" (read/write)

你可能感兴趣的:(apache,sql,mysql,sqlite,PostgreSQL)