Changeset 3262 for inundation/geospatial_data
- Timestamp:
- Jun 30, 2006, 3:19:05 PM (19 years ago)
- Location:
- inundation/geospatial_data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/geospatial_data/geospatial_data.py
r3177 r3262 697 697 relative to their respective origins. 698 698 """ 699 if isinstance(points,type('')): 700 #It's a string 701 #assume it is a point file 702 points = Geospatial_data(file_name = points) 703 699 704 if isinstance(points,Geospatial_data): 700 705 points = points.get_data_points( \ … … 733 738 """ 734 739 if isinstance(points,Geospatial_data): 735 #points = points.get_data_points( \736 # absolute = True)737 740 msg = "Use a Geospatial_data object or a mesh origin. Not both." 738 741 assert geo_reference == None, msg … … 741 744 points = ensure_numeric(points, Float) 742 745 if geo_reference is None: 743 geo = None #Geo_reference()746 geo = None 744 747 else: 745 748 if isinstance(geo_reference, Geo_reference): … … 749 752 geo_reference[1], 750 753 geo_reference[2]) 751 points = Geospatial_data(data_points=points, geo_reference=geo) 752 #points = geo.get_absolute(points) 754 points = Geospatial_data(data_points=points, geo_reference=geo) 753 755 return points 754 756 -
inundation/geospatial_data/test_geospatial_data.py
r3177 r3262 1031 1031 assert allclose(new_points, ab_points) 1032 1032 1033 1034 fileName = tempfile.mktemp(".xya") 1035 file = open(fileName,"w") 1036 file.write(" elevation speed \n\ 1037 1.0 0.0 10.0 0.0\n\ 1038 0.0 1.0 0.0 10.0\n\ 1039 1.0 0.0 10.4 40.0\n\ 1040 #geocrap\n\ 1041 56\n\ 1042 10\n\ 1043 20\n") 1044 file.close() 1045 1046 ab_points = ensure_absolute(fileName) 1047 actual = [[11, 20.0],[10.0, 21.0],[11.0, 20.0]] 1048 assert allclose(ab_points, actual) 1049 os.remove(fileName) 1050 1033 1051 1034 1052 def test_ensure_geospatial(self):
Note: See TracChangeset
for help on using the changeset viewer.