- Timestamp:
- Jan 30, 2007, 5:20:08 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/geospatial_data/geospatial_data.py
r4195 r4199 16 16 17 17 from anuga.utilities.numerical_tools import ensure_numeric 18 from anuga.coordinate_transforms.geo_reference import Geo_reference, TitleError 18 19 from anuga.coordinate_transforms.lat_long_UTM_conversion import UTMtoLL 20 from anuga.coordinate_transforms.geo_reference import Geo_reference, \ 21 TitleError, DEFAULT_ZONE 19 22 from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm 20 23 from anuga.utilities.anuga_exceptions import ANUGAError … … 332 335 return self.geo_reference 333 336 334 def get_data_points(self, absolute=True, geo_reference=None): 335 """Get coordinates for all data points as an Nx2 array 337 def get_data_points(self, absolute=True, geo_reference=None, 338 as_lat_long=False): 339 """Get coordinates for all data points as an Nx2 array. 340 Column 0 is x values 341 Column 1 is y values 336 342 337 343 If absolute is False returned coordinates are relative to the … … 344 350 Default: absolute is True. 345 351 """ 346 352 if as_lat_long is True: 353 msg = "Points need a zone to be converted into lats and longs" 354 assert self.geo_reference is not None, msg 355 zone = self.geo_reference.get_zone() 356 assert self.geo_reference.get_zone() is not DEFAULT_ZONE, msg 357 lats_longs = [] 358 for point in self.get_data_points(True): 359 ### UTMtoLL(northing, easting, zone, 360 print "point[0]",point[0] 361 print "point[1]",point[1] 362 print "zone",zone 363 results = UTMtoLL(point[0],point[1], zone) 364 print "results", results 365 lat_calced, long_calced = UTMtoLL(point[0],point[1], zone) 366 print "lat_calced", lat_calced 367 print "long_calced", long_calced 368 lats_longs.append(UTMtoLL(point[0],point[1], zone)) 369 370 347 371 if absolute is True and geo_reference is None: 348 372 return self.geo_reference.get_absolute(self.data_points) … … 353 377 else: 354 378 return self.data_points 355 356 379 357 380 def get_attributes(self, attribute_name=None):
Note: See TracChangeset
for help on using the changeset viewer.