SlideShare a Scribd company logo
Folium – a wrapper for
Quick Start
Installation
Use install.packages("leaflet") to installize the package or directly from
Github devtools::install_github("rstudio/leaflet").
First Map
m <- leaflet() %>% # leaflet works with the pipe operator
addTiles() %>% # setup the default OpenStreetMap map tiles
addMarkers(lng = 174.768, lat = -36.852, popup = "The birthplace of R”)
# add a single point layer
m
Leaflet Cheat Sheet
an open-source JavaScript library for mobile-friendly interactive maps
for
Ge
Map Widget
Initialization
m <- leaflet(options = leafletOptions(...))
center Initial geographic center of the map
zoom Initial map zoom level
minZoom Minimum zoom level of the map
maxZoom Maximum zoom level of the map
Map Methods
m %>% setView(lng,	lat,	zoom,	options	=	list())
Set	the	view	of	the	map	(center	and	zoom	level)
m %>% fitBounds(lng1,	lat1,	lng2,	lat2)
Fit the view into the rectangle [lng1, lat1] - [lng2, lat2]
m %>% clearBounds()
Clear the bound, automatically determine from the map elements
Data Object
Both leaflet() and the map layers have an optional data parameter that is
designed to receive spatial data with the following formats:
Base R The arguments of all layers take normal R objects:
df <- data.frame(lat = ..., lng = ... )
leaflet(df) %>% addTiles() %>% addCircles()
sp package library(sp) Useful functions:
SpatialPoints, SpatialLines, SpatialPolygons, ...
maps package library(maps) Build a map of states with colors:
mapStates <- map("state", fill = TRUE, plot = FALSE)
leaflet(mapStates) %>% addTiles() %>%
addPolygons(fillColor = topo.colors(10, alpha =
NULL), stroke = FALSE)
Markers
Popups and Labels
Use markers to call out points, express locations with latitude/longitude
coordinates, appear as icons or as circles.
Data come from vectors or assigned data frame, or sp package objects.
Icon Markers
Regular Icons: default and simple
addMarkers(lng, lat, popup, label) add basic icon markers
makeIcon/icons (iconUrl, iconWidth, iconHeight, iconAnchorX, iconAnchorY,
shadowUrl, shadowWidth, shadowHeight, ... ) customize marker icons
iconList() create a list of icons
Awesome Icons: customizable with colors and icons
addAwesomeMarkers, makeAwesomeIcon, awesomeIcons, awesomeIconList
Marker Clusters: option of addMarters()
clusterOptions = markerClusterOptions()
freezeAtZoom Freeze the cluster at assigned zoom level
Circle Markers
addCircleMarkers(color, radius, stroke, opacity, ... )
Customize their color, radius, stroke, opacity
Lines and Shapes
Kejia Shi @ Data Science Institute, Columbia University in the City of New York, Kejia.Shi@Columbia.edu
addPopups(lng, lat, ...content..., options) Add standalone popups
options = popupOptions(closeButton=FALSE)
addMarkers(..., popup, ... ) Show popups with markers or shapes
addMarkers(..., label, labelOptions... ) Show labels with markers or shapes
labelOptions = labelOptions(noHide,	textOnly,	textsize,	direction,	style)
addLabelOnlyMarkers() Add labels without markers
Polygons and Polylines
addPolygons(color, weight=1, smoothFactor=0.5, opacity=1.0, fillOpacity=0.5,
fillColor= ~colorQuantile("YlOrRd", ALAND)(ALAND), highlightOptions, … )
highlightOptions(color, weight=2, bringToFront=TRUE) highlight shapes
Use rmapshaper::ms_simplify to simplify complex shapes
Circles addCircles(lng, lat, weight=1, radius, ... )
Rectangles addRectangles(lng1, lat1, lng2, lat2, fillColor="transparent", ... )
Basemaps
addTiles() providers$Stamen.Toner, CartoDB.Positron, Esri.NatGeoWorldMap
Default Tiles Third-Party Tiles addProviderTiles()
Use addTiles() to add a custom map tile URL template, use addWMSTiles() to
add WMS (Web Map Service) tiles
There are two
* To read into
geojsonio::geo
* Or to use the
addTopoJSON/
Styles can also
Other package
generate the d
To integrate a L
* In the UI, call
* On the server
* Inside the ren
To modify an e
can use leafletP
server side.
Other useful fu
fitBounds(0, 0, 1
addCircles(1:10,
removeShape(c
clearShapes()
Object Events
Object event na
input$MAPID_O
Triger an event
Valid values for
Valid values for
All of these eve
or a list() that in
* lat The latitud
* lng The longit
* id The layerI
GeoJSON event
* featureId The
* properties Th
Map Events
input$MAPID_c
input$MAPID_b
input$MAPID_z
an	open-source	JavaScript	library	for	mobile-friendly	 interactive	 maps	
Markers
Icon Markers
> folium.Marker([lat, lon], popup, tooltip) - add basic icon markers
> folium.Icon(color, icon) - customize marker icons
Circle Markers
> folium.Circle(location, fill_color, fill_opacity, color, color,_opacity,
radius, popup, …) - Customize the color, radius, stroke, opacity
Vincent/Vega and Altair/VegaLite Markers
> m = folium.Map(location)
> VegaPop = folium.Popup(max_width).add_child(folium.Vega(json,
width, height)) - built-in support for vincent and altair visualizations
> folium.Marker(location, popup=VegaPop).add_to(m)
MarkerClusters
> m = folium.Map(location)
> marker_cluster = MarkerCluster().add_to(m)
> folium.Marker([lat, lon], popup, tooltip).add_to(marker_cluster)
ClickForMarker and PopOvers
> m = folium.Map(location)
> m.add_child(folium.LatLngPopup()) - conveniently add lat/lng
popovers
> m.add_child(folium.ClickForMarker(popup)) - on-the-fly placement of
markers
BoatMarker
> plugins.BoatMarker(location, heading, wind_heading, wind_speed)
- also: color, popup, icon, **kws
Quick Start
Installation
Use: pip install folium
or pip install git+git+goo.gl/kmkGd3 - to install directly from GitHub
Basic Map
> import folium
> from folium import plugins
> m = folium.Map(location = [45.372, -121.6972])
> folium.Marker([45.3288, -121.6625],
                          popup='<i>Mt. Hood Meadows</i>',
                          tooltip=‘click me’).add_to(m)
> m
Lines and Shapes
Popups and Labels
Plugins
Basemaps
> folium.Map(location, tiles = ‘Stamen Toner’) - use a variety of tiles
Default ‘Stamen Toner’ ‘Mapbox Control Room’
‘Cartodb Positron’ ‘Stamen Terrain’ Custom
> folium.Popup(html, parse_html, max_width)
Vega Popup Fancy HTML Popup
Lines & PolyLineTextPath
> folium.PolyLine(locations, tooltip, popup).add_to(m) - also: color,
opacity, weight, smoothing_factor, line_cap, **kws
> plugins.PolyLineTextPath(folium.PolyLine(locations), text, repeat,
offset, attributes) - also: orientation, below, center,**kws
Polygons
> folium.Polygon(locations, tooltip, popup).add_to(m) - also: color,
opacity, weight, fill_color, fill_opacity, smooth_factor, no_clip, **kws
Circles
> folium.Circle(location, tooltip, popup).add_to(m) - also: color, opacity,
weight, fill_color, fill_opacity, radius, **kws
> folium.CircleMarker(location, tooltip, popup).add_to(m) - also: color,
opacity, weight, fill_color, fill_opacity, radius, **kws
Rectangles
> folium.Rectangle(bounds=[[lat,lon],[lat,lon]], tooltip,
popup).add_to(m) - also: color, fill_color, dash_array, weight, line_join,
line_cap, opacity, fill_opacity, **kws
GeoJson and TopoJson
GeoJson and GeoJsonCSS
> folium.GeoJson(GeoJson_path) - add name then use
folium.LayerControl().add_to(m)
> folium.GeoJsonCss(GeoJsonCss) - add styling, and popups into the data
TopoJson
> folium.TopoJson(TopoJson_path) - add name then use
folium.LayerControl().add_to(m)
Choropleth
> folium.choropleth(geo_data, data, columns, key_on, fill_color) -
also: name, threshold_scale, line_color, line_weight, line_opacity, legend_name,
topojson, **kws
ScrollZoomToggler, Terminator and Fullscreen
> plugins.ScrollZoomToggler().add_to(m)
> plugins.Terminator().add_to(m)
> plugins.Fullscreen(position) - also: title, title_cancel, force_serperation_button
Search, Draw and MeasureControl
> plugins.Search(GeoJson, search_zoom, geom_type).add_to(m)
- also: search_label, position, popup_on_found
> plugins.Draw().add_to(m) - also: export
> m.add_child(plugins.MeasureControl()) - also: position, primary_length_unit,
primary_area_unit, secondary_length_unit, secondary_area_unit
FloatImage
> plugins.FloatImage(url, bottom, left).add_to(m)
TimestampedGeoJson
> plugins.TimestampedGeoJson(GeoJson, period) - also: add_last_point,
dateOptions, auto_play…
HeatMap and HeatMapWithTime
> plugins.HeatMap(data).add_to(m) - also: name, radius, min_opacity, max_val,
blur, gradient, overlay, max_zoom
> plugins.HeatMapWithTime(data).add_to(m) - also: index, name, radius,
min_opacity, max_opacity, auto_play, position, …
CC BY Andrew Challis • andrewchallis@hotmail.co.uk • andrewchallis.co.uk • Learn more at http://python-visualization.github.io/folium/docs-master/ • package version 0.5.0 • Updated: 2017-10Adapted from Rstudio materials https://rstudio.github.io/leaflet/

More Related Content

What's hot

Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12sidg75
 
Database keys
Database keysDatabase keys
Database keys
Rahul Mishra
 
Oracle EBS R12.1.3_Installation_linux(64bit)_Pan_Tian
Oracle EBS R12.1.3_Installation_linux(64bit)_Pan_TianOracle EBS R12.1.3_Installation_linux(64bit)_Pan_Tian
Oracle EBS R12.1.3_Installation_linux(64bit)_Pan_Tian
Pan Tian
 
Visual Basic Programming
Visual Basic ProgrammingVisual Basic Programming
Visual Basic Programming
Osama Yaseen
 
AWR Sample Report
AWR Sample ReportAWR Sample Report
AWR Sample Report
Devendra Singh
 
Sql Constraints
Sql ConstraintsSql Constraints
Sql Constraints
I L0V3 CODING DR
 
Ms office practical
Ms office practicalMs office practical
Ms office practical
SureshBabuMannarColl
 
ER to Relational Mapping
ER to Relational MappingER to Relational Mapping
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
Bharat Kalia
 
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasksMS Access teaching powerpoint tasks
MS Access teaching powerpoint tasks
skomadina
 
Bank Database using MySQL
Bank Database using MySQL Bank Database using MySQL
Bank Database using MySQL
Paras
 
Wi fi hacking using fluxion in kali linux
Wi fi hacking using fluxion in kali linuxWi fi hacking using fluxion in kali linux
Wi fi hacking using fluxion in kali linux
TejasKore3
 
Odi interview questions
Odi interview questionsOdi interview questions
Odi interview questions
Udaykumar Sarana
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
1520lakshyagupta
 
Microsoft office
Microsoft officeMicrosoft office
Microsoft office
Tanjim Rasul
 
Transaction Properties in database | ACID Properties
Transaction Properties in database | ACID PropertiesTransaction Properties in database | ACID Properties
Transaction Properties in database | ACID Properties
nomanbarki
 
Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
MUHAMMED MASHAHIL PUKKUNNUMMAL
 
Ms access
Ms accessMs access
Ms access
Nagarajan
 
RDBMS
RDBMS RDBMS
RDBMS
RamSon Queen
 

What's hot (20)

Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
 
Database keys
Database keysDatabase keys
Database keys
 
Oracle EBS R12.1.3_Installation_linux(64bit)_Pan_Tian
Oracle EBS R12.1.3_Installation_linux(64bit)_Pan_TianOracle EBS R12.1.3_Installation_linux(64bit)_Pan_Tian
Oracle EBS R12.1.3_Installation_linux(64bit)_Pan_Tian
 
Visual Basic Programming
Visual Basic ProgrammingVisual Basic Programming
Visual Basic Programming
 
AWR Sample Report
AWR Sample ReportAWR Sample Report
AWR Sample Report
 
Sql Constraints
Sql ConstraintsSql Constraints
Sql Constraints
 
Ms office practical
Ms office practicalMs office practical
Ms office practical
 
ER to Relational Mapping
ER to Relational MappingER to Relational Mapping
ER to Relational Mapping
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasksMS Access teaching powerpoint tasks
MS Access teaching powerpoint tasks
 
Bank Database using MySQL
Bank Database using MySQL Bank Database using MySQL
Bank Database using MySQL
 
Wi fi hacking using fluxion in kali linux
Wi fi hacking using fluxion in kali linuxWi fi hacking using fluxion in kali linux
Wi fi hacking using fluxion in kali linux
 
Odi interview questions
Odi interview questionsOdi interview questions
Odi interview questions
 
MS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.pptMS-Access Tables Forms Queries Reports.ppt
MS-Access Tables Forms Queries Reports.ppt
 
Microsoft office
Microsoft officeMicrosoft office
Microsoft office
 
Transaction Properties in database | ACID Properties
Transaction Properties in database | ACID PropertiesTransaction Properties in database | ACID Properties
Transaction Properties in database | ACID Properties
 
Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
 
Ms access
Ms accessMs access
Ms access
 
RDBMS
RDBMS RDBMS
RDBMS
 
Sqlite
SqliteSqlite
Sqlite
 

Similar to Foliumcheatsheet

software engineering modules iii & iv.pptx
software engineering  modules iii & iv.pptxsoftware engineering  modules iii & iv.pptx
software engineering modules iii & iv.pptx
rani marri
 
Presentation on use of r statistics
Presentation on use of r statisticsPresentation on use of r statistics
Presentation on use of r statistics
Krishna Dhakal
 
Deck: A Go Package for Presentations
Deck: A Go Package for PresentationsDeck: A Go Package for Presentations
Deck: A Go Package for Presentations
Anthony Starks
 
[1D6]RE-view of Android L developer PRE-view
[1D6]RE-view of Android L developer PRE-view[1D6]RE-view of Android L developer PRE-view
[1D6]RE-view of Android L developer PRE-view
NAVER D2
 
Seeing your place in a new way - NodeconfEU 2018
Seeing your place in a new way -  NodeconfEU 2018Seeing your place in a new way -  NodeconfEU 2018
Seeing your place in a new way - NodeconfEU 2018
Melissa Auclaire
 
8. R Graphics with R
8. R Graphics with R8. R Graphics with R
8. R Graphics with R
FAO
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
Sander Kieft
 
R basics
R basicsR basics
R basics
Sagun Baijal
 
Poetry with R -- Dissecting the code
Poetry with R -- Dissecting the codePoetry with R -- Dissecting the code
Poetry with R -- Dissecting the code
Peter Solymos
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
sumitt6_25730773
 
SVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generationSVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generation
Anthony Starks
 
Python 03-parameters-graphics.pptx
Python 03-parameters-graphics.pptxPython 03-parameters-graphics.pptx
Python 03-parameters-graphics.pptx
TseChris
 
XIX PUG-PE - Pygame game development
XIX PUG-PE - Pygame game developmentXIX PUG-PE - Pygame game development
XIX PUG-PE - Pygame game development
matheuscmpm
 
Where2.0Now - Finding the heat in Thematic Maps
Where2.0Now - Finding the heat in Thematic MapsWhere2.0Now - Finding the heat in Thematic Maps
Where2.0Now - Finding the heat in Thematic Maps
John Fagan
 
Kotlin Mullets
Kotlin MulletsKotlin Mullets
Kotlin Mullets
James Ward
 
MatplotLib.pptx
MatplotLib.pptxMatplotLib.pptx
MatplotLib.pptx
Paras Intotech
 
mobl
moblmobl
mobl
zefhemel
 

Similar to Foliumcheatsheet (20)

software engineering modules iii & iv.pptx
software engineering  modules iii & iv.pptxsoftware engineering  modules iii & iv.pptx
software engineering modules iii & iv.pptx
 
Anthony Starks - deck
Anthony Starks - deckAnthony Starks - deck
Anthony Starks - deck
 
Presentation on use of r statistics
Presentation on use of r statisticsPresentation on use of r statistics
Presentation on use of r statistics
 
Deck: A Go Package for Presentations
Deck: A Go Package for PresentationsDeck: A Go Package for Presentations
Deck: A Go Package for Presentations
 
[1D6]RE-view of Android L developer PRE-view
[1D6]RE-view of Android L developer PRE-view[1D6]RE-view of Android L developer PRE-view
[1D6]RE-view of Android L developer PRE-view
 
Seeing your place in a new way - NodeconfEU 2018
Seeing your place in a new way -  NodeconfEU 2018Seeing your place in a new way -  NodeconfEU 2018
Seeing your place in a new way - NodeconfEU 2018
 
8. R Graphics with R
8. R Graphics with R8. R Graphics with R
8. R Graphics with R
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
R basics
R basicsR basics
R basics
 
Poetry with R -- Dissecting the code
Poetry with R -- Dissecting the codePoetry with R -- Dissecting the code
Poetry with R -- Dissecting the code
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
SVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generationSVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generation
 
Python 03-parameters-graphics.pptx
Python 03-parameters-graphics.pptxPython 03-parameters-graphics.pptx
Python 03-parameters-graphics.pptx
 
XIX PUG-PE - Pygame game development
XIX PUG-PE - Pygame game developmentXIX PUG-PE - Pygame game development
XIX PUG-PE - Pygame game development
 
Go之道
Go之道Go之道
Go之道
 
Where2.0Now - Finding the heat in Thematic Maps
Where2.0Now - Finding the heat in Thematic MapsWhere2.0Now - Finding the heat in Thematic Maps
Where2.0Now - Finding the heat in Thematic Maps
 
Kotlin Mullets
Kotlin MulletsKotlin Mullets
Kotlin Mullets
 
MatplotLib.pptx
MatplotLib.pptxMatplotLib.pptx
MatplotLib.pptx
 
JQuery Flot
JQuery FlotJQuery Flot
JQuery Flot
 
mobl
moblmobl
mobl
 

More from Nishant Upadhyay

Multivariate calculus
Multivariate calculusMultivariate calculus
Multivariate calculus
Nishant Upadhyay
 
Multivariate calculus
Multivariate calculusMultivariate calculus
Multivariate calculus
Nishant Upadhyay
 
Matrices1
Matrices1Matrices1
Matrices1
Nishant Upadhyay
 
Vectors2
Vectors2Vectors2
Mathematics for machine learning calculus formulasheet
Mathematics for machine learning calculus formulasheetMathematics for machine learning calculus formulasheet
Mathematics for machine learning calculus formulasheet
Nishant Upadhyay
 
Pandas pythonfordatascience
Pandas pythonfordatasciencePandas pythonfordatascience
Pandas pythonfordatascience
Nishant Upadhyay
 
Numpy python cheat_sheet
Numpy python cheat_sheetNumpy python cheat_sheet
Numpy python cheat_sheet
Nishant Upadhyay
 
Maths4ml linearalgebra-formula
Maths4ml linearalgebra-formulaMaths4ml linearalgebra-formula
Maths4ml linearalgebra-formula
Nishant Upadhyay
 
Sqlcheetsheet
SqlcheetsheetSqlcheetsheet
Sqlcheetsheet
Nishant Upadhyay
 
Sql cheat-sheet
Sql cheat-sheetSql cheat-sheet
Sql cheat-sheet
Nishant Upadhyay
 
My sql installationguide_windows
My sql installationguide_windowsMy sql installationguide_windows
My sql installationguide_windows
Nishant Upadhyay
 
Company handout
Company handoutCompany handout
Company handout
Nishant Upadhyay
 
Python bokeh cheat_sheet
Python bokeh cheat_sheet Python bokeh cheat_sheet
Python bokeh cheat_sheet
Nishant Upadhyay
 
Python matplotlib cheat_sheet
Python matplotlib cheat_sheetPython matplotlib cheat_sheet
Python matplotlib cheat_sheet
Nishant Upadhyay
 
Python seaborn cheat_sheet
Python seaborn cheat_sheetPython seaborn cheat_sheet
Python seaborn cheat_sheet
Nishant Upadhyay
 

More from Nishant Upadhyay (15)

Multivariate calculus
Multivariate calculusMultivariate calculus
Multivariate calculus
 
Multivariate calculus
Multivariate calculusMultivariate calculus
Multivariate calculus
 
Matrices1
Matrices1Matrices1
Matrices1
 
Vectors2
Vectors2Vectors2
Vectors2
 
Mathematics for machine learning calculus formulasheet
Mathematics for machine learning calculus formulasheetMathematics for machine learning calculus formulasheet
Mathematics for machine learning calculus formulasheet
 
Pandas pythonfordatascience
Pandas pythonfordatasciencePandas pythonfordatascience
Pandas pythonfordatascience
 
Numpy python cheat_sheet
Numpy python cheat_sheetNumpy python cheat_sheet
Numpy python cheat_sheet
 
Maths4ml linearalgebra-formula
Maths4ml linearalgebra-formulaMaths4ml linearalgebra-formula
Maths4ml linearalgebra-formula
 
Sqlcheetsheet
SqlcheetsheetSqlcheetsheet
Sqlcheetsheet
 
Sql cheat-sheet
Sql cheat-sheetSql cheat-sheet
Sql cheat-sheet
 
My sql installationguide_windows
My sql installationguide_windowsMy sql installationguide_windows
My sql installationguide_windows
 
Company handout
Company handoutCompany handout
Company handout
 
Python bokeh cheat_sheet
Python bokeh cheat_sheet Python bokeh cheat_sheet
Python bokeh cheat_sheet
 
Python matplotlib cheat_sheet
Python matplotlib cheat_sheetPython matplotlib cheat_sheet
Python matplotlib cheat_sheet
 
Python seaborn cheat_sheet
Python seaborn cheat_sheetPython seaborn cheat_sheet
Python seaborn cheat_sheet
 

Recently uploaded

一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Subhajit Sahu
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
NABLAS株式会社
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
Tiktokethiodaily
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
vcaxypu
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
enxupq
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
nscud
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
AbhimanyuSinha9
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
mbawufebxi
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
v3tuleee
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
vcaxypu
 

Recently uploaded (20)

一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
一比一原版(RUG毕业证)格罗宁根大学毕业证成绩单
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
 

Foliumcheatsheet

  • 1. Folium – a wrapper for Quick Start Installation Use install.packages("leaflet") to installize the package or directly from Github devtools::install_github("rstudio/leaflet"). First Map m <- leaflet() %>% # leaflet works with the pipe operator addTiles() %>% # setup the default OpenStreetMap map tiles addMarkers(lng = 174.768, lat = -36.852, popup = "The birthplace of R”) # add a single point layer m Leaflet Cheat Sheet an open-source JavaScript library for mobile-friendly interactive maps for Ge Map Widget Initialization m <- leaflet(options = leafletOptions(...)) center Initial geographic center of the map zoom Initial map zoom level minZoom Minimum zoom level of the map maxZoom Maximum zoom level of the map Map Methods m %>% setView(lng, lat, zoom, options = list()) Set the view of the map (center and zoom level) m %>% fitBounds(lng1, lat1, lng2, lat2) Fit the view into the rectangle [lng1, lat1] - [lng2, lat2] m %>% clearBounds() Clear the bound, automatically determine from the map elements Data Object Both leaflet() and the map layers have an optional data parameter that is designed to receive spatial data with the following formats: Base R The arguments of all layers take normal R objects: df <- data.frame(lat = ..., lng = ... ) leaflet(df) %>% addTiles() %>% addCircles() sp package library(sp) Useful functions: SpatialPoints, SpatialLines, SpatialPolygons, ... maps package library(maps) Build a map of states with colors: mapStates <- map("state", fill = TRUE, plot = FALSE) leaflet(mapStates) %>% addTiles() %>% addPolygons(fillColor = topo.colors(10, alpha = NULL), stroke = FALSE) Markers Popups and Labels Use markers to call out points, express locations with latitude/longitude coordinates, appear as icons or as circles. Data come from vectors or assigned data frame, or sp package objects. Icon Markers Regular Icons: default and simple addMarkers(lng, lat, popup, label) add basic icon markers makeIcon/icons (iconUrl, iconWidth, iconHeight, iconAnchorX, iconAnchorY, shadowUrl, shadowWidth, shadowHeight, ... ) customize marker icons iconList() create a list of icons Awesome Icons: customizable with colors and icons addAwesomeMarkers, makeAwesomeIcon, awesomeIcons, awesomeIconList Marker Clusters: option of addMarters() clusterOptions = markerClusterOptions() freezeAtZoom Freeze the cluster at assigned zoom level Circle Markers addCircleMarkers(color, radius, stroke, opacity, ... ) Customize their color, radius, stroke, opacity Lines and Shapes Kejia Shi @ Data Science Institute, Columbia University in the City of New York, Kejia.Shi@Columbia.edu addPopups(lng, lat, ...content..., options) Add standalone popups options = popupOptions(closeButton=FALSE) addMarkers(..., popup, ... ) Show popups with markers or shapes addMarkers(..., label, labelOptions... ) Show labels with markers or shapes labelOptions = labelOptions(noHide, textOnly, textsize, direction, style) addLabelOnlyMarkers() Add labels without markers Polygons and Polylines addPolygons(color, weight=1, smoothFactor=0.5, opacity=1.0, fillOpacity=0.5, fillColor= ~colorQuantile("YlOrRd", ALAND)(ALAND), highlightOptions, … ) highlightOptions(color, weight=2, bringToFront=TRUE) highlight shapes Use rmapshaper::ms_simplify to simplify complex shapes Circles addCircles(lng, lat, weight=1, radius, ... ) Rectangles addRectangles(lng1, lat1, lng2, lat2, fillColor="transparent", ... ) Basemaps addTiles() providers$Stamen.Toner, CartoDB.Positron, Esri.NatGeoWorldMap Default Tiles Third-Party Tiles addProviderTiles() Use addTiles() to add a custom map tile URL template, use addWMSTiles() to add WMS (Web Map Service) tiles There are two * To read into geojsonio::geo * Or to use the addTopoJSON/ Styles can also Other package generate the d To integrate a L * In the UI, call * On the server * Inside the ren To modify an e can use leafletP server side. Other useful fu fitBounds(0, 0, 1 addCircles(1:10, removeShape(c clearShapes() Object Events Object event na input$MAPID_O Triger an event Valid values for Valid values for All of these eve or a list() that in * lat The latitud * lng The longit * id The layerI GeoJSON event * featureId The * properties Th Map Events input$MAPID_c input$MAPID_b input$MAPID_z an open-source JavaScript library for mobile-friendly interactive maps Markers Icon Markers > folium.Marker([lat, lon], popup, tooltip) - add basic icon markers > folium.Icon(color, icon) - customize marker icons Circle Markers > folium.Circle(location, fill_color, fill_opacity, color, color,_opacity, radius, popup, …) - Customize the color, radius, stroke, opacity Vincent/Vega and Altair/VegaLite Markers > m = folium.Map(location) > VegaPop = folium.Popup(max_width).add_child(folium.Vega(json, width, height)) - built-in support for vincent and altair visualizations > folium.Marker(location, popup=VegaPop).add_to(m) MarkerClusters > m = folium.Map(location) > marker_cluster = MarkerCluster().add_to(m) > folium.Marker([lat, lon], popup, tooltip).add_to(marker_cluster) ClickForMarker and PopOvers > m = folium.Map(location) > m.add_child(folium.LatLngPopup()) - conveniently add lat/lng popovers > m.add_child(folium.ClickForMarker(popup)) - on-the-fly placement of markers BoatMarker > plugins.BoatMarker(location, heading, wind_heading, wind_speed) - also: color, popup, icon, **kws Quick Start Installation Use: pip install folium or pip install git+git+goo.gl/kmkGd3 - to install directly from GitHub Basic Map > import folium > from folium import plugins > m = folium.Map(location = [45.372, -121.6972]) > folium.Marker([45.3288, -121.6625],                           popup='<i>Mt. Hood Meadows</i>',                           tooltip=‘click me’).add_to(m) > m Lines and Shapes Popups and Labels Plugins Basemaps > folium.Map(location, tiles = ‘Stamen Toner’) - use a variety of tiles Default ‘Stamen Toner’ ‘Mapbox Control Room’ ‘Cartodb Positron’ ‘Stamen Terrain’ Custom > folium.Popup(html, parse_html, max_width) Vega Popup Fancy HTML Popup Lines & PolyLineTextPath > folium.PolyLine(locations, tooltip, popup).add_to(m) - also: color, opacity, weight, smoothing_factor, line_cap, **kws > plugins.PolyLineTextPath(folium.PolyLine(locations), text, repeat, offset, attributes) - also: orientation, below, center,**kws Polygons > folium.Polygon(locations, tooltip, popup).add_to(m) - also: color, opacity, weight, fill_color, fill_opacity, smooth_factor, no_clip, **kws Circles > folium.Circle(location, tooltip, popup).add_to(m) - also: color, opacity, weight, fill_color, fill_opacity, radius, **kws > folium.CircleMarker(location, tooltip, popup).add_to(m) - also: color, opacity, weight, fill_color, fill_opacity, radius, **kws Rectangles > folium.Rectangle(bounds=[[lat,lon],[lat,lon]], tooltip, popup).add_to(m) - also: color, fill_color, dash_array, weight, line_join, line_cap, opacity, fill_opacity, **kws GeoJson and TopoJson GeoJson and GeoJsonCSS > folium.GeoJson(GeoJson_path) - add name then use folium.LayerControl().add_to(m) > folium.GeoJsonCss(GeoJsonCss) - add styling, and popups into the data TopoJson > folium.TopoJson(TopoJson_path) - add name then use folium.LayerControl().add_to(m) Choropleth > folium.choropleth(geo_data, data, columns, key_on, fill_color) - also: name, threshold_scale, line_color, line_weight, line_opacity, legend_name, topojson, **kws ScrollZoomToggler, Terminator and Fullscreen > plugins.ScrollZoomToggler().add_to(m) > plugins.Terminator().add_to(m) > plugins.Fullscreen(position) - also: title, title_cancel, force_serperation_button Search, Draw and MeasureControl > plugins.Search(GeoJson, search_zoom, geom_type).add_to(m) - also: search_label, position, popup_on_found > plugins.Draw().add_to(m) - also: export > m.add_child(plugins.MeasureControl()) - also: position, primary_length_unit, primary_area_unit, secondary_length_unit, secondary_area_unit FloatImage > plugins.FloatImage(url, bottom, left).add_to(m) TimestampedGeoJson > plugins.TimestampedGeoJson(GeoJson, period) - also: add_last_point, dateOptions, auto_play… HeatMap and HeatMapWithTime > plugins.HeatMap(data).add_to(m) - also: name, radius, min_opacity, max_val, blur, gradient, overlay, max_zoom > plugins.HeatMapWithTime(data).add_to(m) - also: index, name, radius, min_opacity, max_opacity, auto_play, position, … CC BY Andrew Challis • andrewchallis@hotmail.co.uk • andrewchallis.co.uk • Learn more at http://python-visualization.github.io/folium/docs-master/ • package version 0.5.0 • Updated: 2017-10Adapted from Rstudio materials https://rstudio.github.io/leaflet/