<jupyter_start><jupyter_text>Visualization of Airport Data on Map.The idea and the airport's data for this demo was found in the "Towards Data Science" article [How to Visualize Data on top of a Map in Python using the Geoviews library](https://towardsdatascience.com/how-to-visualize-data-on-top-of-a-map-in-python-using-the-geoviews-library-c4f444ca2929) by [<NAME>](https://medium.com/@christoszeglis).The paper demonstrates how to make a plot to visualize the passengers volume for the busiest airports in Greece, and the neighbor country, Turkey, for comparison reasons.The author uses Geoviews and Bokeh libraries to achieve such visualisation. We are going to use the [Lets-Plot](https://github.com/JetBrains/lets-plot/blob/master/README.md) library solely to do the same job and, on top of it, fill both countries boundaries with semi-transparent colors.The tasks completed in this tutorial:- Configuring map-tiles for the interactive base-map layer.- Obtaining boundaries of Greece and Turkey using Lets-Plot geo-coding module.- Creating a proportional symbols map by combining base-map, polygons and point layers.- Castomizing the tooltip contents.<jupyter_code>import numpy as np
import pandas as pd

from lets_plot import *

LetsPlot.setup_html()<jupyter_output><empty_output><jupyter_text>Configuring the basemap.For the purposes of this tutorial, we are going to use "CityLights 2012" map-tiles [© NASA Global Imagery Browse Services (GIBS)](https://earthdata.nasa.gov/eosdis/science-system-description/eosdis-components/gibs).<jupyter_code>LetsPlot.set(maptiles_zxy(
    url='https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_CityLights_2012/default//GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpg',
    attribution='<a href="https://earthdata.nasa.gov/eosdis/science-system-description/eosdis-components/gibs">© NASA Global Imagery Browse Services (GIBS)</a>',
    max_zoom=8
))<jupyter_output><empty_output><jupyter_text>Loading the "airports" dataset.The "airports" dataset is already cleaned and only contains data on Greece and Turkey airports.<jupyter_code>airports = pd.read_csv("https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/airports.csv")
airports.head(3)<jupyter_output><empty_output><jupyter_text>Obtaining boundaries (or polygons) of Greece and Turkey.On this step we are using built-in geo-coding capabilities of the Lets-Plot library.<jupyter_code>from lets_plot.geo_data import *

countries_gcoder = geocode_countries(['GR', 'TR'])
countries_gcoder.get_geocodes()<jupyter_output>The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).<jupyter_text>Showing the data on map.- Add an interactive base-map layer with custom initial location and zoom level.- Add polygons layer to fill the country boundaries with semi-transparent colors.- Add points layer marking the airports location with the point size proportional to the airport's passengers volume.- Customize tooltip on the points layer to show all the airport data.- Use the 'scale_fill_manual()' function in order to fill polygons and points with blue and red colors.- Setup the desired marker's size using the 'scale_size()' function.<jupyter_code>(ggplot() 
 + geom_livemap(location=[26.65, 38.61],
                zoom=6)
 + geom_polygon(aes(fill='country'), 
                data=countries_gcoder.get_boundaries(), 
                alpha=.2)
 + geom_point(aes('longitude', 'latitude', fill='country', size='passengers'),
              data=airports,
              shape=21,
              alpha=.7,
              color='white',
              tooltips=layer_tooltips()
                        .format('passengers', '{.1f} m' )
                        .format('^x', '.2f').format('^y', '.2f')
                        .line('@|@IATA')
                        .line('Passengers|@passengers') 
                        .line('City|@city') 
                        .line('Country|@country') 
                        .line('Longitude|^x')
                        .line('Latitude|^y'))
 + scale_fill_manual(values=['#30a2da', '#fc4f30'])
 + scale_size(range=[10, 40], trans='sqrt')
 + theme(legend_position='none')
 + ggsize(900, 520)
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10870077811836831, 'fraction_numerical': 0.012968639471822684, 'mean_word_length': 3.9040462427745664, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '405112', 'license': 'MIT', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1234, 'n_words': 362, 'path': 'source/examples/demo/map_airports.ipynb', 'repo_name': 'JetBrains/lets-plot-docs', 'size': '4250'}