Changeset 4641 for anuga_core/source
- Timestamp:
- Jul 26, 2007, 9:09:55 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
r4640 r4641 360 360 361 361 def get_data_points(self, absolute=True, geo_reference=None, 362 as_lat_long=False,isS H=True):362 as_lat_long=False,isSouthHemisphere=True): 363 363 """Get coordinates for all data points as an Nx2 array 364 364 … … 385 385 ### UTMtoLL(northing, easting, zone, 386 386 lat_calced, long_calced = UTMtoLL(point[1],point[0], 387 zone, isS H)387 zone, isSouthHemisphere) 388 388 lats_longs.append((lat_calced, long_calced)) # to hash 389 389 return lats_longs … … 594 594 # return all_data 595 595 596 def export_points_file(self, file_name, absolute=True, as_lat_long=False): 596 def export_points_file(self, file_name, absolute=True, 597 as_lat_long=False, isSouthHemisphere=True): 597 598 598 599 """ … … 606 607 If absolute is False data points at returned as relative to the xll 607 608 and yll and geo_reference remains uneffected 609 610 isSouthHemisphere: is only used when getting data 611 points "as_lat_long" is True and if FALSE will return lats and 612 longs valid for the Northern Hemisphere. 613 608 614 """ 609 615 … … 650 656 _write_csv_file(file_name, 651 657 self.get_data_points(absolute=True, 652 as_lat_long=as_lat_long), 658 as_lat_long=as_lat_long, 659 isSouthHemisphere=isSouthHemisphere), 653 660 self.get_all_attributes(), 654 661 as_lat_long=as_lat_long) … … 658 665 assert absolute, msg 659 666 _write_urs_file(file_name, 660 self.get_data_points(as_lat_long=True)) 667 self.get_data_points(as_lat_long=True, 668 isSouthHemisphere=isSouthHemisphere)) 661 669 662 670 else: -
anuga_core/source/anuga/geospatial_data/test_geospatial_data.py
r4640 r4641 219 219 220 220 geo_reference = Geo_reference(zone=zone) 221 geo = Geospatial_data(boundary_polygon,geo_reference=geo_reference) 222 seg_lat_long = geo.get_data_points(as_lat_long=True,isSH=False) 221 geo = Geospatial_data(boundary_polygon, 222 geo_reference=geo_reference) 223 224 seg_lat_long = geo.get_data_points(as_lat_long=True, 225 isSouthHemisphere=False) 226 223 227 lat_result = degminsec2decimal_degrees(8.31,0,0) 224 228 long_result = degminsec2decimal_degrees(98.273,0,0) … … 1064 1068 # dict = import_points_file(fileName,delimiter=' ') 1065 1069 # results = Geospatial_data() 1066 results = Geospatial_data(fileName, delimiter=' ', verbose= True)1070 results = Geospatial_data(fileName, delimiter=' ', verbose=False) 1067 1071 # results.import_points_file(fileName, delimiter=' ') 1068 1072 except IOError: … … 2368 2372 #suite = unittest.makeSuite(Test_Geospatial_data, 'test_get_data_points_lat_longIII') 2369 2373 suite = unittest.makeSuite(Test_Geospatial_data, 'test') 2370 runner = unittest.TextTestRunner() 2374 runner = unittest.TextTestRunner() #verbosity=2) 2371 2375 runner.run(suite) 2372 2376
Note: See TracChangeset
for help on using the changeset viewer.