本文整理汇总了Python中ogrtools.ogrtransform.ogrconfig.OgrConfig.generate_vrt方法的典型用法代码示例。如果您正苦于以下问题:Python OgrConfig.generate_vrt方法的具体用法?Python OgrConfig.generate_vrt怎么用?Python OgrConfig.generate_vrt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogrtools.ogrtransform.ogrconfig.OgrConfig
的用法示例。
在下文中一共展示了OgrConfig.generate_vrt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_multigeom_vrt
# 需要导入模块: from ogrtools.ogrtransform.ogrconfig import OgrConfig [as 别名]
# 或者: from ogrtools.ogrtransform.ogrconfig.OgrConfig import generate_vrt [as 别名]
def test_multigeom_vrt():
cfg = OgrConfig(
ds="./tests/data/ch.bazl/ch.bazl.sicherheitszonenplan.oereb_20131118.xtf,./tests/data/ch.bazl/ch.bazl.sicherheitszonenplan.oereb_20131118.imd",
config="./tests/data/ch.bazl/ch.bazl.sicherheitszonenplan.oereb_20131118.cfg",
)
vrt = prettify(cfg.generate_vrt())
expected = """<OGRVRTLayer name="oerebkrm09trsfr_transferstruktur_geometrie">
<SrcDataSource relativeToVRT="0" shared="1">./tests/data/ch.bazl/ch.bazl.sicherheitszonenplan.oereb_20131118.xtf,./tests/data/ch.bazl/ch.bazl.sicherheitszonenplan.oereb_20131118.imd</SrcDataSource>
<SrcLayer>OeREBKRM09trsfr.Transferstruktur.Geometrie</SrcLayer>
<Field name="publiziertab" src="publiziertAb" type="String"/>
<Field name="metadatengeobasisdaten" src="MetadatenGeobasisdaten" type="String"/>
<Field name="tid" src="TID" type="String"/>
<Field name="zustaendigestelle" src="ZustaendigeStelle" type="String"/>
<Field name="rechtsstatus" src="Rechtsstatus" type="String"/>
<Field name="eigentumsbeschraenkung" src="Eigentumsbeschraenkung" type="String"/>
<GeometryField field="Punkt" name="punkt">
<GeometryType>wkbPoint</GeometryType>
<SRS>EPSG:21781</SRS>
</GeometryField>
<GeometryField field="Flaeche" name="flaeche">
<GeometryType>wkbPolygon</GeometryType>
<SRS>EPSG:21781</SRS>
</GeometryField>
<GeometryField field="Linie" name="linie">
<GeometryType>wkbMultiLineString</GeometryType>
<SRS>EPSG:21781</SRS>
</GeometryField>
</OGRVRTLayer>"""
print vrt
assert expected in vrt
示例2: test_vrt
# 需要导入模块: from ogrtools.ogrtransform.ogrconfig import OgrConfig [as 别名]
# 或者: from ogrtools.ogrtransform.ogrconfig.OgrConfig import generate_vrt [as 别名]
def test_vrt():
cfg = OgrConfig(ds="./tests/data/ili/roads23.xtf,./tests/data/ili/RoadsExdm2ien.imd",
config="./tests/data/ili/RoadsExdm2ien.cfg")
vrt = prettify(cfg.generate_vrt())
expected = """<OGRVRTLayer name="roadsign">
<SrcDataSource relativeToVRT="0" shared="1">./tests/data/ili/roads23.xtf,./tests/data/ili/RoadsExdm2ien.imd</SrcDataSource>
<SrcLayer>RoadsExdm2ien.RoadsExtended.RoadSign</SrcLayer>
<Field name="tid" src="TID" type="String"/>
<Field name="type" src="Type" type="String"/>
<GeometryField field="Position" name="position">
<GeometryType>wkbPoint</GeometryType>
</GeometryField>
</OGRVRTLayer>"""
print vrt
assert expected in vrt