SShen11 commited on
Commit
31ae338
·
verified ·
1 Parent(s): f8a413e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -9
app.py CHANGED
@@ -458,7 +458,7 @@ def POI_distribution(location1,location2,categories):
458
  svgpoifile=blankfig.savefig(svg_poipath, format='svg', transparent=True)
459
  message_box="None"
460
 
461
- return [poi_file_name,svg_poiname,run_count,"区域过大,超过3KM限制",message_box]
462
 
463
 
464
  def POI_kernel(location1,location2,category):
@@ -502,19 +502,28 @@ def POI_kernel(location1,location2,category):
502
  poi_dis_file=plt.savefig(poi_file_path, dpi=300)
503
  svgpoifile=blankfig.savefig(svg_poipath, format='svg', transparent=True)
504
  message_box="区域内没有该类型POI点"
505
- return [poi_file_name,svg_poiname,run_count2,'区域选择符合限制',message_box]
506
  else:
507
  message_box="POI获取正常"
508
 
509
  fig = plt.figure(figsize=(14,10),dpi = 100)
510
  ax = fig.add_subplot(111)
511
- points_bounds = gdf_output.total_bounds
512
- scale_factor = 3
513
 
514
- rec_bounds = [points_bounds[0] - (points_bounds[2] - points_bounds[0])/scale_factor,
515
- points_bounds[1] - (points_bounds[3] - points_bounds[1])/scale_factor,
516
- points_bounds[2] + (points_bounds[2] - points_bounds[0])/scale_factor,
517
- points_bounds[3] + (points_bounds[3] - points_bounds[1])/scale_factor]
 
 
 
 
 
 
 
 
 
518
  bounds=[rec_bounds[0],rec_bounds[1],rec_bounds[2],rec_bounds[3]]
519
  difference_x = bounds[2] - bounds[0]
520
  difference_y = bounds[3] - bounds[1]
@@ -612,7 +621,7 @@ def POI_kernel(location1,location2,category):
612
  poi_ker_file= plt.savefig(poiker_file_path, dpi=300)
613
  svgkerfile=fig.savefig(svgker_path, format='svg', transparent=True)
614
  print(f"文件保存路径:{poiker_file_path}")
615
- return [poiker_file_name,svgker_name,run_count, '区域选择符合限制',message_box]
616
 
617
  else:
618
  blankfig=plt.figure(figsize=(14,10),dpi = 100)
 
458
  svgpoifile=blankfig.savefig(svg_poipath, format='svg', transparent=True)
459
  message_box="None"
460
 
461
+ return [poi_file_name,svg_poiname,run_count2,"区域过大,超过3KM限制",message_box]
462
 
463
 
464
  def POI_kernel(location1,location2,category):
 
502
  poi_dis_file=plt.savefig(poi_file_path, dpi=300)
503
  svgpoifile=blankfig.savefig(svg_poipath, format='svg', transparent=True)
504
  message_box="区域内没有该类型POI点"
505
+ return [poi_file_name,svg_poiname,run_count3,'区域选择符合限制',message_box]
506
  else:
507
  message_box="POI获取正常"
508
 
509
  fig = plt.figure(figsize=(14,10),dpi = 100)
510
  ax = fig.add_subplot(111)
511
+ # points_bounds = gdf_output.total_bounds
512
+ # scale_factor = 3
513
 
514
+ # rec_bounds = [points_bounds[0] - (points_bounds[2] - points_bounds[0])/scale_factor,
515
+ # points_bounds[1] - (points_bounds[3] - points_bounds[1])/scale_factor,
516
+ # points_bounds[2] + (points_bounds[2] - points_bounds[0])/scale_factor,
517
+ # points_bounds[3] + (points_bounds[3] - points_bounds[1])/scale_factor]
518
+
519
+ wgsmin_long, wgsmin_lat=cconv.bd09_to_wgs84(min_long,min_lat)
520
+ wgsmax_long,wgsmax_lat=cconv.bd09_to_wgs84(max_long,max_lat)
521
+ scale_factor = 3
522
+ rec_bounds = [wgsmin_long - (wgsmax_long - wgsmin_long)/scale_factor,
523
+ wgsmin_lat - (wgsmax_lat -wgsmin_lat)/scale_factor,
524
+ wgsmax_long + (wgsmax_long - wgsmin_long)/scale_factor,
525
+ wgsmax_lat + (wgsmax_lat - wgsmin_lat)/scale_factor]
526
+
527
  bounds=[rec_bounds[0],rec_bounds[1],rec_bounds[2],rec_bounds[3]]
528
  difference_x = bounds[2] - bounds[0]
529
  difference_y = bounds[3] - bounds[1]
 
621
  poi_ker_file= plt.savefig(poiker_file_path, dpi=300)
622
  svgkerfile=fig.savefig(svgker_path, format='svg', transparent=True)
623
  print(f"文件保存路径:{poiker_file_path}")
624
+ return [poiker_file_name,svgker_name,run_count3, '区域选择符合限制',message_box]
625
 
626
  else:
627
  blankfig=plt.figure(figsize=(14,10),dpi = 100)