Changeset 4640
- Timestamp:
- Jul 25, 2007, 1:52:26 PM (17 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
r4633 r4640 360 360 361 361 def get_data_points(self, absolute=True, geo_reference=None, 362 as_lat_long=False ):362 as_lat_long=False,isSH=True): 363 363 """Get coordinates for all data points as an Nx2 array 364 364 … … 369 369 If a geo_reference is passed the points are returned relative 370 370 to that geo_reference. 371 372 isSH (isSouthHemisphere) is only used when getting data 373 points "as_lat_long" is True and if FALSE will return lats and 374 longs valid for the Northern Hemisphere. 371 375 372 376 Default: absolute is True. … … 380 384 for point in self.get_data_points(True): 381 385 ### UTMtoLL(northing, easting, zone, 382 lat_calced, long_calced = UTMtoLL(point[1],point[0], zone) 386 lat_calced, long_calced = UTMtoLL(point[1],point[0], 387 zone, isSH) 383 388 lats_longs.append((lat_calced, long_calced)) # to hash 384 389 return lats_longs -
anuga_core/source/anuga/geospatial_data/test_geospatial_data.py
r4549 r4640 210 210 assert allclose(seg_lat_long[0][0], lat_result)#lat 211 211 assert allclose(seg_lat_long[0][1], long_result)#long 212 213 214 def test_get_data_points_lat_longIII(self): 215 # x,y North,east long,lat 216 #for northern hemisphere 217 boundary_polygon = [[419944.8, 918642.4]] 218 zone = 47 219 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) 223 lat_result = degminsec2decimal_degrees(8.31,0,0) 224 long_result = degminsec2decimal_degrees(98.273,0,0) 225 #print "seg_lat_long", seg_lat_long [0] 226 #print "lat_result",lat_result 227 assert allclose(seg_lat_long[0][0], lat_result)#lat 228 assert allclose(seg_lat_long[0][1], long_result)#long 229 212 230 213 231 … … 2348 2366 2349 2367 #suite = unittest.makeSuite(Test_Geospatial_data, 'test_write_csv_attributes_lat_long') 2350 #suite = unittest.makeSuite(Test_Geospatial_data, 'test_ export_xya_file')2368 #suite = unittest.makeSuite(Test_Geospatial_data, 'test_get_data_points_lat_longIII') 2351 2369 suite = unittest.makeSuite(Test_Geospatial_data, 'test') 2352 2370 runner = unittest.TextTestRunner()
Note: See TracChangeset
for help on using the changeset viewer.