Changeset 4150 for anuga_core/source/anuga/geospatial_data
- Timestamp:
- Jan 9, 2007, 11:59:51 AM (18 years ago)
- Location:
- anuga_core/source/anuga/geospatial_data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/geospatial_data/geospatial_data.py
r4135 r4150 6 6 from os import access, F_OK, R_OK 7 7 from types import DictType 8 from warnings import warn 8 9 9 10 from Numeric import concatenate, array, Float, shape, reshape, ravel, take, \ … … 578 579 and yll and geo_reference remains uneffected 579 580 """ 580 581 582 if absolute is False and file_name[-4:] == ".xya": 583 msg = 'The text file values must be absolute. ' 584 msg += 'Text file format is moving to comma seperated .txt files.' 585 warn(msg, DeprecationWarning) 586 581 587 if (file_name[-4:] == ".xya"): 582 588 if absolute is True: … … 600 606 self.get_all_attributes(), 601 607 self.get_geo_reference()) 608 609 elif (file_name[-4:] == ".txt"): 610 _write_xya_file(file_name, 611 self.get_data_points(absolute=True), 612 self.get_all_attributes()) 613 602 614 else: 603 615 msg = 'Unknown file type %s ' %file_name -
anuga_core/source/anuga/geospatial_data/test_geospatial_data.py
r4146 r4150 970 970 os.remove(fileName) 971 971 972 def test_export_xya_file(self):972 def depreciated_test_export_xya_file(self): 973 973 # dict = {} 974 974 att_dict = {} … … 1126 1126 1127 1127 def test_writepts(self): 1128 """test_writepts: Test that storage of x,y,attributes works1129 """1128 #test_writepts: Test that storage of x,y,attributes works 1129 1130 1130 att_dict = {} 1131 1131 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) … … 1148 1148 'test_writepts failed. Test geo_reference') 1149 1149 1150 def test_write_xya_attributes(self): 1151 #test_write xya: Test that storage of x,y,attributes works 1152 1153 att_dict = {} 1154 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 1155 att_dict['elevation'] = array([10.0, 0.0, 10.4]) 1156 att_dict['brightness'] = array([10.0, 0.0, 10.4]) 1157 geo_reference=Geo_reference(56,0,0) 1150 1158 # Test xya format 1151 1159 fileName = tempfile.mktemp(".xya") 1152 1160 G = Geospatial_data(pointlist, att_dict, geo_reference) 1153 G.export_points_file(fileName , False)1161 G.export_points_file(fileName) 1154 1162 results = Geospatial_data(file_name=fileName) 1155 1163 os.remove(fileName) … … 1162 1170 1163 1171 def test_writepts_no_attributes(self): 1164 """test_writepts_no_attributes: Test that storage of x,y alone works 1165 """ 1172 1173 #test_writepts_no_attributes: Test that storage of x,y alone works 1174 1166 1175 att_dict = {} 1167 1176 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) … … 1178 1187 self.failUnless(geo_reference == geo_reference, 1179 1188 'test_writepts failed. Test geo_reference') 1180 1189 1190 def test_write_xya_no_attributes(self): 1191 #test_write xya _no_attributes: Test that storage of x,y alone works 1192 1193 att_dict = {} 1194 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 1195 geo_reference=Geo_reference(56,0,0) 1181 1196 # Test xya format 1182 1197 fileName = tempfile.mktemp(".xya") 1183 1198 G = Geospatial_data(pointlist, None, geo_reference) 1184 G.export_points_file(fileName , False)1199 G.export_points_file(fileName) 1185 1200 results = Geospatial_data(file_name=fileName) 1186 1201 os.remove(fileName)
Note: See TracChangeset
for help on using the changeset viewer.