コード例 #1
0
ファイル: tests.py プロジェクト: gaberosser/geo-network
    def setUp(self):
        # this_dir = os.path.dirname(os.path.realpath(__file__))
        # IN_FILE = os.path.join(this_dir, 'test_data', 'mastermap-itn_417209_0_brixton_sample.gml')

        self.test_data = read_gml(TEST_DATA_FILE)

        self.itn_net = ITNStreetNet.from_data_structure(self.test_data)
コード例 #2
0
    def setUp(self):
        # this_dir = os.path.dirname(os.path.realpath(__file__))
        # IN_FILE = os.path.join(this_dir, 'test_data', 'mastermap-itn_417209_0_brixton_sample.gml')

        self.test_data = read_gml(TEST_DATA_FILE)

        self.itn_net = ITNStreetNet.from_data_structure(self.test_data)
コード例 #3
0
ファイル: camden.py プロジェクト: gaberosser/crime-fighter
def load_network_and_pickle():
    # test dataset is in a directory in the data directory called 'network_data'
    this_dir = os.path.join(settings.DATA_DIR, 'network_data')
    IN_FILE = os.path.join(this_dir, 'mastermap-itn_544003_0_camden_buff2000.gml')
    test_data = read_gml(IN_FILE)
    itn_net = ITNStreetNet.from_data_structure(test_data)

    camden = camden_boundary()

    itn_net_reduced = itn_net.within_boundary(camden.buffer(100))
    outdir = os.path.join(IN_DIR, 'networks')
    itn_net.save(os.path.join(outdir, 'camden.net'))
    itn_net_reduced.save(os.path.join(outdir, 'camden_clipped.net'))
コード例 #4
0
 def setUp(self):
     self.test_data = read_gml(TEST_DATA_FILE)
     self.itn_net = ITNStreetNet.from_data_structure(self.test_data)
コード例 #5
0
def load_test_network():
    # load some toy network data
    test_data = read_gml(TEST_DATA_FILE)
    return ITNStreetNet.from_data_structure(test_data)
コード例 #6
0
    def test_fixed_distance_walk(self):
        net = toy_network()
        pt = NetPoint.from_cartesian(net, 2.5, 0)


if __name__ == "__main__":
    b_plot = False

    # mini test dataset

    # test dataset is in a directory in the same path as this module called 'test_data'
    this_dir = os.path.dirname(os.path.realpath(__file__))
    IN_FILE = os.path.join(this_dir, 'test_data',
                           'mastermap-itn_417209_0_brixton_sample.gml')
    test_data = read_gml(IN_FILE)
    itn_net = ITNStreetNet.from_data_structure(test_data)

    # buffered Camden dataset from raw data
    # test dataset is in a directory in the data directory called 'network_data'
    # this_dir = os.path.join(settings.DATA_DIR, 'network_data')
    # IN_FILE = os.path.join(this_dir, 'mastermap-itn_544003_0_camden_buff2000.gml')
    # test_data = read_gml(IN_FILE)
    # itn_net = ITNStreetNet.from_data_structure(test_data)

    # buffered Camden dataset from pickle
    # this_dir = os.path.dirname(os.path.realpath(__file__))
    # IN_FILE = os.path.join(this_dir, 'test_data', 'mastermap-itn_544003_0_camden_buff2000.pickle')
    # itn_net = ITNStreetNet.from_pickle(IN_FILE)

    # get the spatial extent of the network
コード例 #7
0
ファイル: tests.py プロジェクト: gaberosser/geo-network
 def setUp(self):
     self.test_data = read_gml(TEST_DATA_FILE)
     self.itn_net = ITNStreetNet.from_data_structure(self.test_data)
コード例 #8
0
ファイル: tests.py プロジェクト: gaberosser/geo-network
def load_test_network():
    # load some toy network data
    test_data = read_gml(TEST_DATA_FILE)
    return ITNStreetNet.from_data_structure(test_data)
コード例 #9
0
ファイル: tests.py プロジェクト: gaberosser/geo-network
    def test_fixed_distance_walk(self):
        net = toy_network()
        pt = NetPoint.from_cartesian(net, 2.5, 0)



if __name__ == "__main__":
    b_plot = False

    # mini test dataset

    # test dataset is in a directory in the same path as this module called 'test_data'
    this_dir = os.path.dirname(os.path.realpath(__file__))
    IN_FILE = os.path.join(this_dir, 'test_data', 'mastermap-itn_417209_0_brixton_sample.gml')
    test_data = read_gml(IN_FILE)
    itn_net = ITNStreetNet.from_data_structure(test_data)

    # buffered Camden dataset from raw data
    # test dataset is in a directory in the data directory called 'network_data'
    # this_dir = os.path.join(settings.DATA_DIR, 'network_data')
    # IN_FILE = os.path.join(this_dir, 'mastermap-itn_544003_0_camden_buff2000.gml')
    # test_data = read_gml(IN_FILE)
    # itn_net = ITNStreetNet.from_data_structure(test_data)

    # buffered Camden dataset from pickle
    # this_dir = os.path.dirname(os.path.realpath(__file__))
    # IN_FILE = os.path.join(this_dir, 'test_data', 'mastermap-itn_544003_0_camden_buff2000.pickle')
    # itn_net = ITNStreetNet.from_pickle(IN_FILE)

    # get the spatial extent of the network
コード例 #10
0
 def net_data_reader(raw_filename):
     return itn.read_gml(raw_filename)