财力评级从mongo查学校、医院
This commit is contained in:
@@ -23,7 +23,7 @@ mutex = Lock()
|
|||||||
|
|
||||||
def deal(actions, item):
|
def deal(actions, item):
|
||||||
global count
|
global count
|
||||||
curr_city = item['city']
|
curr_city = item['city_full']
|
||||||
lng = commutils.format_lat_lng(item['lng'])
|
lng = commutils.format_lat_lng(item['lng'])
|
||||||
lat = commutils.format_lat_lng(item['lat'])
|
lat = commutils.format_lat_lng(item['lat'])
|
||||||
|
|
||||||
@@ -33,13 +33,15 @@ def deal(actions, item):
|
|||||||
doc_info = dict()
|
doc_info = dict()
|
||||||
|
|
||||||
# 幼儿园
|
# 幼儿园
|
||||||
kindergarten = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "学校", "幼儿园")
|
# kindergarten = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "学校", "幼儿园")
|
||||||
|
kindergarten = poiutils.find_around_by_location_from_mongo(curr_city, 1000, lng, lat, "学校", "幼儿园")
|
||||||
doc_info['kindergarten_num'] = len(kindergarten)
|
doc_info['kindergarten_num'] = len(kindergarten)
|
||||||
if len(kindergarten) > 0:
|
if len(kindergarten) > 0:
|
||||||
doc_info['kindergarten'] = ",".join(kindergarten)
|
doc_info['kindergarten'] = ",".join(kindergarten)
|
||||||
|
|
||||||
# 大学
|
# 大学
|
||||||
university = poiutils.find_around_by_location(curr_city, 5000, [lng, lat], "学校", "大学")
|
# university = poiutils.find_around_by_location(curr_city, 5000, [lng, lat], "学校", "大学")
|
||||||
|
university = poiutils.find_around_by_location_from_mongo(curr_city, 1000, lng, lat, "学校", "大学")
|
||||||
doc_info['university_num'] = len(university)
|
doc_info['university_num'] = len(university)
|
||||||
if len(university) > 0:
|
if len(university) > 0:
|
||||||
doc_info['university'] = ",".join(university)
|
doc_info['university'] = ",".join(university)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ mutex = Lock()
|
|||||||
|
|
||||||
def deal(actions, item):
|
def deal(actions, item):
|
||||||
global count
|
global count
|
||||||
curr_city = item['city']
|
curr_city = item['city_full']
|
||||||
lng = commutils.format_lat_lng(item['lng'])
|
lng = commutils.format_lat_lng(item['lng'])
|
||||||
lat = commutils.format_lat_lng(item['lat'])
|
lat = commutils.format_lat_lng(item['lat'])
|
||||||
|
|
||||||
@@ -33,8 +33,10 @@ def deal(actions, item):
|
|||||||
doc_info = dict()
|
doc_info = dict()
|
||||||
|
|
||||||
# 小学
|
# 小学
|
||||||
key_primary_school = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "学校", "小学", "重点")
|
# key_primary_school = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "学校", "小学", "重点")
|
||||||
ordinary_primary_school = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "学校", "小学", "普通")
|
key_primary_school = poiutils.find_around_by_location_from_mongo(curr_city, 1000, lng, lat, "学校", "小学", "重点")
|
||||||
|
# ordinary_primary_school = poiutils.find_around_by_location(curr_city, 1000, [lng, lat], "学校", "小学", "普通")
|
||||||
|
ordinary_primary_school = poiutils.find_around_by_location_from_mongo(curr_city, 1000, lng, lat, "学校", "小学","普通")
|
||||||
|
|
||||||
doc_info['key_primary_school_num'] = len(key_primary_school)
|
doc_info['key_primary_school_num'] = len(key_primary_school)
|
||||||
if len(key_primary_school) > 0:
|
if len(key_primary_school) > 0:
|
||||||
@@ -45,8 +47,10 @@ def deal(actions, item):
|
|||||||
doc_info['ordinary_primary_school'] = ",".join(ordinary_primary_school)
|
doc_info['ordinary_primary_school'] = ",".join(ordinary_primary_school)
|
||||||
|
|
||||||
# 中学
|
# 中学
|
||||||
key_middle_school = poiutils.find_around_by_location(curr_city, 2000, [lng, lat], "学校", "中学", "重点")
|
# key_middle_school = poiutils.find_around_by_location(curr_city, 2000, [lng, lat], "学校", "中学", "重点")
|
||||||
ordinary_middle_school = poiutils.find_around_by_location(curr_city, 2000, [lng, lat], "学校", "中学", "普通")
|
key_middle_school = poiutils.find_around_by_location_from_mongo(curr_city, 1000, lng, lat, "学校", "中学", "重点")
|
||||||
|
# ordinary_middle_school = poiutils.find_around_by_location(curr_city, 2000, [lng, lat], "学校", "中学", "普通")
|
||||||
|
ordinary_middle_school = poiutils.find_around_by_location_from_mongo(curr_city, 1000, lng, lat, "学校", "中学","普通")
|
||||||
|
|
||||||
doc_info['key_middle_school_num'] = len(key_middle_school)
|
doc_info['key_middle_school_num'] = len(key_middle_school)
|
||||||
if len(key_middle_school) > 0:
|
if len(key_middle_school) > 0:
|
||||||
@@ -103,4 +107,4 @@ if pd.notna(sys_city) and "," in sys_city:
|
|||||||
for city in cities:
|
for city in cities:
|
||||||
sync(city)
|
sync(city)
|
||||||
else:
|
else:
|
||||||
sync(sys_city)
|
sync(sys_city)
|
||||||
|
|||||||
@@ -33,13 +33,15 @@ def deal(actions, item):
|
|||||||
|
|
||||||
doc_info = dict()
|
doc_info = dict()
|
||||||
# 三甲
|
# 三甲
|
||||||
top_three_hospital = poiutils.find_around_by_location(curr_city, 5000, [lng, lat], "医院", "三甲医院")
|
# top_three_hospital = poiutils.find_around_by_location(curr_city, 5000, [lng, lat], "医院", "三甲医院")
|
||||||
|
top_three_hospital = poiutils.find_around_by_location_from_mongo(curr_city, 5000, lng, lat, "医院", None,"三甲")
|
||||||
doc_info['top_three_hospital_num'] = len(top_three_hospital)
|
doc_info['top_three_hospital_num'] = len(top_three_hospital)
|
||||||
if len(top_three_hospital) > 0:
|
if len(top_three_hospital) > 0:
|
||||||
doc_info['top_three_hospital'] = ",".join(top_three_hospital)
|
doc_info['top_three_hospital'] = ",".join(top_three_hospital)
|
||||||
|
|
||||||
# 非三甲
|
# 非三甲
|
||||||
non_3a_hospital = poiutils.find_around_by_location(curr_city, 5000, [lng, lat], "医院", "普通医院")
|
# non_3a_hospital = poiutils.find_around_by_location(curr_city, 5000, [lng, lat], "医院", "普通医院")
|
||||||
|
non_3a_hospital = poiutils.find_around_by_location_from_mongo(curr_city, 5000, lng, lat, "医院", None,"普通")
|
||||||
doc_info['non_3a_hospital_num'] = len(non_3a_hospital)
|
doc_info['non_3a_hospital_num'] = len(non_3a_hospital)
|
||||||
if len(non_3a_hospital) > 0:
|
if len(non_3a_hospital) > 0:
|
||||||
doc_info['non_3a_hospital'] = ",".join(non_3a_hospital)
|
doc_info['non_3a_hospital'] = ",".join(non_3a_hospital)
|
||||||
|
|||||||
Reference in New Issue
Block a user