Changeset 2351


Ignore:
Timestamp:
Feb 7, 2006, 5:14:55 PM (18 years ago)
Author:
ole
Message:

Minor bug fix

Location:
inundation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/pmesh/create_mesh.py

    r2349 r2351  
    22"""
    33
    4 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    54# Assume that the root AnuGA dir (inundation) is included in your pythonpath
    6 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    75
    8 #FIXME (DSG): move the coordinate transforms package to the root AnuGA dir
    9 #from coordinate_transforms.geo_reference import Geo_reference
    106from coordinate_transforms.redfearn import redfearn
    11 
    127
    138def convert_points_from_latlon_to_utm(polygon, refzone=None):
     
    2520
    2621    return points, zone   
    27 
    2822
    2923
     
    10296    """
    10397
    104     #from pmesh.mesh import Mesh
    10598    from mesh import Mesh
    10699    from coordinate_transforms.redfearn import redfearn
    107     from pyvolution.util import populate_polygon
     100    from utilities.polygon import populate_polygon
    108101   
    109 
    110     #Make georef
    111     #FIXME: Pass in geo or create automatically somehow
    112     #import project
    113     #refzone = project.refzone  #FIXME
    114     #mesh_origin = project.mesh_origin
    115     #geo = Geo_reference(xllcorner = mesh_origin[1],  #From dem
    116     #                    yllcorner = mesh_origin[2],
    117     #                    zone = refzone)
    118 
    119 
    120    
    121     #print "***********************"
    122     #print "geo ref", geo
    123     #print "***********************"
    124    
    125     #m = Mesh(geo_reference=geo)
    126102    m = Mesh()
    127 
    128103
    129104
     
    141116        excluded_polygons = []       
    142117        for P, res in interior_regions:
    143             polygon = convert_points_from_latlon_to_utm(P, refzone)           
     118            polygon, _ = convert_points_from_latlon_to_utm(P, refzone)           
    144119            excluded_polygons.append( polygon )
    145120    else:
     
    158133    if interior_regions is not None:   
    159134        for P, res in interior_regions:
    160             polygon = convert_points_from_latlon_to_utm(P, refzone)                       
     135            polygon, _ = convert_points_from_latlon_to_utm(P, refzone)                       
    161136            region_dict = create_region(polygon, None, refzone)
    162137
  • inundation/utilities/polygon.py

    r2241 r2351  
    5858        polygon = ensure_numeric(polygon, Float)
    5959    except:
    60         msg = 'Polygon could not be converted to Numeric array'
     60        msg = 'Polygon %s could not be converted to Numeric array' %(str(polygon))
    6161        raise msg
    6262
     
    7070
    7171    indices, count = separate_points_by_polygon(points, polygon,
    72                                                 closed, verbose)
     72                                                closed=closed,
     73                                                verbose=verbose)
    7374
    7475    if one_point:
     
    111112
    112113    indices, count = separate_points_by_polygon(points, polygon,
    113                                                 closed, verbose)
     114                                                closed=closed,
     115                                                verbose=verbose)
    114116
    115117    if one_point:
Note: See TracChangeset for help on using the changeset viewer.