示例#1
0
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
0
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
示例#3
0
def test_reverse_vrt():
    cfg = OgrConfig(ds="./tests/data/ili/roads23.xtf,./tests/data/ili/RoadsExdm2ien.imd",
                    config="./tests/data/ili/RoadsExdm2ien.cfg")
    vrt = prettify(cfg.generate_reverse_vrt())
    expected = """<OGRVRTLayer name="RoadsExdm2ien.RoadsExtended.RoadSign">
    <SrcDataSource relativeToVRT="0" shared="1">./tests/data/ili/roads23.xtf,./tests/data/ili/RoadsExdm2ien.imd</SrcDataSource>
    <SrcLayer>roadsign</SrcLayer>
    <Field name="TID" src="tid"/>
    <Field name="Type" src="type"/>
    <GeometryField field="position" name="Position">
      <GeometryType>wkbPoint</GeometryType>
    </GeometryField>
  </OGRVRTLayer>"""
    print vrt
    assert expected in vrt
示例#4
0
def test_reverse_vrt():
    cfg = OgrConfig(
        ds="./tests/data/ili/roads23.xtf,./tests/data/ili/RoadsExdm2ien.imd",
        config="./tests/data/ili/RoadsExdm2ien.cfg")
    vrt = prettify(cfg.generate_reverse_vrt())
    expected = """<OGRVRTLayer name="RoadsExdm2ien.RoadsExtended.RoadSign">
    <SrcDataSource relativeToVRT="0" shared="1">./tests/data/ili/roads23.xtf,./tests/data/ili/RoadsExdm2ien.imd</SrcDataSource>
    <SrcLayer>roadsign</SrcLayer>
    <Field name="TID" src="tid"/>
    <Field name="Type" src="type"/>
    <GeometryField field="position" name="Position">
      <GeometryType>wkbPoint</GeometryType>
    </GeometryField>
  </OGRVRTLayer>"""
    print vrt
    assert expected in vrt