Commit 762166e6 authored by acpaquette's avatar acpaquette Committed by Jesse Mapel
Browse files

Small Fixes (#360)

* Updated overlap to pass camera type through iterative approach

* Cleared database when calling from filelist

* Reverted the node data change, again

* Made clearing the database from_filelist optional and default to no

* Updated test to check for cam_type in kwargs
parent 1324169d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1514,7 +1514,7 @@ WHERE points.active = True AND measures.active=TRUE AND measures.jigreject=FALSE
        session.commit()

    @classmethod
    def from_filelist(cls, filelist):
    def from_filelist(cls, filelist, clear_db=False):
        """
        Parse a filelist to add nodes to the database. Using the
        information in the database, then instantiate a complete,
@@ -1539,6 +1539,9 @@ WHERE points.active = True AND measures.active=TRUE AND measures.jigreject=FALSE
        else:
            warnings.warn('Unable to parse the passed filelist')

        if clear_db:
            cls.clear_db()

        for f in filelist:
            # Create the nodes in the graph. Really, this is creating the
            # images in the DB
@@ -1609,7 +1612,8 @@ WHERE points.active = True AND measures.active=TRUE AND measures.jigreject=FALSE

        return obj

    def clear_db(self, tables=None):
    @staticmethod
    def clear_db(tables=None):
        """
        Truncate all of the database tables and reset any
        autoincrement columns to start with 1.
+4 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ INSERT INTO overlay(intersections, geom) SELECT row.intersections, row.geom FROM

def place_points_in_overlaps(nodes, size_threshold=0.0007,
                             iterative_phase_kwargs={'size':71},
                             distribute_points_kwargs={}):
                             distribute_points_kwargs={}, cam_type='csm'):
    """
    Place points in all of the overlap geometries by back-projecing using
    sensor models.
@@ -66,8 +66,9 @@ def place_points_in_overlaps(nodes, size_threshold=0.0007,
        overlaps = o.intersections
        if overlaps == None:
            continue
        overlapnodes = [nodes[id]["data"] for id in overlaps]
        points.extend(place_points_in_overlap(overlapnodes, o.geom, dem=dem,

        overlapnodes = [nodes[id]['data'] for id in overlaps]
        points.extend(place_points_in_overlap(overlapnodes, o.geom, dem=dem, cam_type=cam_type,
                                              iterative_phase_kwargs=iterative_phase_kwargs,
                                              distribute_points_kwargs=distribute_points_kwargs))

+2 −1
Original line number Diff line number Diff line
@@ -82,4 +82,5 @@ def test_place_points_in_overlaps(overlapper, dem, adder,iterativekwargs, distri
                                Polygon([(0,0),(0,5),(5,5),(5,0),(0,0)]),
                                dem=None,
                                iterative_phase_kwargs=iterativekwargs,
                                distribute_points_kwargs=distributekwargs)
                                distribute_points_kwargs=distributekwargs,
                                cam_type='csm')