コード例 #1
0
    def test_planar_source(self):
        # check that by converting original xml file to shapefile
        # and then converting back to xml, we get the same file
        nrml2shp('%ssource_model_pl.xml' % DATA_PATH, '%stest' % DATA_PATH)
        shp2nrml(['%stest_planar' % DATA_PATH], '%stest' % DATA_PATH)

        self.assert_source_model_equals(
            '%ssource_model_pl.xml' % DATA_PATH,
            '%stest.xml' % DATA_PATH
        )
コード例 #2
0
    def test_full_model(self):
        # check that by converting original xml file to shapefile
        # and then converting back to xml, we get the same file
        nrml2shp('%ssource_model_complete.xml' % DATA_PATH, '%stest' % DATA_PATH)
        shp2nrml([
            '%stest_area' % DATA_PATH,
            '%stest_complex' % DATA_PATH,
            '%stest_planar' % DATA_PATH,
            '%stest_point' % DATA_PATH,
            '%stest_simple' % DATA_PATH
        ], '%stest' % DATA_PATH)

        self.assert_source_model_equals(
            '%ssource_model_complete.xml' % DATA_PATH,
            '%stest.xml' % DATA_PATH
        )
コード例 #3
0
from oq_input.source_model_converter import nrml2shp, shp2nrml

nrml2shp("s03.xml", "s03.shp")
shp2nrml(["s03"], "s04")