031a_MagellanOSMIngestion(Scala)

OSM

1.We define an area of interest and find coordinates of its boundary, AKA "bounding box". To do this go to https://www.openstreetmap.org and zoom roughly into the desired area.

2.To ingest data from OSM we use wget, in the following format:

wget -O MyFileName.osm "https://api.openstreetmap.org/api/0.6/map?bbox=l,b,r,t"

  • MyFileName.osm - give some informative file name

  • l = longitude of the LEFT boundary of the bounding box

  • b = lattitude of the BOTTOM boundary of the bounding box
  • r = longitude of the RIGHT boundary of the bounding box
  • t = lattitude of the TOP boundary of the bounding box

For instance if you know the bounding box, do:

  • TinyUppsalaCentrumWgot.osm - Tiny area in Uppsala Centrum

  • l = 17.63514

  • b = 59.85739
  • r = 17.64154
  • t = 59.86011
wget -O TinyUppsalaCentrumWgot.osm "https://api.openstreetmap.org/api/0.6/map?bbox=17.63514,59.85739,17.64154,59.86011"
//Imports
import magellan._
import magellan._
%sh
ls
conf derby.log eventlogs ganglia library-install-logs logs
%sh
wget -O UppsalaCentrumWgot.osm "https://api.openstreetmap.org/api/0.6/map?bbox=17.6244,59.8464,17.6661,59.8643"
--2019-06-19 08:14:56-- https://api.openstreetmap.org/api/0.6/map?bbox=17.6244,59.8464,17.6661,59.8643 Resolving api.openstreetmap.org (api.openstreetmap.org)... 130.117.76.13, 130.117.76.11, 130.117.76.12, ... Connecting to api.openstreetmap.org (api.openstreetmap.org)|130.117.76.13|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/xml] Saving to: ‘UppsalaCentrumWgot.osm’ 0K .......... .......... .......... .......... .......... 162K 50K .......... .......... .......... .......... .......... 324K 100K .......... .......... .......... .......... .......... 39.3M 150K .......... .......... .......... .......... .......... 1.40M 200K .......... .......... .......... .......... .......... 422K 250K .......... .......... .......... .......... .......... 44.0M 300K .......... .......... .......... .......... .......... 16.7M 350K .......... .......... .......... .......... .......... 1.57M 400K .......... .......... .......... .......... .......... 424K 450K .......... .......... .......... .......... .......... 17.6M 500K .......... .......... .......... .......... .......... 22.4M 550K .......... .......... .......... .......... .......... 16.3M 600K .......... .......... .......... .......... .......... 16.2M 650K .......... .......... .......... .......... .......... 59.6M 700K .......... .......... .......... .......... .......... 63.6M 750K .......... .......... .......... .......... .......... 2.12M 800K .......... .......... .......... .......... .......... 39.5M 850K .......... .......... .......... .......... .......... 426K 900K .......... .......... .......... .......... .......... 55.7M 950K .......... .......... .......... .......... .......... 51.6M 1000K .......... .......... .......... .......... .......... 28.4M 1050K .......... .......... .......... .......... .......... 57.6M 1100K .......... .......... .......... .......... .......... 52.5M 1150K .......... .......... .......... .......... .......... 30.0M 1200K .......... .......... .......... .......... .......... 19.8M 1250K .......... .......... .......... .......... .......... 43.6M 1300K .......... .......... .......... .......... .......... 46.1M 1350K .......... .......... .......... .......... .......... 41.6M 1400K .......... .......... .......... .......... .......... 51.2M 1450K .......... .......... .......... .......... .......... 37.2M 1500K .......... .......... .......... .......... .......... 35.8M 1550K .......... .......... .......... .......... .......... 2.59M 1600K .......... .......... .......... .......... .......... 34.3M 1650K .......... .......... .......... .......... .......... 84.7M 1700K .......... .......... .......... .......... .......... 153M 1750K .......... .......... .......... .......... .......... 426K 1800K .......... .......... .......... .......... .......... 31.4M 1850K .......... .......... .......... .......... .......... 43.4M 1900K .......... .......... .......... .......... .......... 28.2M 1950K .......... .......... .......... .......... .......... 41.1M 2000K .......... .......... .......... .......... .......... 41.6M 2050K .......... .......... .......... .......... .......... 114M 2100K .......... .......... .......... .......... .......... 131M 2150K .......... .......... .......... .......... .......... 153M 2200K .......... .......... .......... .......... .......... 57.0M 2250K .......... .......... .......... .......... .......... 18.5M 2300K .......... .......... .......... .......... .......... 21.5M 2350K .......... .......... .......... .......... .......... 27.5M 2400K .......... .......... .......... .......... .......... 109M 2450K .......... .......... .......... .......... .......... 153M 2500K .......... .......... .......... .......... .......... 134M 2550K .......... .......... .......... .......... .......... 145M 2600K .......... .......... .......... .......... .......... 151M 2650K .......... .......... .......... .......... .......... 151M 2700K .......... .......... .......... .......... .......... 126M 2750K .......... .......... .......... .......... .......... 149M 2800K .......... .......... .......... .......... .......... 149M 2850K .......... .......... .......... .......... .......... 150M 2900K .......... .......... .......... .......... .......... 129M 2950K .......... .......... .......... .......... .......... 151M 3000K .......... .......... .......... .......... .......... 152M 3050K .......... .......... .......... .......... .......... 153M 3100K .......... .......... .......... .......... .......... 3.16M 3150K .......... .......... .......... .......... .......... 150M 3200K .......... .......... .......... .......... .......... 152M 3250K .......... .......... .......... .......... .......... 434K 3300K .......... .......... .......... .......... .......... 20.5M 3350K .......... .......... .......... .......... .......... 52.3M 3400K .......... .......... .......... .......... .......... 64.9M 3450K .......... .......... .......... .......... .......... 20.9M 3500K .......... .......... .......... .......... .......... 27.7M 3550K .......... .......... .......... .......... .......... 60.5M 3600K .......... .......... .......... .......... .......... 47.4M 3650K .......... .......... .......... .......... .......... 161M 3700K .......... .......... .......... .......... .......... 38.3M 3750K .......... .......... .......... .......... .......... 28.8M 3800K .......... .......... .......... .......... .......... 24.7M 3850K .......... .......... .......... .......... .......... 56.5M 3900K .......... .......... .......... .......... .......... 50.5M 3950K .......... .......... .......... .......... .......... 51.5M 4000K .......... .......... .......... .......... .......... 77.3M 4050K .......... .......... .......... .......... .......... 130M 4100K .......... .......... .......... .......... .......... 149M 4150K .......... .......... .......... .......... .......... 152M 4200K .......... .......... .......... .......... .......... 149M 4250K .......... .......... .......... .......... .......... 126M 4300K .......... .......... .......... .......... .......... 150M 4350K .......... .......... .......... .......... .......... 151M 4400K .......... .......... .......... .......... .......... 151M 4450K .......... .......... .......... .......... .......... 132M 4500K .......... .......... .......... .......... .......... 147M 4550K .......... .......... .......... .......... .......... 151M 4600K .......... .......... .......... .......... .......... 3.35M 4650K .......... .......... .......... .......... .......... 32.2M 4700K .......... .......... .......... .......... .......... 153M 4750K .......... .......... .......... .......... .......... 5.42M 4800K .......... .......... .......... .......... .......... 463K 4850K .......... .......... .......... .......... .......... 27.4M 4900K .......... .......... .......... .......... .......... 97.2M 4950K .......... .......... .......... .......... .......... 29.5M 5000K .......... .......... .......... .......... .......... 38.9M 5050K .......... .......... .......... .......... .......... 81.6M 5100K .......... .......... .......... .......... .......... 25.8M 5150K .......... .......... .......... .......... .......... 146M 5200K .......... .......... .......... .......... .......... 43.6M 5250K .......... .......... .......... .......... .......... 24.3M 5300K .......... .......... .......... .......... .......... 20.9M 5350K .......... .......... .......... .......... .......... 18.9M 5400K .......... .......... .......... .......... .......... 39.4M 5450K .......... .......... .......... .......... .......... 123M 5500K .......... .......... .......... .......... .......... 152M 5550K .......... .......... .......... .......... .......... 153M 5600K .......... .......... .......... .......... .......... 146M 5650K .......... .......... .......... .......... .......... 128M 5700K .......... .......... .......... .......... .......... 145M 5750K .......... .......... .......... .......... .......... 146M 5800K .......... .......... .......... .......... .......... 152M 5850K .......... .......... .......... .......... .......... 130M 5900K .......... .......... .......... .......... .......... 147M 5950K .......... .......... .......... .......... .......... 149M 6000K .......... .......... .......... .......... .......... 126M 6050K .......... .......... .......... .......... .......... 150M 6100K .......... .......... .......... .......... .......... 3.67M 6150K .......... .......... .......... .......... .......... 46.6M 6200K .......... .......... .......... .......... .......... 56.6M 6250K .......... .......... .......... .......... .......... 16.7M 6300K .......... .......... .......... .......... .......... 446K 6350K .......... .......... .......... .......... .......... 49.3M 6400K .......... .......... .......... .......... .......... 25.4M 6450K .......... .......... .......... .......... .......... 46.2M 6500K .......... .......... .......... .......... .......... 59.7M 6550K .......... .......... .......... .......... .......... 90.3M 6600K .......... .......... .......... .......... .......... 44.3M 6650K .......... .......... .......... .......... .......... 34.5M 6700K .......... .......... .......... .......... .......... 41.6M 6750K .......... .......... .......... .......... .......... 55.8M 6800K .......... .......... .......... .......... .......... 161M 6850K .......... .......... .......... .......... .......... 44.1M 6900K .......... .......... .......... .......... .......... 33.2M 6950K .......... .......... .......... .......... .......... 42.3M 7000K .......... .......... .......... .......... .......... 27.9M 7050K .......... .......... .......... .......... .......... 45.4M 7100K .......... .......... .......... .......... .......... 56.6M 7150K .......... .......... .......... .......... .......... 178M 7200K .......... .......... .......... .......... .......... 158M 7250K .......... .......... .......... .......... .......... 178M 7300K .......... .......... .......... .......... .......... 141M 7350K .......... .......... .......... .......... .......... 168M 7400K .......... .......... .......... .......... ......... 196M=1.6s 2019-06-19 08:15:00 (4.67 MB/s) - ‘UppsalaCentrumWgot.osm’ saved [7628216]
%sh 
pwd
ls
/databricks/driver conf derby.log eventlogs ganglia library-install-logs logs UppsalaCentrumWgot.osm
display(dbutils.fs.ls("dbfs:///datasets/"))
dbfs:/datasets/20180416121500.gkg.csv20180416121500.gkg.csv34277858
dbfs:/datasets/20190517121500.gkg.csv20190517121500.gkg.csv25728991
dbfs:/datasets/20190523121500.gkg.csv20190523121500.gkg.csv29695688
dbfs:/datasets/MEP/MEP/0
dbfs:/datasets/beijing/beijing/0
dbfs:/datasets/books/books/0
dbfs:/datasets/graphhopper/graphhopper/0
dbfs:/datasets/instacart_2017_05_01/instacart_2017_05_01/0
dbfs:/datasets/magellan/magellan/0
dbfs:/datasets/maps/maps/0
dbfs:/datasets/mini_newsgroups/mini_newsgroups/0
dbfs:/datasets/obo/obo/0
dbfs:/datasets/osm/osm/0
dbfs:/datasets/sds/sds/0
dbfs:/datasets/social-media-usage.csvsocial-media-usage.csv402147
dbfs:/datasets/sou/sou/0
dbfs:/datasets/streamingFiles/streamingFiles/0
dbfs:/datasets/streamingFilesNormalMixture/streamingFilesNormalMixture/0
dbfs:/datasets/t-drive-trips/t-drive-trips/0
dbfs:/datasets/taxis/taxis/0
dbfs:/datasets/tweetsStreamTmp/tweetsStreamTmp/0
dbfs:/datasets/wiki-clickstream/wiki-clickstream/0
dbfs:/datasets/wiki-clickstream-curr_id/wiki-clickstream-curr_id/0
dbfs:/datasets/wiki-clickstream-prev_titled/wiki-clickstream-prev_titled/0
dbfs:/datasets/wikipedia-datasets/wikipedia-datasets/0
// making directory in distributed file system
//dbutils.fs.mkdirs("dbfs:///datasets/maps/")
display(dbutils.fs.ls("dbfs:///datasets/maps/"))
dbfs:/datasets/maps/TinyUppsalaCentrumWgot.osmTinyUppsalaCentrumWgot.osm812115
dbfs:/datasets/maps/UppsalaCentrumWgot.osmUppsalaCentrumWgot.osm7623610
//dbutils.fs.rm("file:///databricks/driver/UppsalaCentrumWgot.osm",true)
// copy file from local fs to dbfs
dbutils.fs.cp("file:///databricks/driver/UppsalaCentrumWgot.osm","dbfs:///datasets/maps/")
res22: Boolean = true
display(dbutils.fs.ls("dbfs:///datasets/maps/"))
dbfs:/datasets/maps/TinyUppsalaCentrumWgot.osmTinyUppsalaCentrumWgot.osm812115
dbfs:/datasets/maps/UppsalaCentrumWgot.osmUppsalaCentrumWgot.osm7623610
val path = "dbfs:/datasets/maps/UppsalaCentrumWgot.osm"
val uppsalaCentrumOsmDF = spark.read
      .format("magellan")
      .option("type", "osm")
      .load(path)
