Loading autocnet/fileio/io_gdal.py +11 −2 Original line number Diff line number Diff line import json import pvl import os Loading Loading @@ -200,6 +202,7 @@ class GeoDataset(object): @property def latlon_extent(self): if not getattr(self, '_latlon_extent', None): try: # If we have a footprint, no need to compute pixel to latlon lowerlon, upperlon, lowerlat, upperlat = self.footprint.GetEnvelope() Loading @@ -208,7 +211,6 @@ class GeoDataset(object): lowerlat, lowerlon = self.pixel_to_latlon(xy_extent[0][0], xy_extent[0][1]) upperlat, upperlon = self.pixel_to_latlon(xy_extent[1][0], xy_extent[1][1]) self._latlon_extent = [(lowerlat, lowerlon), (upperlat, upperlon)] return self._latlon_extent @property Loading Loading @@ -236,7 +238,14 @@ class GeoDataset(object): self._footprint = ogr.CreateGeometryFromWkt(stream) except: # Handle GDAL here self._footprint = None llat, llon, ulat, ulon = self.latlon_extent geom = {"type": "Polygon", "coordinates": [[llat, llon], [llat, ulon], [ulat, ulon], [llon, ulat], [llat, llon]]} self._footprint = ogr.CreateGeometryFromJson(json.dumps(geom)) print(self._footprint) return self._footprint @property Loading autocnet/graph/network.py +1 −2 Original line number Diff line number Diff line import collections import itertools import os import dill as pickle Loading @@ -7,7 +6,6 @@ import networkx as nx import numpy as np import pandas as pd from pysal import cg from autocnet.fileio.io_gdal import GeoDataset from autocnet.control.control import C from autocnet.fileio import io_json Loading @@ -17,6 +15,7 @@ from autocnet.graph.edge import Edge from autocnet.graph.node import Node from autocnet.vis.graph_view import plot_graph class CandidateGraph(nx.Graph): """ A NetworkX derived directed graph to store candidate overlap images. Loading autocnet/graph/tests/test_network.py +2 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class TestCandidateGraph(unittest.TestCase): def tearDown(self): pass ''' class TestFromList(unittest.TestCase): @classmethod def setUpClass(cls): Loading @@ -78,7 +78,7 @@ class TestFromList(unittest.TestCase): self.assertEqual(self.graph.__len__(), 3) self.assertEqual(self.graph.number_of_nodes(), 3) ''' class TestFromListCubes(unittest.TestCase): @classmethod Loading Loading
autocnet/fileio/io_gdal.py +11 −2 Original line number Diff line number Diff line import json import pvl import os Loading Loading @@ -200,6 +202,7 @@ class GeoDataset(object): @property def latlon_extent(self): if not getattr(self, '_latlon_extent', None): try: # If we have a footprint, no need to compute pixel to latlon lowerlon, upperlon, lowerlat, upperlat = self.footprint.GetEnvelope() Loading @@ -208,7 +211,6 @@ class GeoDataset(object): lowerlat, lowerlon = self.pixel_to_latlon(xy_extent[0][0], xy_extent[0][1]) upperlat, upperlon = self.pixel_to_latlon(xy_extent[1][0], xy_extent[1][1]) self._latlon_extent = [(lowerlat, lowerlon), (upperlat, upperlon)] return self._latlon_extent @property Loading Loading @@ -236,7 +238,14 @@ class GeoDataset(object): self._footprint = ogr.CreateGeometryFromWkt(stream) except: # Handle GDAL here self._footprint = None llat, llon, ulat, ulon = self.latlon_extent geom = {"type": "Polygon", "coordinates": [[llat, llon], [llat, ulon], [ulat, ulon], [llon, ulat], [llat, llon]]} self._footprint = ogr.CreateGeometryFromJson(json.dumps(geom)) print(self._footprint) return self._footprint @property Loading
autocnet/graph/network.py +1 −2 Original line number Diff line number Diff line import collections import itertools import os import dill as pickle Loading @@ -7,7 +6,6 @@ import networkx as nx import numpy as np import pandas as pd from pysal import cg from autocnet.fileio.io_gdal import GeoDataset from autocnet.control.control import C from autocnet.fileio import io_json Loading @@ -17,6 +15,7 @@ from autocnet.graph.edge import Edge from autocnet.graph.node import Node from autocnet.vis.graph_view import plot_graph class CandidateGraph(nx.Graph): """ A NetworkX derived directed graph to store candidate overlap images. Loading
autocnet/graph/tests/test_network.py +2 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class TestCandidateGraph(unittest.TestCase): def tearDown(self): pass ''' class TestFromList(unittest.TestCase): @classmethod def setUpClass(cls): Loading @@ -78,7 +78,7 @@ class TestFromList(unittest.TestCase): self.assertEqual(self.graph.__len__(), 3) self.assertEqual(self.graph.number_of_nodes(), 3) ''' class TestFromListCubes(unittest.TestCase): @classmethod Loading