diff --git a/dags/poi/business/district_bank.py b/dags/poi/business/district_bank.py index 179c8f7..ec5cc26 100644 --- a/dags/poi/business/district_bank.py +++ b/dags/poi/business/district_bank.py @@ -88,12 +88,14 @@ after_dongguan = False for city_item in city_dict: city = city_item['display'] log.info('开始查找' + city + '周边银行') - if city == '东莞': + if city == '昆玉': after_dongguan = True if not after_dongguan: continue seaweed_df = pd.DataFrame(list(seaweed_conn.find({'city': city, 'cat': 'district', 'status': 0, 'lng': {'$ne': None}}, {'city': 1, 'region': 1, 'name': 1, 'lng': 1, 'lat': 1}).batch_size(10000))) + if len(seaweed_df) <= 0: + continue seaweed_df['lng'] = seaweed_df['lng'] / 10 ** 10 seaweed_df['lat'] = seaweed_df['lat'] / 10 ** 10 seaweed_df['bank'] = seaweed_df.apply(lambda x: deal(x['city'], x['lng'], x['lat']), axis=1) diff --git a/dags/poi/business/district_bus.py b/dags/poi/business/district_bus.py index 9065266..a3f63bc 100644 --- a/dags/poi/business/district_bus.py +++ b/dags/poi/business/district_bus.py @@ -81,13 +81,15 @@ after_dongguan = False for city_item in city_dict: city = city_item['display'] log.info('开始查找' + city + '周边交通') - if city == '东莞': + if city == '昆玉': after_dongguan = True if not after_dongguan: continue seaweed_df = pd.DataFrame(list(seaweed_conn.find({'city': city, 'cat': 'district', 'status': 0, 'lng': {'$ne': None}}, {'city': 1, 'region': 1, 'name': 1, 'lng': 1, 'lat': 1}).batch_size( 10000))) + if len(seaweed_df) <= 0: + continue seaweed_df['lng'] = seaweed_df['lng'] / 10 ** 10 seaweed_df['lat'] = seaweed_df['lat'] / 10 ** 10 seaweed_df['bus'] = seaweed_df.apply(lambda x: deal(x['city'], x['lng'], x['lat']), axis=1) diff --git a/dags/poi/business/district_supermarket.py b/dags/poi/business/district_supermarket.py index 55d4871..031c1f2 100644 --- a/dags/poi/business/district_supermarket.py +++ b/dags/poi/business/district_supermarket.py @@ -82,13 +82,15 @@ after_dongguan = False for city_item in city_dict: city = city_item['display'] log.info('开始查找' + city + '周边商场') - if city == '东莞': + if city == '昆玉': after_dongguan = True if not after_dongguan: continue seaweed_df = pd.DataFrame(list(seaweed_conn.find({'city': city, 'cat': 'district', 'status': 0, 'lng': {'$ne': None}}, {'city': 1, 'region': 1, 'name': 1, 'lng': 1, 'lat': 1}).batch_size( 10000))) + if len(seaweed_df) <= 0: + continue seaweed_df['lng'] = seaweed_df['lng'] / 10 ** 10 seaweed_df['lat'] = seaweed_df['lat'] / 10 ** 10 seaweed_df['supermarket'] = seaweed_df.apply(lambda x: deal(x['city'], x['lng'], x['lat']), axis=1)