{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
Coordinate reference systems
" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "\n", "import pandas as pd\n", "import geopandas" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "countries = geopandas.read_file(\"data/ne_110m_admin_0_countries.zip\")\n", "cities = geopandas.read_file(\"data/ne_110m_populated_places.zip\")\n", "rivers = geopandas.read_file(\"data/ne_50m_rivers_lake_centerlines.zip\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Coordinate reference systems\n", "\n", "Up to now, we have used the geometry data with certain coordinates without further wondering what those coordinates mean or how they are expressed.\n", "\n", "> The **Coordinate Reference System (CRS)** relates the coordinates to a specific location on earth.\n", "\n", "For an in-depth explanation, see https://docs.qgis.org/2.8/en/docs/gentle_gis_introduction/coordinate_reference_systems.html" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Geographic coordinates\n", "\n", "> Degrees of latitude and longitude.\n", ">\n", "> E.g. 48°51′N, 2°17′E\n", "\n", "The most known type of coordinates are geographic coordinates: we define a position on the globe in degrees of latitude and longitude, relative to the equator and the prime meridian. \n", "With this system, we can easily specify any location on earth. It is used widely, for example in GPS. If you inspect the coordinates of a location in Google Maps, you will also see latitude and longitude.\n", "\n", "**Attention!**\n", "\n", "in Python we use (lon, lat) and not (lat, lon)\n", "\n", "- Longitude: [-180, 180]{{1}}\n", "- Latitude: [-90, 90]{{1}}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Projected coordinates\n", "\n", "> `(x, y)` coordinates are usually in meters or feet\n", "\n", "Although the earth is a globe, in practice we usually represent it on a flat surface: think about a physical map, or the figures we have made with Python on our computer screen.\n", "Going from the globe to a flat map is what we call a *projection*.\n", "\n", "![](img/projection.png)\n", "\n", "We project the surface of the earth onto a 2D plane so we can express locations in cartesian x and y coordinates, on a flat surface. In this plane, we then typically work with a length unit such as meters instead of degrees, which makes the analysis more convenient and effective.\n", "\n", "However, there is an important remark: the 3 dimensional earth can never be represented perfectly on a 2 dimensional map, so projections inevitably introduce distortions. To minimize such errors, there are different approaches to project, each with specific advantages and disadvantages.\n", "\n", "Some projection systems will try to preserve the area size of geometries, such as the Albers Equal Area projection. Other projection systems try to preserve angles, such as the Mercator projection, but will see big distortions in the area. Every projection system will always have some distortion of area, angle or distance.\n", "\n", "\n", " | \n", " |
\n", " |