叶片地图中的不同标记可以使用不同的颜色吗?不同颜色的频率信号范围不同

时间:2020-02-05 18:55:27

标签: python pandas google-maps data-science folium

Sample_csv_data

import pandas as pd

df = pd.read_csv('C:/Nishant/Gtech/folium.csv',sep=',')
subset=df.sample(n=700)
subset.tail()

Plot

import folium from folium.plugins 
import FastMarkerCluster

print(df['Lon'].mean())
print(df['Lat'].mean())

m=folium.Map(location=[df['Lat'].mean(),df['Lon'].mean()],zoom_start=25)

def add_marker(row):
    marker = folium.CircleMarker([row['Lat'],row['Lon']],radius=2,color='red',popup=row['RSRP_Signal'])

marker.add_to(m) 

subset.apply(add_marker,axis=1)

m.save('C:/Nishant/Gtech/folium.html')

m

1 个答案:

答案 0 :(得分:0)

import folium
from folium.plugins 
import FastMarkerCluster


print(df['Lon'].mean() )

print(df['Lat'].mean())


m=folium.Map(location=[df['Lat'].mean(),df['Lon'].mean()],zoom_start=15)
def add_marker(row):
    if row['RSRP_Signal']>-80:

marker=folium.CircleMarker([row['Lat'],row['Lon']],radius=2,color='green',popup=row['RSRP_Signal'])
        marker.add_to(m)

    elif row['RSRP_Signal']>-100:
        marker=folium.CircleMarker([row['Lat'],row['Lon']],radius=2,color='blue',popup=row['RSRP_Signal'])
        marker.add_to(m)

    else:
        marker=folium.CircleMarker([row['Lat'],row['Lon']],radius=2,color='red',popup=row['RSRP_Signal'])
        marker.add_to(m)


subset.apply(add_marker,axis=1)
m.save('C:/Nishant/Gtech/folium.html')
m