Science and engineering

Machine learning for geospatial analysis

Geospatial machine learning works with points, lines and polygons: predicting prices or demand at a location, building features from spatial joins and nearby amenities, and finding hotspots in mapped events. Because nearby places resemble each other, models are tested with spatial cross-validation.

How machine learning is used in geospatial analysis

Mapping where people live

Models spread coarse census counts across fine grid cells using predictors such as building density, roads, night-time lights and land cover. The result is a detailed population surface for planning and emergency response.

Real exampleRandom forest population mapping (Stevens et al., PLOS ONE, 2015)Used a random forest with remotely sensed and ancillary data to disaggregate census counts into fine-scale gridded population maps.

Estimating economic indicators by location

Where surveys are sparse, models trained on survey locations predict indicators such as wealth from satellite imagery and other spatial data, filling in a map at fine resolution.

Real exampleRelative Wealth Index (Chi et al., 2021)Estimated wealth and poverty for all 135 low and middle-income countries at 2.4 km resolution using machine learning on satellite, mobile phone network, topographic and aggregated connectivity data.

Extracting map features from imagery

Segmentation models trace buildings, roads and field boundaries from aerial and satellite images, producing vector layers that would take years to digitise by hand.

Real exampleGlobal ML building footprints (Microsoft Bing Maps)Bing Maps released open building footprints derived from satellite imagery, reporting 1.4 billion buildings detected from imagery captured between 2014 and 2024.

Knowing where a spatial model can be trusted

Spatial models are often applied far from their training samples, in places whose conditions differ. Checking which areas resemble the training data shows where predictions are supported and where they are guesses.

Real exampleArea of applicability (Meyer and Pebesma, 2021)Proposed a method to delineate the area where a spatial prediction model can be applied, based on how far new locations differ from the training data in predictor space.

Can you learn geospatial machine learning?

Yes. If you already use GIS, the main additions are Python, spatial data handling in code and machine learning with spatially aware validation. Start with tabular models on spatial features before moving on to imagery and deep learning.

  1. PythonScript the analyses you would otherwise click through in a desktop GIS.Learn it in Python
  2. Tabular data with pandasJoin, aggregate and reshape the attribute tables that sit behind every map, then extend this to GeoPandas for spatial joins and projections.Learn it in Data Tools
  3. Spatial statisticsSpatial autocorrelation, hotspot statistics and kriging are the baselines for any spatial model.Learn it in Statistics
  4. Machine learning with spatial cross-validationGradient boosting and random forests on engineered location features, validated with blocked or leave-region-out splits.Learn it in Machine Learning
  5. Deep learning on imagerySegmentation models extract buildings, roads and land cover from satellite and aerial images.Learn it in Deep Learning

Moving into geospatial machine learning

If you already work in the field

GIS analysts already understand projections, spatial joins and data quality, which many data scientists get wrong. Add Python, GeoPandas and scikit-learn, then rebuild one of your existing analyses as a predictive model with spatial cross-validation. Mapping agencies, utilities, logistics and property firms value this combination.

If you come from data science or ML

Data scientists should learn coordinate reference systems, spatial joins and spatial autocorrelation, and why random splits leak information between neighbouring locations. A GeoPandas tutorial and a chapter on spatial statistics cover most of what you need.

Roles that do this workGeospatial data scientistGIS analystLocation intelligence analystEarth observation data scientist

Tools you will use

ToolWhat you use it for
GeoPandasLoad, project and spatially join points, lines and polygons in a table.
ShapelyCompute distances, buffers, intersections and other geometry operations.
PySALMeasure spatial autocorrelation and fit spatial regression and clustering models.
H3Index locations into hexagonal cells for aggregation and neighbourhood features.
OSMnxDownload OpenStreetMap street networks and amenities and compute network distances.
scikit-learnTrain location-feature models and run grouped cross-validation over spatial blocks.

Public data to practise on

  • Inside Airbnb: Short-term rental listings with coordinates, prices and reviews for many cities, suited to location-based price prediction.
  • OpenStreetMap extracts (Geofabrik): Regional OpenStreetMap downloads of roads, buildings and points of interest for building location features.
  • US Census TIGER/Line: Census tract, block and road boundaries to join with demographic tables for area-level modelling.

Your first project

Download an Inside Airbnb city file, predict nightly price from location features such as distance to the centre and nearby OpenStreetMap amenities with gradient boosting, and compare it with a neighbourhood median baseline using MAE under spatial block cross-validation.

Common questions

What is GeoAI?

GeoAI is the use of AI and machine learning on geographic data: predicting values at locations, extracting features from imagery and analysing movement and networks. It builds on GIS and spatial statistics.

What is spatial cross-validation?

It splits data by location, for example into blocks or regions, so test points are not next to training points. This gives an honest estimate of how a model performs in places it has not seen.

Which Python tools are used for geospatial machine learning?

GeoPandas and Shapely for vector data, rasterio and xarray for rasters, scikit-learn and LightGBM for models and PyTorch for imagery are common. QGIS remains useful for checking results visually.

Do I need to learn GIS before geospatial machine learning?

You need the core ideas: coordinate systems, vector and raster data and spatial joins. You do not need to master desktop GIS software, since most of the work can be done in Python.

Courses for these skills

New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.