OGR¶
此插件从支持的任何格式读取矢量数据 OGR Simple Feature Library (相当多)。其中最常见的包括esri shapefiles、gml和postgis。
示例用法:
<model driver="feature_geom">
<features driver="ogr">
<url>data/world_boundaries.shp</url>
</features>
...
性能:
- 网址
加载特征数据的位置
- 连接
如果功能数据在数据库中,请使用此选项指定db连接字符串,而不是使用
url
.- 几何学
指定 内联的 几何图形输入 `OGC WKT format`_ 而不是使用
url
或connection
.- geometry_url
等同于
geometry
但wkt字符串在文件中。- ogr_driver
OGR driver
_使用。(默认值为“esri shapefile”)- build_spatial_index
设置为
true
为特征数据建立一个空间索引,这将大大加快对较大数据集的访问。- 图层
有些数据集需要为子数据集添加一个层标识符;请在此处设置(整数)。
PostGIS使用特别注意事项:
Postgis使用 connection
字符串而不是 url
建立数据库连接。通常包括表引用,例如 table=something
. 但是,在这个驱动程序中,这可能会导致问题;相反,请在 layer
属性。例如::
<features driver="ogr">
<connection>PG:dbname=mydb host=127.0.0.1 ...</connection>
<layer>myTableName</layer>
</features>