作者:周俊瑶zjy_963 | 来源:互联网 | 2024-10-14 19:00
WhatisthisPRfor?AddingMapVisualizationforZeppelinusingLeaflet[1].
What is this PR for?
Adding Map Visualization for Zeppelin using Leaflet[1]. Updated version of #152
Implemented details can be found in here[2]
[1] http://leafletjs.com/
[2] http://madhukaudantha.blogspot.com/2015/08/introducing-new-chart-library-and-types.html
What type of PR is it?
Improvement
Todos
- [x] Checking compatible license
- [x] Adding chart library (leafletjs)
- [x] Adding new button for chart mapping
- [x] Loading GIS Mapp in Zeppelin
What is the Jira issue?
ZEPPELIN-157
How should this be tested?
`import org.apache.commons.io.IOUtils
import java.net.URL
import java.nio.charset.Charset
// Zeppelin creates and injects sc (SparkContext) and sqlContext (HiveContext or SqlContext)
// So you don't need create them manually
// load map data
val myMapText = sc.parallelize(
IOUtils.toString(
new URL("https://gist.githubusercontent.com/Madhuka/74cb9a6577c87aa7d2fd/raw/2f758d33d28ddc01c162293ad45dc16be2806a6b/data.csv"),
Charset.forName("utf8")).split("\n"))
case class Map(Country:String, Name:String, lat : Float, lan : Float, Altitude : Float)
val myMap = myMapText.map(s=>s.split(",")).filter(s=>s(0)!="Country").map(
s=>Map(s(0),
s(1),
s(2).toFloat,
s(3).toFloat,
s(4).toFloat
)
)
// Below line works only in spark 1.3.0.
// For spark 1.1.x and spark 1.2.x,\n// use myMap.registerTempTable(\"myMap\") instead.\n
myMap.toDF().registerTempTable("myMap")`
More details can be found in here.
Screenshots (if appropriate)
Can found in #152
Questions:
- Does the licenses files need update?No
- Is there breaking changes for older versions?No
- Does this needs documentation? #152 contains documentation (I will add new doc and sample in new PR)
该提问来源于开源项目:apache/zeppelin
Can you please provide any update on this?