diff --git a/flatisfy/data_files/__init__.py b/flatisfy/data_files/__init__.py index ef4872a..c23d5f6 100644 --- a/flatisfy/data_files/__init__.py +++ b/flatisfy/data_files/__init__.py @@ -161,8 +161,8 @@ def _preprocess_tcl(): tcl_data.append(PublicTransport( name=item["properties"]["nom"], area="FR-ARA", - lat=item["geometry"]["coordinates"][0], - lng=item["geometry"]["coordinates"][1] + lat=item["geometry"]["coordinates"][1], + lng=item["geometry"]["coordinates"][0] )) return tcl_data diff --git a/flatisfy/filters/metadata.py b/flatisfy/filters/metadata.py index 7e793df..ce0063f 100644 --- a/flatisfy/filters/metadata.py +++ b/flatisfy/filters/metadata.py @@ -303,9 +303,13 @@ def guess_stations(flats_list, constraint, config, distance_threshold=1500): "gps": (station_data.lat, station_data.lng) }) break - LOGGER.debug( - "Station %s is too far from flat %s, discarding it.", - station[0], flat["id"] + LOGGER.info( + ("Station %s is too far from flat %s (%dm > %dm), " + "discarding it."), + station[0], + flat["id"], + int(distance), + int(distance_threshold) ) else: LOGGER.info( @@ -313,11 +317,20 @@ def guess_stations(flats_list, constraint, config, distance_threshold=1500): flat["id"] ) - # Store matched stations and the associated confidence + if not good_matched_stations: + # No stations found, log it and cotninue with next housing + LOGGER.info( + "No stations found for flat %s, matching %s.", + flat["id"], + flat["station"] + ) + continue + LOGGER.info( - "Found stations for flat %s: %s.", + "Found stations for flat %s: %s (matching %s).", flat["id"], - ", ".join(x["name"] for x in good_matched_stations) + ", ".join(x["name"] for x in good_matched_stations), + flat["station"] ) # If some stations were already filled in and the result is different,