def get_cityid_trackpoint_pairs(cursor, unknown_only):
    """
    Get a list of trackpoint ids and the location id of that
    trackpoint from the citydefs table
    """
    sql = (
        'SELECT citydefs.citydef_uid, trackpoints.trkpt_uid FROM citydefs, trackpoints WHERE within(trackpoints.geom, citydefs.geom)'
        )
    if unknown_only is True:
        sql += ' AND trackpoints.citydef_uid = 1'
    results = cursor.execute(sql)
    locations_list = results.fetchall()
    return locations_list
