Returns a list of lat/lons found by scanning the given text

def find_geo_coords(s):
    """Returns a list of lat/lons found by scanning the given text"""
    coords = []
    LOG.debug("Matching in text size %s", len(s))
    for c in INFO_BOX_LAT_LON.findall(s):
        try:
            coord = (float(c[1]), float(c[2]))  #, c[0])
            coords.append(coord)
            LOG.debug("Found info box lat/lon: %s", coord)
        except Exception as ex:
            LOG.warn("Bad parse of info box %s: %s", c, ex)
    for c in COORDS_GEN.findall(s):
        # Special cases
        if skip_coords(c):
            LOG.debug("Ignorning coords %s", c)
            continue
        m = COORDS_GROUPS.search(c)
        if not m:
            LOG.warn("Unrecognized coord format: %s", c)
            continue
        try:
            # Remove empty optional groups and remove pipes from matches
            g = [(s[0:-1] if s[-1] == '|' else s) for s in list(m.groups()) if s is not None and len(s)]
            #LOG.info("Found groups: %s", g)
            if len(g) == 1: # Single lat|lon
                lat, lon = g[0].split('|')
                coord = (float(lat), float(lon))  #, c)
                coords.append(coord)
                LOG.debug("Found lat|lon: %s", coord)
            elif g[3] == 'E' or g[3] == 'W':
                lat = depipe(g[0]) * (1 if g[1].upper() == 'N' else -1)
                lon = depipe(g[2]) * (1 if g[3].upper() == 'E' else -1)
                coord = (lat, lon)  #, c)
                coords.append(coord)
                LOG.debug("Found lat|NS|lon|EW: %s", coord)
            else:
                LOG.warn("Unrecognized coord format: %s (parsed %s)", c, g)
        except Exception as ex:
            LOG.warn("Bad parse of %s: %s", c, ex)
    l = []
    for c in set(coords):  # Dedupe; the reality is non-trivial though...we want to keep only the most precise
        if c[0] > 90 or c[0] < -90 or c[1] > 180 or c[1] < -180 or (c[0] == 0 and c[1] == 0):
            LOG.warn("Invalid lat or lon: %s", c)
        else:
            l.append({"type": "Point", "coordinates": (c[1], c[0])})  # GeoJSON, lon goes first
    return l