original_docstring: Exports location_ids with the vornoi shapes
docstring: Exports location_ids with the vornoi shapes
docstring_tokens: Exports location_ids with the vornoi shapes
code: def export_location_with_voronois(crs, path_shapefiles, regions, pathout, file_name, username, query):
      """Exports location_ids with the vornoi shapes"""
      
      locations = read_location_table(username, query)
      cdr_geo = locations_as_geo(locations)
      voronoi_geo_in_tusc = towers_vornois_in_tuscany(locations, crs, path_shapefiles, regions)
      cdr_geo.crs=crs
      voronoi_geo_in_tusc.crs=crs
      j=gpd.sjoin(cdr_geo, voronoi_geo_in_tusc, how='right')
      j['region']=j['region'].astype(float)
      j['location_id']=j['location_id'].astype(float)
      locations_with_voronois=j[['location_id', 'lat', 'lon', 'region', 'geometry']].set_index('location_id')
      locations_with_voronois.to_file(pathout+file_name)
code_tokens: def export_location_with_voronois ( crs , path_shapefiles , regions , pathout , file_name , username , query ) : locations = read_location_table ( username , query ) cdr_geo = locations_as_geo ( locations ) voronoi_geo_in_tusc = towers_vornois_in_tuscany ( locations , crs , path_shapefiles , regions ) cdr_geo . crs = crs voronoi_geo_in_tusc . crs = crs j = gpd . sjoin ( cdr_geo , voronoi_geo_in_tusc , how = 'right' ) j [ 'region' ] = j [ 'region' ] . astype ( float ) j [ 'location_id' ] = j [ 'location_id' ] . astype ( float ) locations_with_voronois = j [ [ 'location_id' , 'lat' , 'lon' , 'region' , 'geometry' ] ] . set_index ( 'location_id' ) locations_with_voronois . to_file ( pathout + file_name )
short_docstring: Exports location_ids with the vornoi shapes
short_docstring_tokens: Exports location_ids with the vornoi shapes
comment: """Exports location_ids with the vornoi shapes"""