핸드폰을 드는 것도 어려움
9/29 x ray 다시 찍지 않고 이후 재 방문 요청
10/5 근처 병원으로 변경, x ray 확인, 골절 의심되나 추가 확인 필요
10/10 부기 및 자극 시 통증 상태로 보아 골덜은 아닐 수 있음. 반깁스를 압박밴드로 변경
핸드폰 정도 들어 올리는 것은 가능
...
import folium from folium import Choropleth, Circle, Marker from folium.plugins import HeatMap, MarkerCluster
# Create a map
m_1 = folium.Map(location=[42.32,-71.0589], tiles='openstreetmap', zoom_start=10)
# Display the map
m_1
* tiles
cartodbdark_matter
cartodbpositron
cartodbpositronnolabels
cartodbpositrononlylabels
cloudmade
mapbox
mapboxbright
mapboxcontrolroom
openstreetmap
stamenterrain
stamentoner
stamentonerbackground
stamentonerlabels
stamenwatercolor
# Add points to the map
for idx, row in daytime_robberies.iterrows():
Marker([row['Lat'], row['Long']]).add_to(m_2)
# Add Cluster to the map
mc = MarkerCluster()
for idx, row in daytime_robberies.iterrows():
if not math.isnan(row['Long']) and not math.isnan(row['Lat']):
mc.add_child(Marker([row['Lat'], row['Long']]))
m_3.add_child(mc)
def color_producer(val):
if val <= 12:
return 'forestgreen'
else:
return 'darkred'
# Add a bubble map to the base map
for i in range(0,len(daytime_robberies)):
Circle(
location=[daytime_robberies.iloc[i]['Lat'], daytime_robberies.iloc[i]['Long']],
radius=20,
popup= '...' ,
color=color_producer(daytime_robberies.iloc[i]['HOUR'])).add_to(m_4)
# Add a heatmap to the base map
HeatMap(data=crimes[['Lat', 'Long']], radius=10).add_to(m_5)
# Add a choropleth map to the base map
Choropleth(geo_data=districts.__geo_interface__,
data=plot_dict,
key_on="feature.id",
fill_color='YlGnBu',
legend_name='Major criminal incidents (Jan-Aug 2018)'
).add_to(m_6)
geo_data is a GeoJSON FeatureCollection containing the boundaries of each geographical area.
- In the code above, we convert the
districts GeoDataFrame to a GeoJSON FeatureCollection with the __geo_interface__ attribute.
data is a Pandas Series containing the values that will be used to color-code each geographical area.
key_on will always be set to feature.id.
- This refers to the fact that the GeoDataFrame used for
geo_data and the Pandas Series provided in data have the same index. To understand the details, we'd have to look more closely at the structure of a GeoJSON Feature Collection (where the value corresponding to the "features" key is a list, wherein each entry is a dictionary containing an "id" key).
fill_color sets the color scale.
legend_name labels the legend in the top right corner of the map.
from geopandas.tools import geocode
result = geocode("The Great Pyramid of Giza", provider="nominatim")
def my_geocoder(row): try: point = geocode(row, provider='nominatim').geometry.iloc[0] return pd.Series({'Latitude': point.y, 'Longitude': point.x, 'geometry': point}) except: return None universities[['Latitude', 'Longitude', 'geometry']] = universities.apply(lambda x: my_geocoder(x['Name']), axis=1) print("{}% of addresses were geocoded!".format( (1 - sum(np.isnan(universities["Latitude"])) / len(universities)) * 100)) # Drop universities that were not successfully geocoded universities = universities.loc[~np.isnan(universities["Latitude"])] universities = gpd.GeoDataFrame(universities, geometry=universities.geometry) universities.crs = {'init': 'epsg:4326'} universities.head()
< Spartial Join >
# Use spatial join to match universities to countries in Europe
european_universities = gpd.sjoin(universities, europe)
# Investigate the result
print("We located {} universities.".format(len(universities)))
print("Only {} of the universities were located in Europe (in {} different countries).".format(
len(european_universities), len(european_universities.name.unique())))
< Porximaty Analysis >
# Measure distance from release to each station
distances = stations.geometry.distance(recent_release.geometry)
distances
two_mile_buffer = stations.geometry.buffer(2*5280)
# Plot each polygon on the map
folium.GeoJson(two_mile_buffer.to_crs(epsg=4326)).add_to(m)
# Turn group of polygons into single multipolygon
my_union = two_mile_buffer.geometry.unary_union
print('Type:', type(my_union))
# Show the MultiPolygon object
my_union
# The closest station is less than two miles away
my_union.contains(releases.iloc[360].geometry)
# The closest station is more than two miles away
my_union.contains(releases.iloc[358].geometry
9/26 골절인지 아닌지 확인 안됨. 이후 미세골절여부 확인 핸드폰을 드는 것도 어려움 9/29 x ray 다시 찍지 않고 이후 재 방문 요청 ...