Loading autocnet/fileio/io_gdal.py +3 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,9 @@ class GeoDataset(object): base_name : str The base name of the input image, extracted from the full path. bounding_box : object The bounding box of the image in lat/lon space geotransform : object Geotransform reference OGR object as an array of size 6 containing the affine transformation coefficients for transforming from raw sample/line to projected x/y. Loading autocnet/graph/network.py +5 −4 Original line number Diff line number Diff line Loading @@ -85,16 +85,18 @@ class CandidateGraph(nx.Graph): graph = pickle.load(f) return graph # TODO: Add ability to actually read this out of a file. # TODO: Add ability to actually read this out of a file? @classmethod def from_filelist(cls, filelst): """ Instantiate the class using a filelist as a python list. An adjacency structure is calculated using the lat/lon information in the input images. Currently only images with this information are supported. Parameters ---------- filelst : list A list containing the files to construct an adjacency graph from A list containing the files (with full paths) to construct an adjacency graph from Returns ------- Loading @@ -102,7 +104,7 @@ class CandidateGraph(nx.Graph): A Network graph object """ # TODO: Reject unsupported file formats (pngs, cubes, anything without usable geospatial data?) # TODO: Reject unsupported file formats + work with more file formats dataset_list = [] for file in filelst: Loading @@ -118,7 +120,6 @@ class CandidateGraph(nx.Graph): if(cg.standalone.bbcommon(data.bounding_box, other.bounding_box)): adjacent_images.append(other.base_name) adjacency_dict[data.base_name] = adjacent_images print(adjacency_dict) return cls(adjacency_dict) Loading autocnet/graph/tests/test_network.py +6 −9 Original line number Diff line number Diff line Loading @@ -69,16 +69,13 @@ class TestCandidateGraph(unittest.TestCase): class TestFromList(unittest.TestCase): @classmethod def setUpClass(cls): #cls.graph = network.CandidateGraph.from_filelist('/scratch/autocnet/autocnet/examples/Apollo15/fromlist.txt') #cls.graph = network.CandidateGraph.from_filelist(['/scratch/autocnet/autocnet/examples/Apollo15/AS15-M-0297_SML.png']) cls.graph = network.CandidateGraph.from_filelist( ['/home/kree/usgs/autocnet/autocnet/examples/Projections/Mars_MGS_MOLA_ClrShade_MAP2_0.0N0.0_MERC.tif', '/home/kree/usgs/autocnet/autocnet/examples/Projections/Lunar_LRO_LOLA_Shade_MAP2_90.0N20.0_LAMB.tif', '/home/kree/usgs/autocnet/autocnet/examples/Projections/Mars_MGS_MOLA_ClrShade_MAP2_90.0N0.0_POLA.tif']) def testfail(self): self.assertTrue(False) filelist = [get_path('Mars_MGS_MOLA_ClrShade_MAP2_0.0N0.0_MERC.tif'), get_path('Lunar_LRO_LOLA_Shade_MAP2_90.0N20.0_LAMB.tif'), get_path('Mars_MGS_MOLA_ClrShade_MAP2_90.0N0.0_POLA.tif')] cls.graph = network.CandidateGraph.from_filelist(filelist) def test_graph_length(self): self.assertEqual(self.graph.__len__(), 3) class TestEdge(unittest.TestCase): Loading Loading
autocnet/fileio/io_gdal.py +3 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,9 @@ class GeoDataset(object): base_name : str The base name of the input image, extracted from the full path. bounding_box : object The bounding box of the image in lat/lon space geotransform : object Geotransform reference OGR object as an array of size 6 containing the affine transformation coefficients for transforming from raw sample/line to projected x/y. Loading
autocnet/graph/network.py +5 −4 Original line number Diff line number Diff line Loading @@ -85,16 +85,18 @@ class CandidateGraph(nx.Graph): graph = pickle.load(f) return graph # TODO: Add ability to actually read this out of a file. # TODO: Add ability to actually read this out of a file? @classmethod def from_filelist(cls, filelst): """ Instantiate the class using a filelist as a python list. An adjacency structure is calculated using the lat/lon information in the input images. Currently only images with this information are supported. Parameters ---------- filelst : list A list containing the files to construct an adjacency graph from A list containing the files (with full paths) to construct an adjacency graph from Returns ------- Loading @@ -102,7 +104,7 @@ class CandidateGraph(nx.Graph): A Network graph object """ # TODO: Reject unsupported file formats (pngs, cubes, anything without usable geospatial data?) # TODO: Reject unsupported file formats + work with more file formats dataset_list = [] for file in filelst: Loading @@ -118,7 +120,6 @@ class CandidateGraph(nx.Graph): if(cg.standalone.bbcommon(data.bounding_box, other.bounding_box)): adjacent_images.append(other.base_name) adjacency_dict[data.base_name] = adjacent_images print(adjacency_dict) return cls(adjacency_dict) Loading
autocnet/graph/tests/test_network.py +6 −9 Original line number Diff line number Diff line Loading @@ -69,16 +69,13 @@ class TestCandidateGraph(unittest.TestCase): class TestFromList(unittest.TestCase): @classmethod def setUpClass(cls): #cls.graph = network.CandidateGraph.from_filelist('/scratch/autocnet/autocnet/examples/Apollo15/fromlist.txt') #cls.graph = network.CandidateGraph.from_filelist(['/scratch/autocnet/autocnet/examples/Apollo15/AS15-M-0297_SML.png']) cls.graph = network.CandidateGraph.from_filelist( ['/home/kree/usgs/autocnet/autocnet/examples/Projections/Mars_MGS_MOLA_ClrShade_MAP2_0.0N0.0_MERC.tif', '/home/kree/usgs/autocnet/autocnet/examples/Projections/Lunar_LRO_LOLA_Shade_MAP2_90.0N20.0_LAMB.tif', '/home/kree/usgs/autocnet/autocnet/examples/Projections/Mars_MGS_MOLA_ClrShade_MAP2_90.0N0.0_POLA.tif']) def testfail(self): self.assertTrue(False) filelist = [get_path('Mars_MGS_MOLA_ClrShade_MAP2_0.0N0.0_MERC.tif'), get_path('Lunar_LRO_LOLA_Shade_MAP2_90.0N20.0_LAMB.tif'), get_path('Mars_MGS_MOLA_ClrShade_MAP2_90.0N0.0_POLA.tif')] cls.graph = network.CandidateGraph.from_filelist(filelist) def test_graph_length(self): self.assertEqual(self.graph.__len__(), 3) class TestEdge(unittest.TestCase): Loading