code: def get_min_max_lat_lon(self, locations):
          
          d = {}
          for location in locations:
              sites = location.sites
              max_lat, min_lat = '', ''
              max_lon, min_lon = '', ''
              if not any(sites):
                  d[location.name] = {'location_begin_lat': min_lat, 'location_begin_lon': min_lon,
                                      'location_end_lat': max_lat, 'location_end_lon': max_lon}
                  #return d
                  continue
              lats, lons = [], []
              # try to fill in min/max latitudes/longitudes from sites
              for site in sites:
                  if site.er_data['site_lon']:
                      lons.append(site.er_data['site_lon'])
                  if site.er_data['site_lat']:
                      lats.append(site.er_data['site_lat'])
              if lats:
                  lats = [float(lat) for lat in lats]
                  max_lat = max(lats)
                  min_lat = min(lats)
              if lons:
                  lons = [float(lon) for lon in lons]
                  max_lon = max(lons)
                  min_lon = min(lons)
              d[location.name] = {'location_begin_lat': min_lat, 'location_begin_lon': min_lon,
                                  'location_end_lat': max_lat, 'location_end_lon': max_lon}
          return d
docs: Take a list of locations and return a dictionary with:
          location1:
          'location_begin_lat', 'location_begin_lon',
          'location_end_lat', 'location_end_lon'.
          and so on.