Loading autocnet/graph/node.py +2 −1 Original line number Diff line number Diff line Loading @@ -517,7 +517,8 @@ class NetworkNode(Node): cam = self.create_camera() try: fp = self.footprint except: except Exception as e: warnings.warn('Unable to generate image footprint.\n{}'.format(e)) fp = None # Create the image i = Images(name=kwargs['image_name'], Loading autocnet/io/db/model.py +3 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,9 @@ class Images(BaseMixin, Base): if isinstance(geom, osgeo.ogr.Geometry): # If an OGR geom, convert to shapely geom = shapely.wkt.loads(geom.ExportToWkt()) if geom is None: self._footprint_latlon = None else: self._footprint_latlon = from_shape(geom, srid=srid) class Overlay(BaseMixin, Base): Loading autocnet/io/db/tests/test_model.py +5 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,11 @@ def test_jigsaw_append(mockFunc, session, measure_data, point_data, image_data): assert resp.liner == 0.1 assert resp.sampler == 0.1 def test_null_footprint(session): i = model.Images.create(session, footprint_latlon=None, serial = 'serial') assert i.footprint_latlon is None def test_broken_bad_geom(session): # An irreperablly damaged poly geom = MultiPolygon([Polygon([(0,0), (1,1), (1,2), (1,1), (0,0)])]) Loading Loading
autocnet/graph/node.py +2 −1 Original line number Diff line number Diff line Loading @@ -517,7 +517,8 @@ class NetworkNode(Node): cam = self.create_camera() try: fp = self.footprint except: except Exception as e: warnings.warn('Unable to generate image footprint.\n{}'.format(e)) fp = None # Create the image i = Images(name=kwargs['image_name'], Loading
autocnet/io/db/model.py +3 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,9 @@ class Images(BaseMixin, Base): if isinstance(geom, osgeo.ogr.Geometry): # If an OGR geom, convert to shapely geom = shapely.wkt.loads(geom.ExportToWkt()) if geom is None: self._footprint_latlon = None else: self._footprint_latlon = from_shape(geom, srid=srid) class Overlay(BaseMixin, Base): Loading
autocnet/io/db/tests/test_model.py +5 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,11 @@ def test_jigsaw_append(mockFunc, session, measure_data, point_data, image_data): assert resp.liner == 0.1 assert resp.sampler == 0.1 def test_null_footprint(session): i = model.Images.create(session, footprint_latlon=None, serial = 'serial') assert i.footprint_latlon is None def test_broken_bad_geom(session): # An irreperablly damaged poly geom = MultiPolygon([Polygon([(0,0), (1,1), (1,2), (1,1), (0,0)])]) Loading