Ignore:
Timestamp:
Sep 18, 2006, 1:32:48 PM (17 years ago)
Author:
ole
Message:

Updated and tested new convert_from_latlon_to_utm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/coordinate_transforms/redfearn.py

    r3613 r3614  
    163163
    164164
    165 # FIXME (Ole)
    166 def convert_points_from_latlon_to_utm(latitudes, longitudes,
     165
     166def convert_points_from_latlon_to_utm(points,
    167167                                      false_easting=None,
    168168                                      false_northing=None):
    169     """Wrapper
    170     """
    171    
    172     return convert_lats_longs(latitudes,
    173                               longitudes,
    174                               false_easting,
    175                               false_northing)
    176 
    177    
    178 
     169    """Convert a list of points given in latitude and longitude to UTM
     170
     171
     172    Input
     173
     174    points: list of points given in decimal degrees (latitude, longitude)
     175    false_easting (optional)
     176    false_northing (optional)
     177
     178    Output
     179
     180    zone:   UTM zone for converted points
     181    points: List of converted points
     182
     183
     184    Notes
     185
     186    Assume the false_easting and false_northing are the same for each list.
     187    If points end up belonging to different UTM zones, an ANUGAerror is thrown.
     188
     189   
     190   
     191    """
     192
     193    old_geo = Geo_reference()   
     194    utm_points = []
     195    for point in points:
     196        zone, easting, northing = redfearn(float(point[0]),
     197                                           float(point[1]),
     198                                           false_easting=false_easting,
     199                                           false_northing=false_northing)
     200
     201        new_geo = Geo_reference(zone)
     202        old_geo.reconcile_zones(new_geo)
     203       
     204        utm_points.append([easting, northing])
     205
     206
     207    return old_geo.get_zone(), utm_points
     208
     209
     210   
     211
     212
     213# FIXME (Ole): Is this not supersedede by the above?
    179214def convert_lats_longs(latitudes,
    180215                       longitudes,
Note: See TracChangeset for help on using the changeset viewer.