AI in Spatial Data 2400-MIKRO-AIBF-AISD
The course takes the form of a seminar and computer lab combined into a single session format. Each thematic block opens with a theoretical introduction supported by PDF slides, followed immediately by live demonstrations of practical implementations in Python and R, applied to real spatial datasets. This integrated structure allows students to connect methodological concepts directly to working code and to observe the full analytical pipeline – from raw data acquisition to model evaluation and result interpretation – in a single session.
1. Introduction and fundamentals of spatial data
The course opens by motivating the analysis of spatial data. Drawing on Tobler's First Law of Geography (1970). Students learn why the geographic dimension of data matters for business decisions, public policy, pattern detection, and predictive modelling. The theoretical introduction covers the core concepts of spatial data: geometry types (points, lines, polygons), the Well-Known Text (WKT) representation standard, geometry validity, coordinate reference systems and map projections, area centroids, and the main file formats used to store spatial data (shapefile, GeoJSON). The practical component demonstrates these concepts in Python using the GeoPandas library: loading and inspecting spatial data, reprojecting geometries, computing centroids, and producing basic maps.
2. Basic spatial analysis
This block introduces the methodological toolkit for analysing spatial structure. The theoretical part covers spatial weight matrices – the formal representation of neighbourhood relationships between geographic units – and the two main approaches to defining neighbourhood: contiguity-based (queen and rook criteria) and distance-based (k nearest neighbours, distance threshold). Row standardisation of weight matrices is explained, as is the concept of the spatial lag: a weighted average of a variable across an observation's neighbours, which captures the local context of each location. The block then introduces spatial autocorrelation and its formal measurement via Moran's I statistic and the Moran scatterplot. These concepts are illustrated with real data and implemented in Python using the PySAL / libpysal ecosystem, with visualisations produced using matplotlib and geopandas.
3. Getting data from OpenStreetMap
OpenStreetMap (OSM) is introduced as a global, freely available, volunteer-contributed geographic database and an important source of spatial data for research and applied analysis. The theoretical part covers the OSM data model: the three geometric primitives (nodes, ways, and relations), the tag system of key-value pairs that carries semantic meaning, and the taxonomy of commonly used feature types – with particular attention to the highway key (road hierarchy from motorway to living street, and non-road features such as bus stops and traffic signals), the amenity key (restaurants, schools, hospitals, and other points of interest), and building footprints. The block also addresses OSM data quality, completeness biases, and the implications of volunteer-contributed data for spatial analysis. The practical component uses the OSMnx Python library to download road networks and points of interest for specified places and bounding boxes, filter features by tag type, reproject geometries to metric coordinate systems, compute road lengths, and perform catchment area analyses using spatial buffers and point-in-polygon operations.
4. Getting data from space
This block introduces Earth observation satellites as a source of spatial data for economic and geographic analysis, covering two complementary products.
Night-time light intensity (NTLI). The VIIRS sensor aboard NASA's Suomi NPP and NOAA-20 satellites measures radiance emitted at night at approximately 500-metre spatial resolution. The Black Marble product suite applies radiometric corrections to produce consistent composites at daily (VNP46A2), monthly (VNP46A3), and annual (VNP46A4) temporal resolutions. The theoretical introduction discusses the history of night-time light data, its applications in the literature (GDP estimation, electrification monitoring, conflict tracking, economic shock nowcasting), and the methods used to aggregate pixel-level raster values within polygons. Empirical evidence on the relationship between NTLI-derived features and municipal income in Poland is presented. In the practical component, students download Black Marble data using the blackmarbler R package and extract distributional features using exactextractr.
Daytime satellite imagery. ESA's Sentinel-2 mission provides multispectral imagery with 10-metre resolution in visible and near-infrared bands and a 5-day revisit time. The theoretical part covers the Sentinel-2 band structure, the distinction between Level-1C and Level-2A products, cloud cover handling strategies (seasonal windowing, cloud masking, least-cloudy image selection), and the image acquisition pipeline. The block then introduces Convolutional Neural Networks (CNNs). Transfer learning from ImageNet to the EuroSAT benchmark is explained as the method for fine-tuning a pre-trained classifier for satellite land cover mapping. In the practical component, students use the Copernicus Browser API to download Sentinel-2 RGB tiles, apply a pre-trained ResNet-50 model to generate land cover predictions.
5. Spatial machine learning
This block addresses the methodological challenges that arise when standard machine learning is applied to spatially structured data. The theoretical introduction distinguishes between statistical inference and predictive modelling, discusses overfitting, and introduces k-fold cross-validation for model evaluation and hyperparameter tuning. The core methodological contribution is the concept of spatial information leakage. Spatial cross-validation – in which folds are defined by geographic clustering rather than random assignment – is presented as the correct solution. Additional topics include spatial feature engineering (spatial lags, distance measures, geographic coordinates), the random forest algorithm, and regression evaluation metrics. In the practical component, students merge satellite-derived features into a modelling dataset, implement spatial cross-validation, train and tune random forest models in scikit-learn, and compare spatial and random CV performance estimates.
6. Analysing data from mobile applications
The final block introduces GPS mobility data from mobile applications as a source of individual-level spatial behaviour data. The theoretical part covers the structure of GPS mobility datasets, the main data sources, and the key limitations. Two analytical tasks are covered in depth. The first is anchor location detection – identifying home and work locations from unlabelled GPS traces – using three approaches of increasing sophistication. The second task is transport mode detection: speed-based rule classification using the Haversine formula is presented as a baseline, followed by more advanced approaches. In the practical component, students implement anchor location detection, apply the stay point algorithm, classify transport modes, and visualise individual mobility patterns on maps.
The project ‘Application of Artificial Intelligence in Business and Finance’ (No. BPI/SPI/2024/1/00078) is implemented by the University of Warsaw as part of the Spinaker programme organised by the National Agency for Academic Exchange (within the project ‘Wsparcie tworzenia i realizacji międzynarodowych programów kształcenia’, funded by the European Funds for Social Development 2021–2027).
Course coordinators
Micro-credential certificate
Learning outcomes
Upon completing the course, the participant
in terms of knowledge:
- knows and understands the fundamental concepts of spatial data, including geometry types, coordinate reference systems, map projections, and spatial weight matrices
- knows and understands the concept of spatial autocorrelation and its implications for statistical modelling and machine learning applied to geographic data
- knows and understands the structure and content of key modern spatial data sources, including OpenStreetMap, NASA Black Marble night-time light composites, ESA Sentinel-2 satellite imagery, and GPS mobility data from mobile applications
- knows and understands the basic principles of convolutional neural networks, transfer learning, and the random forest algorithm in the context of spatial data analysis
- knows and understands the problem of spatial leakage in machine learning and the rationale for spatial cross-validation as the appropriate model evaluation strategy
in terms of skills:
- is able to acquire, process, and transform spatial data from OpenStreetMap, satellite raster products, and GPS mobility datasets into features suitable for quantitative analysis
- is able to extract features from satellite-derived rasters using distributional aggregation methods
- is able to apply a pre-trained convolutional neural network with transfer learning to classify land cover from satellite imagery and aggregate results to area level
- is able to build, tune, and evaluate random forest models for spatial prediction tasks, correctly implementing spatial cross-validation to obtain unbiased performance estimates
- is able to detect anchor locations (home and work) and transport modes from raw GPS mobility data using both rule-based heuristics and clustering algorithms
- is able to perform spatial data analysis in Python and R, using libraries such as GeoPandas, OSMnx, PySAL, scikit-learn, PyTorch, blackmarbler, and exactextractr
in terms of social competences:
- is ready to critically assess the quality, completeness, and potential biases of non-standard spatial data sources before using them in analysis
- is ready to work independently on open-ended spatial data problems, selecting appropriate methods and tools based on the characteristics of the data and the analytical goal
- is ready to communicate the results of spatial analyses clearly to both technical and non-technical audiences, including through cartographic visualisation
- is ready to reflect on the ethical dimensions of working with sensitive spatial data, particularly individual-level mobility data, and to apply relevant legal and ethical frameworks including GDPR
Assessment criteria
Student learning outcomes are assessed through three components: active participation and engagement during in-class sessions, short practical exercises completed at the end of each thematic block in which students independently apply the methods introduced to a new problem, and a final multiple choice test covering the theoretical content of the entire course.
Bibliography
Rey, S., Arribas-Bel, D. and Wolf, L. (2020), Geographic Data Science with Python, https://geographicdata.science/book/
Lovelace, R., Nowosad, J. and Muenchow, J. (2026), Geocomputation with R, https://r.geocompx.org
Dorman, M. et al. (2025), Geocomputation with Python, https://py.geocompx.org