Coordinate Reference Systems

Lavorare con i dati geospaziali in Python

Joris Van den Bossche

Open source software developer and teacher, GeoPandas maintainer

Coordinate Reference System (CRS)

Location of the Eiffel Tower:

POINT (2.2945 48.8584)

→ The Coordinate Reference System (CRS) relates the coordinates to a specific location on earth.

Lavorare con i dati geospaziali in Python

Geographic coordinates

Degrees of latitude and longitude.

E.g. 48°51′N, 2°17′E

Used in GPS, web mapping applications...

Attention!
in Python we use (lon, lat) and not (lat, long)

  • Longitude: [-180, 180]
  • Latitude: [-90, 90]
Lavorare con i dati geospaziali in Python

Maps are 2D

Lavorare con i dati geospaziali in Python

Projected coordinates

(x, y) coordinates are usually in meters or feet

Lavorare con i dati geospaziali in Python

Projected coordinates - Examples

Albers Equal Area projection

Lavorare con i dati geospaziali in Python

Projected coordinates - Examples

Mercator projection

Lavorare con i dati geospaziali in Python

Projected coordinates - Examples

Projected size vs actual size (Mercator projection)

Lavorare con i dati geospaziali in Python

Specifying a CRS

proj4 string

Example: +proj=longlat +datum=WGS84 +no_defs

Dict representation:

{'proj': 'longlat', 'datum': 'WGS84', 'no_defs': True}

EPSG code

Example:

EPSG:4326 = WGS84 geographic CRS (longitude, latitude)

Lavorare con i dati geospaziali in Python

CRS in GeoPandas

The .crs attribute of a GeoDataFrame/GeoSeries:

import geopandas
gdf = geopandas.read_file("countries.shp")
print(gdf.crs)
{'init': 'epsg:4326'}
Lavorare con i dati geospaziali in Python

Summary

  • "geographic" (long, lat) versus "projected" (x, y) coordinates
  • Coordinates Reference System (CRS) in GeoPandas: .crs attribute
  • Most used geographic CRS: WGS84 or EPSG:4326
Lavorare con i dati geospaziali in Python

Let's practice

Lavorare con i dati geospaziali in Python

Preparing Video For Download...