path: String = dbfs:/datasets/maps/UppsalaCentrumWgot.osm uppsalaCentrumOsmDF: org.apache.spark.sql.DataFrame = [point: point, polyline: polyline ... 3 more fields]
uppsalaCentrumOsmDF.show()
+-----+--------------------+--------------------+--------------------+-----+ |point| polyline| polygon| metadata|valid| +-----+--------------------+--------------------+--------------------+-----+ | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...|[addr:street -> B...| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...|[addr:street -> B...| true| | null| null|magellan.Polygon@...|[addr:street -> B...| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...|[building -> garage]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...| [building -> yes]| true| | null| null|magellan.Polygon@...|[amenity -> parking]| true| | null|magellan.PolyLine...| null|[highway -> service]| true| | null|magellan.PolyLine...| null| []| true| +-----+--------------------+--------------------+--------------------+-----+ only showing top 20 rows
display(uppsalaCentrumOsmDF)
nullnullmagellan.Polygon@82732812{"building":"yes"}true
nullnullmagellan.Polygon@c5a1a4aa{"addr:street":"Björkgatan","addr:country":"SE","addr:housenumber":"73","building":"industrial","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@5f839ffc{"building":"yes"}true
nullnullmagellan.Polygon@24d5b557{"building":"yes"}true
nullnullmagellan.Polygon@45b97104{"building":"yes"}true
nullnullmagellan.Polygon@67622f6b{"building":"yes"}true
nullnullmagellan.Polygon@b627c40f{"addr:street":"Bergsbrunnagatan","addr:country":"SE","addr:housenumber":"10","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@2239f970{"addr:street":"Bergsbrunnagatan","addr:country":"SE","addr:housenumber":"2","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@6c75c7e1{"building":"yes"}true
nullnullmagellan.Polygon@5d33252c{"building":"yes"}true
nullnullmagellan.Polygon@af7a92dd{"building":"yes"}true
nullnullmagellan.Polygon@3953c327{"building":"yes"}true
nullnullmagellan.Polygon@9420bfcf{"building":"yes"}true
nullnullmagellan.Polygon@c3be52a9{"building":"yes"}true
nullnullmagellan.Polygon@78ea5c4d{"building":"garage"}true
nullnullmagellan.Polygon@d13bc314{"building":"yes"}true
nullnullmagellan.Polygon@9840b5a1{"building":"yes"}true
nullnullmagellan.Polygon@15cff6aa{"amenity":"parking"}true
nullmagellan.PolyLine@8c14056bnull{"highway":"service"}true
nullmagellan.PolyLine@79565d80null{}true
nullmagellan.PolyLine@2ff930afnull{"highway":"residential","maxspeed":"30","name":"Storgatan","surface":"asphalt"}true
nullmagellan.PolyLine@5ad25c20null{"building":"yes"}true
nullnullmagellan.Polygon@64319fd0{"building":"yes"}true
nullnullmagellan.Polygon@8038bf97{"building":"yes"}true
nullnullmagellan.Polygon@2d3bff37{"addr:street":"Storgatan","addr:country":"SE","addr:housenumber":"8","building":"apartments","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@6152d625{"amenity":"parking","fee":"yes"}true
nullnullmagellan.Polygon@f819b492{"building:levels":"4","addr:street":"Sankt Persgatan","addr:country":"SE","addr:postcode":"753 29","addr:housenumber":"26","building":"residential","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@50a151e4{"building":"yes"}true
nullnullmagellan.Polygon@aeaeab4d{"building":"yes"}true
nullnullmagellan.Polygon@4b2f73d0{"building":"yes"}true
nullnullmagellan.Polygon@3857e0df{"building":"yes"}true
nullmagellan.PolyLine@95b16962null{"highway":"service","maxspeed":"30"}true
nullmagellan.PolyLine@5c3adf0bnull{"building":"yes"}true
nullnullmagellan.Polygon@1c9ea348{"building":"yes"}true
nullnullmagellan.Polygon@d6655bbf{"building":"yes","name":"Prinshuset","wikidata":"Q10638849","wikipedia":"sv:Prinshuset"}true
nullnullmagellan.Polygon@5ba02e90{"name":"Villa Tomtebo","start_date":"1880s","addr:street":"Villavägen","addr:country":"SE","addr:housenumber":"3","building":"yes","wikipedia":"sv:Villa Tomtebo, Kåbo","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@c954f24b{"building":"yes"}true
nullnullmagellan.Polygon@ca42734e{"building":"yes"}true
nullnullmagellan.Polygon@ed197a54{"building":"yes"}true
nullmagellan.PolyLine@7a6f6d63null{"name":"Kyrkogårdsgatan","surface":"asphalt","maxspeed":"50","highway":"tertiary","ref":"C 602","oneway":"yes"}true
nullmagellan.PolyLine@716e7aa6null{}true
nullnullmagellan.Polygon@15866af9{"building:levels":"2","addr:street":"Hammarbygatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"7","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@fa506df2{"building":"yes"}true
nullnullmagellan.Polygon@2a205466{"building":"house","building:levels":"1","roof:levels":"1"}true
nullnullmagellan.Polygon@6d6719f2{"building:levels":"1","addr:street":"Björkgatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"22","building":"house","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@67790f1d{"building":"yes"}true
nullmagellan.PolyLine@aa0e181null{"surface":"gravel","highway":"path","foot":"designated","bicycle":"designated","segregated":"no"}true
nullmagellan.PolyLine@d2a64810null{"electrified":"contact_line","axle_load":"25","name":"Ostkustbanan","railway:ctc":"yes","railway:atc":"yes","maxspeed":"130","usage":"main","passenger_lines":"2","railway:preferred_direction":"forward","railway:traffic_mode":"mixed","railway":"rail","tracks":"1","railway:bidirectional":"regular","railway:rail":"continuous","workrules":"SE:H","gauge":"1435","railway:etcs":"no","frequency":"16.67","metre_load":"8","railway:radio":"gsm-r","voltage":"15000"}true
nullmagellan.PolyLine@fdcb2a9cnull{"area":"yes","name":"1","public_transport":"platform","railway":"platform"}true
nullnullmagellan.Polygon@f00b78ea{"electrified":"no","railway":"rail","service":"siding"}true
nullmagellan.PolyLine@f57fae72null{"electrified":"contact_line","railway":"rail","service":"siding","gauge":"1435","frequency":"16.67","voltage":"15000"}true
nullmagellan.PolyLine@7822f0f0null{"leisure":"common"}true
nullnullmagellan.Polygon@d6610559{"building:levels":"2","addr:street":"Rimbogatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"13","building":"house","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@dc3ddf9e{"building:levels":"2","addr:street":"Rimbogatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"15","building":"house","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@936ea523{"building:levels":"1","addr:street":"Rimbogatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"7","building":"house","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@46bb9047{"building:levels":"1","addr:street":"Rimbogatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"14","building":"house","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@f5e8da85{"building":"yes"}true
nullnullmagellan.Polygon@231802d5{"building:levels":"1","addr:street":"Rimbogatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"16","building":"house","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@837f5698{"building:levels":"2","source":"bing","addr:street":"Rimbogatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"30","building":"house","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@c8f099cd{"building:levels":"2","addr:street":"Solrosgatan","addr:country":"SE","addr:postcode":"73524","addr:housenumber":"7","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@141c583e{"building:levels":"2","addr:street":"Törnlundsgatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"5","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@3af8be9c{"building:levels":"1","addr:street":"Furugatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"17","building":"detached","addr:city":"Uppsala","roof:shape":"gabled"}true
nullnullmagellan.Polygon@c0479158{"building:levels":"2","addr:street":"Furugatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"3","building":"detached","addr:city":"Uppsala","roof:shape":"gabled"}true
nullnullmagellan.Polygon@751b23ff{"building":"garage"}true
nullnullmagellan.Polygon@8f5bdf8d{"building:levels":"2","addr:street":"Solrosgatan","addr:country":"SE","addr:postcode":"73524","addr:housenumber":"9","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@fa4e85ee{"building:levels":"1","addr:street":"Törnlundsgatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"7","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@44439219{"building:levels":"2","addr:street":"Solrosgatan","addr:country":"SE","addr:postcode":"73524","addr:housenumber":"5","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@c0eecb89{"building:levels":"2","addr:street":"Furugatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"9","building":"detached","addr:city":"Uppsala","roof:shape":"round"}true
nullmagellan.PolyLine@12d8d29anull{"highway":"service"}true
nullmagellan.PolyLine@aac49672null{"building":"preschool","name":"Iors förskola"}true
nullnullmagellan.Polygon@511b6569{"building:levels":"1","addr:street":"Stockrosgatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"4","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@217d3232{"amenity":"school","building":"yes","name":"Almtunaskolans matsal"}true
nullnullmagellan.Polygon@44cf4404{"building:levels":"2","addr:street":"Syréngatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"5","building":"detached","addr:city":"Uppsala","roof:shape":"gabled"}true
nullnullmagellan.Polygon@f6ea2ce5{"building:levels":"2","addr:street":"Vildrosgatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"11","building":"house","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@1e3499ff{"building:levels":"2","source":"bing","addr:street":"Oxelgatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"10C","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@ef4afb9b{"building":"garage"}true
nullnullmagellan.Polygon@fcb6cf40{"addr:street":"Sankt Göransgatan","addr:country":"SE","addr:postcode":"75326","addr:housenumber":"36","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@9225d5a3{"building:levels":"1","addr:street":"Törnlundsgatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"18","building":"residential","addr:city":"Uppsala","roof:shape":"gambrel"}true
nullnullmagellan.Polygon@83bfb85a{"building:levels":"1","addr:street":"Törnlundsgatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"16","building":"residential","addr:city":"Uppsala","roof:shape":"half-hipped"}true
nullnullmagellan.Polygon@73750692{"source":"bing","addr:street":"Liljegatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"15","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@6d7614d9{"building":"yes"}true
nullnullmagellan.Polygon@f801700{"source":"bing","addr:street":"Oxelgatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"11","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@400ee8ff{"building":"yes"}true
nullnullmagellan.Polygon@20026e09{"building:levels":"1","addr:street":"Furugatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"14","building":"detached","addr:city":"Uppsala","roof:shape":"gabled"}true
nullnullmagellan.Polygon@9db5a1b3{"building":"yes"}true
nullnullmagellan.Polygon@2b4cc566{"source":"Bing","addr:street":"Liljegatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"22D","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@6fe30ef5{"building:levels":"1","addr:street":"Stockrosgatan","addr:country":"SE","addr:postcode":"75324","roof:levels":"1","addr:housenumber":"11","building":"detached","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@25e1ad65{"building":"yes"}true
nullnullmagellan.Polygon@7c29c2ab{"source":"Bing","addr:street":"Liljegatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"22B","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@430634f4{"source":"bing","addr:street":"Liljegatan","addr:country":"SE","addr:postcode":"75324","addr:housenumber":"20B","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@ee9014c8{"building":"apartments","building:levels":"2"}true
nullnullmagellan.Polygon@cfd53ad7{"addr:street":"Frodegatan","addr:country":"SE","addr:postcode":"75327","addr:housenumber":"38","building":"yes","addr:city":"Uppsala"}true
nullnullmagellan.Polygon@735597ac{"building":"yes"}true
nullmagellan.PolyLine@5ffa263anull{"name":"Sankt Johannesgatan","surface":"sett","maxspeed":"30","highway":"residential","cycleway":"opposite","short_name":"S:t Johannesgatan","incline":"down","oneway":"yes","oneway:bicycle":"no"}true
nullmagellan.PolyLine@b327ba5anull{"landuse":"grass","source":"Bing"}true
nullnullmagellan.Polygon@445fc69d{"building":"yes"}true
nullnullmagellan.Polygon@5e08b611{"building":"yes"}true
nullmagellan.PolyLine@efc72ed1null{"barrier":"hedge","source":"Bing"}true
nullmagellan.PolyLine@dd4fdff3null{"barrier":"hedge","source":"Bing"}true
nullmagellan.PolyLine@7bd68d7enull{"name":"Skolgatan","surface":"asphalt","maxspeed":"50","highway":"residential","oneway":"yes"}true

Showing the first 1000 rows.

uppsalaCentrumOsmDF.count
res5: Long = 30326
%sh
wget -O TinyUppsalaCentrumWgot.osm "https://api.openstreetmap.org/api/0.6/map?bbox=17.63514,59.85739,17.64154,59.86011"
--2019-06-19 08:18:28-- https://api.openstreetmap.org/api/0.6/map?bbox=17.63514,59.85739,17.64154,59.86011 Resolving api.openstreetmap.org (api.openstreetmap.org)... 130.117.76.12, 130.117.76.13, 130.117.76.11, ... Connecting to api.openstreetmap.org (api.openstreetmap.org)|130.117.76.12|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/xml] Saving to: ‘TinyUppsalaCentrumWgot.osm’ 0K .......... .......... .......... .......... .......... 164K 50K .......... .......... .......... .......... .......... 328K 100K .......... .......... .......... .......... .......... 39.4M 150K .......... .......... .......... .......... .......... 1.24M 200K .......... .......... .......... .......... .......... 441K 250K .......... .......... .......... .......... .......... 58.9M 300K .......... .......... .......... .......... .......... 45.0M 350K .......... .......... .......... .......... .......... 38.4M 400K .......... .......... .......... .......... .......... 336K 450K .......... .......... .......... .......... .......... 48.1M 500K .......... .......... .......... .......... .......... 40.9M 550K .......... .......... .......... .......... .......... 42.1M 600K .......... .......... .......... .......... .......... 48.8M 650K .......... .......... .......... .......... .......... 42.0M 700K .......... .......... .......... .......... .......... 64.5M 750K .......... .......... .......... .......... ....... 151M=0.8s 2019-06-19 08:18:29 (1.01 MB/s) - ‘TinyUppsalaCentrumWgot.osm’ saved [816717]
%sh 
pwd
ls
/databricks/driver conf derby.log eventlogs ganglia library-install-logs logs TinyUppsalaCentrumWgot.osm UppsalaCentrumWgot.osm
// copy file from local fs to dbfs
dbutils.fs.cp("file:///databricks/driver/TinyUppsalaCentrumWgot.osm","dbfs:///datasets/maps/")
display(dbutils.fs.ls("dbfs:///datasets/maps/"))
dbfs:/datasets/maps/TinyUppsalaCentrumWgot.osmTinyUppsalaCentrumWgot.osm812115
dbfs:/datasets/maps/UppsalaCentrumWgot.osmUppsalaCentrumWgot.osm7623610
val path = "dbfs:/datasets/maps/TinyUppsalaCentrumWgot.osm"
val tinyUppsalaCentrumOsmDF = spark.read
      .format("magellan")
      .option("type", "osm")
      .load(path)
display(tinyUppsalaCentrumOsmDF)
nullmagellan.PolyLine@427fa545null{"name":"Kungsgatan","surface":"asphalt","maxspeed":"40","highway":"secondary","cyclability":"4","oneway":"yes"}true
nullmagellan.PolyLine@39a603c9null{"building":"yes","name":"S:t Per Gallerian","website":"http://stper.se/"}true
nullmagellan.PolyLine@587ae53bnull{"highway":"living_street","maxspeed":"7","name":"Dragarbrunnsgatan","surface":"paving_stones"}true
nullmagellan.PolyLine@7963f0bnull{"highway":"residential","maxspeed":"30","name":"Västra Ågatan","surface":"asphalt"}true
nullmagellan.PolyLine@34237b02null{"footway":"crossing","highway":"footway","source":"Bing","surface":"paved"}true
nullmagellan.PolyLine@fdb8b3e3null{"highway":"service","oneway":"yes","service":"parking_aisle","surface":"pebblestone"}true
nullmagellan.PolyLine@dcba91ccnull{"footway":"sidewalk","highway":"footway","surface":"paved"}true
nullmagellan.PolyLine@73d893b3null{"name":"Sankt Persgatan","surface":"paving_stones","highway":"pedestrian","foot":"yes","bicycle":"no","short_name":"S:t Persgatan"}true
nullmagellan.PolyLine@66dab854null{"highway":"steps"}true
nullmagellan.PolyLine@6f69de9enull{"name":"Dombron","highway":"cycleway","bridge":"yes","layer":"1","wikidata":"Q10475773","wikipedia":"sv:Dombron"}true
nullmagellan.PolyLine@c1baccc0null{"highway":"steps"}true
nullmagellan.PolyLine@183ef088null{"name":"Fyristorg","source":"bing","surface":"sett","amenity":"parking","capacity:disabled":"2","wikidata":"Q10500627","wikipedia":"sv:Fyristorg","access":"yes","fee":"yes","capacity":"13"}true
nullmagellan.PolyLine@58d4985null{"name":"Stora torget","surface":"sett","maxspeed":"30","highway":"unclassified","source:maxspeed":"sign","psv":"yes","oneway":"yes","access":"no"}true
nullmagellan.PolyLine@d0912db5null{"highway":"unclassified","maxspeed":"30","name":"Drottninggatan","surface":"asphalt"}true
nullmagellan.PolyLine@f764764cnull{"building":"yes"}true
nullnullmagellan.Polygon@2decc50b{"building":"yes"}true
nullnullmagellan.Polygon@2380777e{"building":"yes","source":"yahoo"}true
nullnullmagellan.Polygon@d259d54d{"waterway":"canal"}true
nullmagellan.PolyLine@3e84f851null{"addr:interpolation":"odd"}true
nullmagellan.PolyLine@63237f75null{"addr:interpolation":"odd"}true
nullnullmagellan.Polygon@f3519e68{"area":"yes","name":"G","highway":"platform","public_transport":"platform","route_ref":"5;6;8;9;10"}true
nullnullmagellan.Polygon@69d2748c{"building":"yes"}true
nullmagellan.PolyLine@14cd9867null{"name":"Östra Ågatan","surface":"paving_stones","highway":"unclassified","cycleway":"opposite_lane","smoothness":"bad","oneway":"yes"}true
nullmagellan.PolyLine@3eef2ff2null{"highway":"living_street","name":"Dragarbrunnsgatan","surface":"asphalt"}true
nullmagellan.PolyLine@ce85c651null{"building":"yes"}true
nullmagellan.PolyLine@e9fed168null{"footway":"crossing","highway":"footway","source":"Bing"}true
nullmagellan.PolyLine@75741337null{"name":"Östra Ågatan","surface":"paving_stones","highway":"unclassified","cycleway":"opposite_lane","smoothness":"bad","oneway":"yes"}true
nullmagellan.PolyLine@7ccc7596null{"footway":"sidewalk","highway":"footway","surface":"paved"}true
nullmagellan.PolyLine@2d90f74bnull{"footway":"sidewalk","highway":"footway","source":"bing","surface":"paved"}true
nullmagellan.PolyLine@7428c0b1null{"created_by":"Potlatch 0.10f","name":"Påvel Snickares gränd","surface":"paving_stones","highway":"pedestrian","bicycle":"no"}true
nullmagellan.PolyLine@ee98f82enull{"highway":"service","name":"Sankt Persgatan","short_name":"S:t Persgatan"}true
nullmagellan.PolyLine@bd9a2d00null{"name":"Drottninggatan","surface":"sett","maxspeed":"30","highway":"unclassified","source:maxspeed":"sign"}true
nullmagellan.PolyLine@fa585904null{"landuse":"grass"}true
nullmagellan.PolyLine@e61c405enull{"highway":"footway","surface":"paved"}true
nullmagellan.PolyLine@f744bfc6null{"highway":"cycleway"}true
nullmagellan.PolyLine@1faa84ccnull{"bicycle":"no","highway":"footway","layer":"-1","tunnel":"yes"}true
nullmagellan.PolyLine@4e5d99b4null{"name":"Vaksalagatan","surface":"asphalt","maxspeed":"30","highway":"unclassified","foot":"yes","bicycle":"no","source:maxspeed":"sign","psv":"yes","access":"no"}true
nullmagellan.PolyLine@83d5fec3null{"building":"yes"}true
nullnullmagellan.Polygon@945b0335{"building":"yes"}true
nullnullmagellan.Polygon@8db9b924{"building":"yes","source":"yahoo"}true
nullnullmagellan.Polygon@2a821dc5{"building":"yes","source":"yahoo"}true
nullnullmagellan.Polygon@aab83aa3{"building":"yes"}true
nullmagellan.PolyLine@a7101561null{"highway":"platform","name":"F","public_transport":"platform"}true
nullmagellan.PolyLine@984aca1enull{"name":"B","source":"bing","highway":"platform","public_transport":"platform","route_ref":"2;7;11"}true
nullmagellan.PolyLine@a9e57eb5null{"tourism":"artwork"}true
nullmagellan.PolyLine@f3189128null{"bicycle":"yes","highway":"pedestrian","maxspeed":"30","name":"Valvgatan"}true
nullmagellan.PolyLine@75730c5bnull{"footway":"sidewalk","highway":"footway","source":"Bing","surface":"paved"}true
nullmagellan.PolyLine@a1a70469null{"highway":"unclassified","name":"Drottninggatan","surface":"sett"}true
nullmagellan.PolyLine@ba483de4null{"website":"https://www.upplandsmuseet.se/","name":"Upplandsmuseet","addr:street":"Fyristorg","addr:country":"SE","email":"info@upplandsmuseet.se","tourism":"museum","addr:housenumber":"2","building":"yes","wikidata":"Q7899155","wikipedia":"sv:Upplandsmuseet","addr:city":"Uppsala","wheelchair":"yes","phone":"+46 18 169100"}true
nullmagellan.PolyLine@789cbde9null{"name":"Svartbäcksgatan","surface":"paving_stones","highway":"pedestrian","foot":"yes","bicycle":"no"}true
nullmagellan.PolyLine@89a30d41null{"bicycle":"no","highway":"pedestrian","name":"Klostergatan","surface":"paving_stones"}true
nullmagellan.PolyLine@87445be9null{"highway":"unclassified","name":"Smedsgränd","surface":"sett"}true
nullmagellan.PolyLine@cd6e4f6enull{"landuse":"grass"}true
nullmagellan.PolyLine@ce9da02fnull{"name":"Kungsängsgatan","surface":"paving_stones","highway":"pedestrian","foot":"yes","bicycle":"no"}true
nullmagellan.PolyLine@eb220dd5null{"shop":"department_store","website":"https://www.ahlens.se/","name":"Åhléns","opening_hours":"Mo-Fr 10:00-19:00; Sa 10:00-17:00; Su 11:00-17:00","building":"yes","fax":"+46 18 640710","wheelchair":"yes","phone":"+46 18 640700"}true
nullnullmagellan.Polygon@7ff78e07{"addr:interpolation":"odd"}true
nullmagellan.PolyLine@6077256bnull{"addr:interpolation":"odd"}true
nullnullmagellan.Polygon@7e6d1944{"building":"yes"}true
nullnullmagellan.Polygon@3cb8b2d6{"addr:street":"Dragarbrunnsgatan","addr:country":"SE","addr:housenumber":"36","building":"yes","addr:city":"Uppsala"}true
nullmagellan.PolyLine@9e79c14dnull{"name":"Östra Ågatan","surface":"asphalt","highway":"unclassified","cycleway":"opposite_lane","oneway":"yes"}true
nullmagellan.PolyLine@68c40414null{"amenity":"bicycle_parking"}true
nullmagellan.PolyLine@4d6739e1null{"name":"Sankt Eriks gränd","surface":"paved","highway":"pedestrian","bicycle":"no","short_name":"S:t Eriks gränd"}true
nullmagellan.PolyLine@360d28d1null{"footway":"sidewalk","highway":"footway","source":"Bing","surface":"paved"}true
nullmagellan.PolyLine@7e2011b4null{"footway":"sidewalk","source":"bing","surface":"paved","highway":"footway","bridge":"yes","layer":"1"}true
nullmagellan.PolyLine@d02595dcnull{"footway":"sidewalk","highway":"footway","source":"bing","surface":"paved"}true
nullmagellan.PolyLine@a09800c3null{"name":"Smedsgränd","surface":"sett","highway":"pedestrian","foot":"yes","bicycle":"no"}true
nullmagellan.PolyLine@a1d1536bnull{"name":"Sankt Persgatan","surface":"paving_stones","maxspeed":"7","highway":"unclassified","short_name":"S:t Persgatan"}true
nullmagellan.PolyLine@40de362fnull{"highway":"unclassified","name":"Klostergatan"}true
nullmagellan.PolyLine@69277e1dnull{"created_by":"Potlatch 0.10f","name":"Bredgränd","surface":"sett","highway":"pedestrian","foot":"yes","bicycle":"no"}true
nullmagellan.PolyLine@87dd259bnull{"landuse":"grass"}true
nullmagellan.PolyLine@42869f9bnull{"name":"Sankt Eriks gränd","surface":"asphalt","maxspeed":"30","highway":"residential","cycleway":"opposite_lane","short_name":"S:t Eriks gränd","oneway":"yes"}true
nullmagellan.PolyLine@670f0774null{"building":"yes"}true
nullnullmagellan.Polygon@4ded0112{"building":"yes"}true
nullnullmagellan.Polygon@f59834ce{"building":"yes"}true
nullnullmagellan.Polygon@7bbca36c{"building":"yes"}true
nullnullmagellan.Polygon@1d298168{"leisure":"park","name":"Klosterparken","wikidata":"Q19977952","wikipedia":"sv:Klosterparken"}true
nullnullmagellan.Polygon@2fa814a4{"leisure":"park","name":"Klosterparken","wikidata":"Q19977952","wikipedia":"sv:Klosterparken"}true
nullmagellan.PolyLine@d56e4da0null{"footway":"sidewalk","highway":"footway","surface":"paved"}true
nullmagellan.PolyLine@fb1a410null{"footway":"sidewalk","highway":"footway","surface":"paved"}true
nullmagellan.PolyLine@77c48369null{"bridge":"yes","footway":"sidewalk","highway":"footway","layer":"1"}true
nullmagellan.PolyLine@67693153null{"highway":"residential","maxspeed":"30","name":"Västra Ågatan","surface":"asphalt"}true
nullmagellan.PolyLine@c8793ebanull{"website":"http://www.uaf.uu.se/index.php?pageId=-5&obj=8","name":"Celsiushuset","source":"yahoo","addr:street":"Svartbäcksgatan","addr:country":"SE","addr:housenumber":"7","building":"yes","wikidata":"Q10444704","wikipedia":"sv:Celsiushuset","addr:city":"Uppsala"}true
nullmagellan.PolyLine@9cd15fa5null{"footway":"sidewalk","highway":"footway","surface":"paved"}true
nullmagellan.PolyLine@3f42acefnull{"highway":"footway","name":"Smedsgränd","surface":"paved"}true
nullmagellan.PolyLine@4e2964f5null{"name":"Nybron","surface":"sett","maxspeed":"30","highway":"unclassified","bridge":"yes","layer":"1","source:maxspeed":"sign"}true
nullmagellan.PolyLine@f5746237null{"name":"Gillbergska genomfarten","surface":"asphalt","maxspeed":"30","highway":"residential","alt_name":"Koftans undergång","maxheight":"3.4","wikidata":"Q10504919","wikipedia":"sv:Gillbergska genomfarten","cycleway":"opposite_lane","tunnel":"building_passage","oneway":"yes"}true
nullmagellan.PolyLine@41ca8c9cnull{"building":"yes"}true
nullnullmagellan.Polygon@71a417fa{"building":"yes","source":"yahoo"}true
nullnullmagellan.Polygon@f5b5c013{"building":"yes","source":"yahoo"}true
nullnullmagellan.Polygon@feda1785{"building":"yes"}true
nullnullmagellan.Polygon@13038929{"area":"yes","name":"Forumtorget","surface":"paving_stones","highway":"pedestrian","wikipedia":"sv:Forumtorget"}true
nullmagellan.PolyLine@d090b2b5null{"name":"Kungsgatan","source":"bing","surface":"asphalt","maxspeed":"40","highway":"secondary","cyclability":"4","oneway":"yes"}true
nullmagellan.PolyLine@c3638e9anull{"name":"A","source":"bing","highway":"platform","public_transport":"platform","route_ref":"2;7;11"}true
nullmagellan.PolyLine@2385091cnull{"building":"yes"}true
nullmagellan.PolyLine@9fcc337enull{"access":"permissive","highway":"footway","indoor":"yes","tunnel":"yes"}true
nullmagellan.PolyLine@c42ee51null{"footway":"sidewalk","highway":"footway","surface":"paved"}true
nullmagellan.PolyLine@36f707f6null{"footway":"crossing","highway":"footway","source":"bing","surface":"paved"}true
nullmagellan.PolyLine@d6197b14null{"footway":"sidewalk","highway":"footway","surface":"paved"}true
nullmagellan.PolyLine@9f3c4b19null{"area":"yes","name":"Stora Torget","source":"yahoo","surface":"paving_stones","highway":"pedestrian","wikidata":"Q10681180","wikipedia":"sv:Stora torget, Uppsala"}true
nullmagellan.PolyLine@57f875fcnull{"footway":"sidewalk","highway":"footway","source":"bing;survey","surface":"paved"}true

Showing the first 1000 rows.

tinyUppsalaCentrumOsmDF.count
res8: Long = 1719

Setting up leaflet

You need to go to the following URL and set-up access-token in map-box to use leaflet independently:

Visualise with leaflet:

Take an array of Strings in 'GeoJson' format, then insert this into a prebuild html string that contains all the code neccesary to display these features using Leaflet. The resulting html can be displayed in DataBricks using the displayHTML function.

See http://leafletjs.com/examples/geojson.html for a detailed example of using GeoJson with Leaflet.

//val point1 = sc.parallelize(Seq((59.839264, 17.647075),(59.9, 17.88))).toDF("x", "y")
val point1 = sc.parallelize(Seq((59.839264, 17.647075))).toDF("x", "y")
val point1c = point1.collect()
//val string_p1c = point1.mkString(", ")
val string2 = point1c.mkString(",")
//df.select(columns: _*).collect.map(_.toSeq)
val string22 = "'random_string'"
point1: org.apache.spark.sql.DataFrame = [x: double, y: double] point1c: Array[org.apache.spark.sql.Row] = Array([59.839264,17.647075]) string2: String = [59.839264,17.647075] string22: String = 'random_string'
def genLeafletHTML(): String = {
  // you should get your own later!
  val accessToken = "pk.eyJ1IjoiZHRnIiwiYSI6ImNpaWF6MGdiNDAwanNtemx6MmIyNXoyOWIifQ.ndbNtExCMXZHKyfNtEN0Vg"

  
  val generatedHTML = f"""<!DOCTYPE html>  
  <html>
  <head>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css">
        <style>#map {width: 600px; height:400px;}</style>
  </head>
  
  <body>
      <div id="map" style="width: 600px; height: 400px"></div>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
      <script type="text/javascript">
          var map = L.map('map').setView([59.838, 17.646865], 16);

          L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=$accessToken', {
            maxZoom: 19
            , id: 'mapbox.streets'
            , attribution: '<a href="http://openstreetmap.org">OpenStreetMap</a> ' +
              '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a> ' +
              '| &copy; <a href="http://mapbox.com">Mapbox</a>'
          }).addTo(map);
          
          str1 = 'SDS<br>Ångströmlaboratoriet<br>59.839264, 17.647075<br>';
          str2 = ${string22};
          var popup = str1.concat(str2);
          
          L.marker(${string2}).addTo(map)
              .bindPopup(popup)
              .openPopup();

      </script>
  </body>  
  """
  generatedHTML
}

displayHTML(genLeafletHTML)
%sh
du -sh derby.log
4.0K derby.log

Exercise

Repeat the same with ingesting data fro your own favourite city or a small enough region of earth.