Coordinate Reference Systems

Working with Geospatial Data 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.

Working with Geospatial Data 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]
Working with Geospatial Data in Python

Maps are 2D

Working with Geospatial Data in Python

Projected coordinates

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

Working with Geospatial Data in Python

Projected coordinates - Examples

Albers Equal Area projection

Working with Geospatial Data in Python

Projected coordinates - Examples

Mercator projection

Working with Geospatial Data in Python

Projected coordinates - Examples

Projected size vs actual size (Mercator projection)

Working with Geospatial Data 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)

Working with Geospatial Data 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'}
Working with Geospatial Data 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
Working with Geospatial Data in Python

Let's practice

Working with Geospatial Data in Python

Preparing Video For Download...