Ignore:
Timestamp:
25/06/09 15:11:22 (11 years ago)
Author:
spascoe
Message:

Removing tabs from python source

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/service/imps/StationCollection.py

    r4912 r5424  
    3636 
    3737    def getNearestStation(self,lat,lon): 
    38         ''' Determines the station nearest to the given geospatial point in the station collection ''' 
     38        ''' Determines the station nearest to the given geospatial point in the station collection ''' 
    3939 
    40         curNearest=None 
    41         curDist = -1 
     40        curNearest=None 
     41        curDist = -1 
    4242 
    43         for station in self.stations: 
    44                 #calculate distance 
    45                 tempDist = self.getDist(lat, lon, station.lat, station.lon) 
    46                 #if distance is smaller than the current shortest distance 
    47                 if curDist < 0 or tempDist < curDist: 
    48                         curNearest = station 
    49                         curDist = tempDist 
    50         return curNearest 
     43        for station in self.stations: 
     44                #calculate distance 
     45                tempDist = self.getDist(lat, lon, station.lat, station.lon) 
     46                #if distance is smaller than the current shortest distance 
     47                if curDist < 0 or tempDist < curDist: 
     48                        curNearest = station 
     49                        curDist = tempDist 
     50        return curNearest 
    5151 
    5252 
    5353    def getDist(self, srcLat, srcLon, destLat, destLon): 
    54         '''Calculates the distance between to geospatial points'''       
    55         dlon = destLon - srcLon 
    56         dlat = destLat - srcLat 
    57         #a = (math.sin(dlat / 2))**2 + math.cos(srcLat) * math.cos(destLat) * (math.sin(dlon / 2))**2         
    58         #c = 2 * math.asin(min(1, math.sqrt(a))) 
     54        '''Calculates the distance between to geospatial points'''       
     55        dlon = destLon - srcLon 
     56        dlat = destLat - srcLat 
     57        #a = (math.sin(dlat / 2))**2 + math.cos(srcLat) * math.cos(destLat) * (math.sin(dlon / 2))**2         
     58        #c = 2 * math.asin(min(1, math.sqrt(a))) 
    5959        #dist = 3956 * c 
    60         dist = math.sqrt(dlat**2 + dlon**2) 
    61         return dist 
    62                  
    63          
     60        dist = math.sqrt(dlat**2 + dlon**2) 
     61        return dist 
     62                 
     63         
Note: See TracChangeset for help on using the changeset viewer.