Beispiel #1
0
def test_clear():
    vrt = VRTWriter()
    vrt.add_vrtdataset(8, 8)
    not_empty = vrt.to_string()
    vrt.clear()
    empty = vrt.to_string()
    assert empty != not_empty
Beispiel #2
0
def test_add_srs_srs():
    srs = create_srs()
    vrt = VRTWriter()
    vrt.add_vrtdataset(8, 8)
    vrt.add_srs(srs=srs)

    expected = b'<VRTDataset rasterXSize="8" rasterYSize="8">\n    <SRS>GEOGCS[&amp;quot;WGS 84&amp;quot;,DATUM[&amp;quot;WGS_1984&amp;quot;,SPHEROID[&amp;quot;WGS 84&amp;quot;,6378137,298.257223563,AUTHORITY[&amp;quot;EPSG&amp;quot;,&amp;quot;7030&amp;quot;]],AUTHORITY[&amp;quot;EPSG&amp;quot;,&amp;quot;6326&amp;quot;]],PRIMEM[&amp;quot;Greenwich&amp;quot;,0,AUTHORITY[&amp;quot;EPSG&amp;quot;,&amp;quot;8901&amp;quot;]],UNIT[&amp;quot;degree&amp;quot;,0.0174532925199433,AUTHORITY[&amp;quot;EPSG&amp;quot;,&amp;quot;9122&amp;quot;]],AXIS[&amp;quot;Latitude&amp;quot;,NORTH],AXIS[&amp;quot;Longitude&amp;quot;,EAST],AUTHORITY[&amp;quot;EPSG&amp;quot;,&amp;quot;4326&amp;quot;]]</SRS>\n</VRTDataset>\n'
    assert vrt.is_valid
    assert vrt.to_string() == expected

    vrt.clear()
    vrt.add_vrtdataset(8, 8)
    vrt.add_srs(wkt=srs.ExportToWkt())

    assert vrt.is_valid
    assert vrt.to_string() == expected