{ "cells": [ { "cell_type": "markdown", "id": "100ed2b5", "metadata": {}, "source": [ "## Parameter `use_crs`\n", "\n", "The `use_crs` parameter is supported by all geometry layers which have the `map` parameter, i.e. by layers which can be used for vizualization of Geopandas GeoDataFrame.\n", "\n", "Those layers are: `point, path, polygon, text, label and map`.\n", "\n", "By default, Lets-Plot converts all coordinates in every GeoDataFrame to degrees of longitude and latitude and leter projects these map coordinates to screen coordinates useing Mercator projection.\n", "\n", "Sometimes it might be necessary to use some other coordinate reference system (CRS) instead of the default WGS84 / Mercator.\n", "\n", "If this is the case, you can use the `use_crs` parameter to specify EPSG code of CRS to project GeoDataFrame coordinates to." ] }, { "cell_type": "code", "execution_count": 1, "id": "b42d401a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "from lets_plot import *\n", "LetsPlot.setup_html()" ] }, { "cell_type": "markdown", "id": "785bfaa5", "metadata": {}, "source": [ "Let's say we have a raster image (for example, a satellite or aerial photograph, or a DEM image) that covers a square lend area with:\n", "- left-bottom corner at coordinates (25_000, 4_500_000)\n", "- right-top corner at coordinates (525_000, 5_000_000)\n", "\n", "In practice, the image coordinates and the image coordinate reference system (CRS) are known from \n", "a metadata accompanying the image.\n", "\n", "Here, for the sake of simplicity, we will use just a simple generated image 2 x 2 pix.\n", "\n", "We will also presume that our image coordinates use [UTM zone 33N](https://epsg.io/32633) CRS (aka EPSG:32633).\n", "\n", "Thus, the image coordinates are given in **meters** instead of more familiar longitude and latatude." ] }, { "cell_type": "code", "execution_count": 2, "id": "31d95b93", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "