Ignore:
Timestamp:
Jul 14, 2006, 4:47:35 PM (18 years ago)
Author:
duncan
Message:

exposure csv class can now have x, y location info

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/data_manager.py

    r3312 r3336  
    725725LAT_TITLE = 'LATITUDE'
    726726LONG_TITLE = 'LONGITUDE'
     727X_TITLE = 'x'
     728Y_TITLE = 'y'
    727729class Exposure_csv:
    728730    def __init__(self,file_name, latitude_title=LAT_TITLE,
    729                  longitude_title=LONG_TITLE, refine_polygon=None):
     731                 longitude_title=LONG_TITLE, is_x_y_locations=False,
     732                 x_title=X_TITLE, y_title=Y_TITLE,
     733                 refine_polygon=None):
    730734        """
    731735        This class is for handling the exposure csv file.
     
    777781            self._geospatial = Geospatial_data(latitudes = lats,
    778782                 longitudes = longs)
     783
     784        if is_x_y_locations:
     785            if self._geospatial is not None:
     786                pass #fixme throw an error
     787            try:
     788                xs = self._attribute_dic[x_title]
     789                ys = self._attribute_dic[y_title]
     790                points = [[float(i),float(j)] for i,j in map(None,xs,ys)]
     791            except KeyError:
     792                # maybe a warning..
     793                raise TitleValueError, msg
     794            else:
     795                self._geospatial = Geospatial_data(data_points=points)
    779796           
    780797        # create a list of points that are in the refining_polygon
Note: See TracChangeset for help on using the changeset viewer.