Ignore:
Timestamp:
Jul 18, 2006, 1:51:19 PM (19 years ago)
Author:
duncan
Message:

bug fix in ensure_geospatial

Location:
inundation/geospatial_data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/geospatial_data/geospatial_data.py

    r3320 r3351  
    792792        msg = "Use a Geospatial_data object or a mesh origin. Not both."
    793793        assert geo_reference == None, msg
    794            
     794        return points   
    795795    else:
    796796        points = ensure_numeric(points, Float)
     
    804804                                geo_reference[1],
    805805                                geo_reference[2])
    806         points = Geospatial_data(data_points=points, geo_reference=geo)       
     806    points = Geospatial_data(data_points=points, geo_reference=geo)       
    807807    return points
    808808             
  • inundation/geospatial_data/test_geospatial_data.py

    r3302 r3351  
    10731073                         [2.0, 0.0],[2.0, 2.0],
    10741074                         [1.0, 3.0],[2.0, 2.0]]
    1075         new_points = ensure_absolute(points)
    1076        
    1077         assert allclose(new_points, points)
     1075        new_points = ensure_geospatial(points)
     1076       
     1077        assert allclose(new_points.get_data_points(absolute = True), points)
    10781078
    10791079        points = array([[2.0, 0.0],[1.0, 1.0],
    10801080                         [2.0, 0.0],[2.0, 2.0],
    10811081                         [1.0, 3.0],[2.0, 2.0]])
    1082         new_points = ensure_absolute(points)
    1083        
    1084         assert allclose(new_points, points)
     1082        new_points = ensure_geospatial(points)
     1083       
     1084        assert allclose(new_points.get_data_points(absolute = True), points)
    10851085       
    10861086        ab_points = array([[2.0, 0.0],[1.0, 1.0],
     
    13451345if __name__ == "__main__":
    13461346
    1347     #suite = unittest.makeSuite(Test_Geospatial_data, 'test_lat_long')
     1347    #suite = unittest.makeSuite(Test_Geospatial_data, 'test_ensure_geospatial')
    13481348    suite = unittest.makeSuite(Test_Geospatial_data, 'test')
    13491349    runner = unittest.TextTestRunner()
Note: See TracChangeset for help on using the changeset viewer.