{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Visualizing Spatial Information\n", "\n", "Function `geom_livemap()` enables a researcher to visualize geospatial information on interactive map.\n", "\n", "When building interactive geospatial visualizations with *Lets-Plot* the visualisation workflow remains the \n", "same as it is when building a regular `ggplot2` plot.\n", "\n", "However, `geom_livemap()` creates an interactive base-map super-layer and certain limitations do apply \n", "comparing to a regular `ggplot2` geom-layer:\n", "\n", "* `geom_livemap()` must be added as a 1-st layer in plot;\n", "* Maximum one `geom_livemap()` layer is alloed per plot;\n", "* Not any type of *geometry* can be combined with interactive map layer in one plot;\n", "* Internet connection to *map tiles provider* is required.\n", "\n", "The following `ggplot2` geometry can be used with interactive maps:\n", "\n", "* `geom_point`\n", "* `geom_rect`\n", "* `geom_path`\n", "* `geom_polygon`\n", "* `geom_segment`\n", "* `geom_text`\n", "* `geom_tile`\n", "* `geom_vline`, `geon_hline`\n", "* `geom_bin2d`\n", "* `geom_contour`, `geom_contourf`\n", "* `geom_density2d`, `geom_density2df`\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-11-01T20:16:06.706240Z", "iopub.status.busy": "2024-11-01T20:16:06.706130Z", "iopub.status.idle": "2024-11-01T20:16:07.030320Z", "shell.execute_reply": "2024-11-01T20:16:07.030014Z" } }, "outputs": [], "source": [ "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2024-11-01T20:16:07.031766Z", "iopub.status.busy": "2024-11-01T20:16:07.031658Z", "iopub.status.idle": "2024-11-01T20:16:07.033644Z", "shell.execute_reply": "2024-11-01T20:16:07.033477Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### The First Map" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2024-11-01T20:16:07.047535Z", "iopub.status.busy": "2024-11-01T20:16:07.047450Z", "iopub.status.idle": "2024-11-01T20:16:07.077820Z", "shell.execute_reply": "2024-11-01T20:16:07.077528Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "