Commit 03bf8f4c authored by jay's avatar jay
Browse files

Fixes indexing on get_matches

parent e9804934
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ before_install:
  - conda config --add channels menpo
  - conda config --add channels usgs-astrogeology
  - conda config --add channels conda-forge
  - conda install -c conda-forge vlfeat scipy networkx numexpr cython matplotlib pillow runipy geopandas opencv numpy libgdal gdal scikit-image pytest pytest-cov coverage anaconda-client coveralls plio cyvlfeat ncurses csmapi
  - conda install -c conda-forge numpy vlfeat scipy networkx numexpr cython matplotlib pillow runipy geopandas opencv libgdal gdal scikit-image pytest pytest-cov coverage anaconda-client coveralls plio cyvlfeat ncurses csmapi

script:
  - pytest autocnet tests
+6 −4
Original line number Diff line number Diff line
@@ -201,10 +201,13 @@ class Edge(dict, MutableMapping):
        access to x,y easier as a join on the keypoints is not requires.
        """
        skps = self.get_keypoints(self.source, index=self.matches.source_idx)
        self.matches.sort_values(by='source_idx')[['source_x', 'source_y']] = skps.sort_index().values

        skps.reindex(self.matches['source_idx'])
        self.matches['source_x'] = skps.values[:,0]
        self.matches['source_y'] = skps.values[:,1]
        dkps = self.get_keypoints(self.destination, index=self.matches.destination_idx)
        self.matches.sort_values(by='destination_idx')[['destination_x', 'destination_y']] = dkps.sort_index().values
        dkps.reindex(self.matches['destination_idx'])
        self.matches['destination_x'] = dkps.values[:,0]
        self.matches['destination_y'] = dkps.values[:,1]
        
    def project_matches(self, semimajor, semiminor, on='source', srid=None):
        """
@@ -716,7 +719,6 @@ class Edge(dict, MutableMapping):
    def get_matches(self, clean_keys=[]): # pragma: no cover
        if self.matches.empty:
            return pd.DataFrame()

        self.add_coordinates_to_matches()
        matches, _ = self.clean(clean_keys=clean_keys)
        skps = matches[['source_x', 'source_y']]