Spatial Data SQL Queries Training Course

Duration 10 days 20 modules · 65 contact hours
Level Intermediate Certificate on completion
Who attends GIS Analyst, Database Developer and others
Fee from USD 2,200 KSh 190,000 for Kenyan organisations
Where 52 cities + online See dates by city
Next start 16 Nov 2026 Course code SD-DS-069

Before you join: Participants should be comfortable writing basic SQL SELECT statements, filtering rows, joining tables and using aggregate functions.

Dates & prices

Two start dates a month in every city, and live online on weekdays or weekends. Fees are per participant; classroom fees include tuition, materials, lunch and refreshments, and the certificate.

Suggest a date or city

Showing the next six months. Later dates, other cities and private deliveries for your team are available on request.

Course overview

Spatial data teams need reliable answers to questions such as: Which customers fall within a service zone? Which assets lie near a planned road corridor? Where do incident patterns overlap with flood-risk areas? Standard SQL alone cannot answer these questions accurately without geometry types, coordinate reference systems, spatial predicates, indexing and disciplined data-quality controls. Poor spatial queries can produce incorrect distances, missed records, slow reports and decisions based on mismatched coordinate systems.

This course teaches participants to write, test and optimise SQL queries for spatial databases. Participants work with vector and raster data, geometry and geography types, Well-Known Text, coordinate transformations, spatial joins, buffers, overlays, nearest-neighbour searches, topology checks and spatial aggregation. The course uses PostgreSQL with PostGIS as the main learning environment while explaining concepts that transfer to Microsoft SQL Server, Oracle Spatial and other spatially enabled database platforms. Participants also learn how to interpret query plans, build spatial indexes, prepare data for web mapping and apply access controls.

Teaching combines short technical briefings with instructor demonstrations, structured case work, group query reviews and individual build time. Cases reflect asset management, banking catchment analysis, public services, environmental monitoring and infrastructure planning. Participants build a reusable spatial SQL analysis pack containing a documented data model, validated loading process, tested query library, performance plan and map-ready outputs. A certificate of completion is awarded to participants who complete the course.

The course suits database professionals, GIS analysts, data engineers and technical specialists who already use SQL and need to manage or analyse location-based data with greater accuracy and speed.

What you will be able to do

  • Design spatial database tables using geometry types, keys, constraints and coordinate reference systems
  • Load and validate vector, raster and tabular location data using PostGIS import methods
  • Write spatial SQL queries using predicates, joins, buffers, overlays and distance calculations
  • Apply coordinate transformations and measurement rules to produce defensible spatial results
  • Build spatial indexes and interpret execution plans for large geographic datasets
  • Assess spatial data quality through topology checks, validity tests and metadata review
  • Publish query results as GeoJSON, views and map-ready datasets for downstream users
  • Produce a documented spatial SQL analysis pack for a defined operational question

Benefits of attending

For you

  • Write accurate proximity, containment and overlap queries without desktop GIS dependence
  • Diagnose coordinate system errors before they affect reports or operational decisions
  • Build faster location-based reports through spatial indexes and query-plan analysis
  • Create reusable PostGIS query libraries for asset, customer and risk analysis
  • Present a documented spatial analysis deliverable for a professional portfolio

For your organisation

  • Reduce manual map analysis by moving repeatable location questions into governed SQL workflows
  • Improve confidence in service-area, asset-proximity and geographic risk reporting
  • Shorten response times for operational questions involving large location datasets
  • Strengthen spatial data controls through validity checks, metadata and access rules
  • Create reusable database views and query patterns for mapping and reporting teams

Course modules

20 modules over 10 days

Participants can explain how spatial data is represented, stored and queried in a relational database.

  • Spatial database use cases for assets, customers, hazards and service areas
  • Vector, raster and network data distinctions in relational database storage
  • OGC Simple Features model: features, geometries, attributes and identifiers
  • Spatial reference systems and transformation responsibilities within database workflows
  • Database architecture choices for transaction, analysis and publication workloads
  • Reading spatial SQL function signatures, return types, units and nulls

Participants can structure readable SQL statements that support later spatial analysis.

  • SELECT, WHERE and ORDER BY patterns for geographic attribute filtering
  • INNER, LEFT and CROSS joins applied to location reference tables
  • GROUP BY and HAVING clauses for geographic reporting measures
  • Common table expressions used to stage multi-step spatial queries
  • CASE expressions for classifying records by operational location rules
  • Null handling with COALESCE, NULLIF and three-valued SQL logic

Participants can select suitable spatial types and coordinate reference systems for stated analysis requirements.

  • Point, line, polygon and multipolygon geometry types in PostGIS
  • Geometry versus geography types for local and global measurements
  • EPSG codes, SRIDs and coordinate reference system metadata
  • Choosing projected coordinate systems for area and distance calculations
  • ST_SetSRID, ST_Transform and transformation error diagnosis methods
  • Axis order, longitude latitude order and coordinate precision controls

Participants can load spatial data into structured tables with appropriate constraints and metadata.

  • PostGIS table design using geometry columns and dimensional constraints
  • Primary keys, foreign keys and lookup tables for geographic datasets
  • Importing shapefiles, GeoJSON and CSV coordinates with GDAL tools
  • Well-Known Text and Well-Known Binary geometry encoding formats
  • ST_GeomFromText and ST_MakePoint for controlled geometry creation
  • Metadata records for lineage, currency, licence and coordinate reference systems

Participants can select records accurately using topological and distance-based spatial predicates.

  • ST_Intersects for identifying features with shared spatial extent
  • ST_Within and ST_Contains for containment-based record selection
  • ST_Touches, ST_Crosses and ST_Overlaps for boundary relationships
  • ST_DWithin for indexed proximity searches using defined distance thresholds
  • Bounding-box operators for early candidate filtering and index use
  • Testing predicate direction when points, lines and polygons interact

Participants can create derived geometries and calculate defensible spatial measures.

  • ST_Buffer parameters for distance zones, joins and service catchments
  • ST_Distance and ST_Length with suitable coordinate system selection
  • ST_Area calculations, units conversion and polygon measurement checks
  • ST_Centroid, ST_PointOnSurface and representative location selection
  • ST_Envelope and ST_Extent for spatial coverage and data footprint summaries
  • ST_Union and ST_Collect for combining related geographic features

Participants can join datasets by location and produce overlay-derived business measures.

  • Spatial join patterns combining attributes through ST_Intersects predicates
  • Point-in-polygon joins for customer, incident and asset allocation
  • ST_Intersection for extracting overlapping roads, zones and land parcels
  • ST_Difference for identifying excluded areas and residual territories
  • Many-to-many spatial joins and duplicate result management techniques
  • Area-weighted allocation methods for intersecting administrative boundary datasets

Participants can answer nearest-feature and travel-independent proximity questions efficiently.

  • K-nearest-neighbour operators for ordered nearest asset searches
  • LATERAL joins for nearest facility lookup per source record
  • ST_DWithin prefilters combined with exact distance measurements
  • Ranking nearest locations using window functions and distance ordering
  • Distance bands for service coverage, exposure and response analysis
  • Planar versus geodesic distance choices for operational query requirements

Participants can summarise location-based activity into areas, grids and management zones.

  • Counts and sums grouped by administrative areas through spatial joins
  • ST_ClusterDBSCAN for density-based clustering of point event datasets
  • Grid generation with ST_SquareGrid for consistent geographic aggregation
  • Rate calculations using population, area and denominator reference datasets
  • Percentages and suppression rules for sensitive small-area reporting
  • Materialized views for recurring geographic summary tables and dashboards

Participants can build spatial indexes and improve slow queries using execution-plan evidence.

  • GiST indexes for geometry columns and bounding-box search operations
  • SP-GiST index use cases for selected spatial data distributions
  • EXPLAIN and EXPLAIN ANALYZE for spatial query-plan interpretation
  • Index-supported predicates versus functions that prevent index usage
  • Statistics maintenance with ANALYZE after major spatial data loads
  • Query rewrites using candidate filters and staged exact calculations

Participants can inspect and query raster data alongside vector features for location-based analysis.

  • Raster bands, pixels, nodata values and spatial alignment concepts
  • ST_Value for retrieving raster values at specified point locations
  • ST_Clip for limiting raster processing to areas of interest
  • ST_SummaryStats for raster distribution measures within selected areas
  • Vector-raster overlay patterns for elevation, flood and land-cover analysis
  • Raster storage choices, tiling and performance implications for queries

Participants can identify and correct common spatial data defects before analysis or publication.

  • ST_IsValid and ST_IsValidReason for geometry defect identification
  • ST_MakeValid approaches for self-intersections and invalid polygon rings
  • Duplicate geometry detection using equality and proximity comparison methods
  • Topology rules for gaps, overlaps, dangles and boundary consistency
  • Precision reduction methods for coordinate noise and storage control
  • Quality-control queries documented with exceptions, owners and remediation actions

Participants can query changing locations, boundaries and asset states across defined time periods.

  • Valid time, transaction time and effective-dated spatial record concepts
  • Range types and exclusion constraints for non-overlapping asset histories
  • Temporal joins between events, boundaries and operational service zones
  • Versioned geometry records with audit columns and change reason codes
  • Point-in-time queries using effective dates and spatial predicates
  • Archiving strategies for superseded boundaries, routes and asset locations

Participants can build maintainable multi-stage spatial analyses using advanced SQL structures.

  • Recursive common table expressions for connected network-like relationships
  • Window functions for spatial ranking, sequencing and rolling measures
  • LATERAL subqueries for per-feature derived spatial calculations
  • SQL functions for reusable parameterised spatial query logic
  • Temporary tables versus common table expressions for complex processing
  • Transaction control for safe loading, correction and analysis workflows

Participants can prepare secure, map-ready outputs for web, reporting and GIS consumers.

  • GeoJSON output using ST_AsGeoJSON and feature property construction
  • Database views for controlled access to map-ready result datasets
  • Vector tile concepts and ST_AsMVT query preparation methods
  • Simplification with ST_SimplifyPreserveTopology for web display performance
  • Stable identifiers, display fields and geometry naming conventions
  • Output validation against source records, maps and business definitions

Participants can apply database controls appropriate to sensitive and operational spatial data.

  • Role-based permissions for spatial tables, views and database functions
  • Row-level security patterns for territory, region and client restrictions
  • Sensitive location handling through masking, aggregation and access controls
  • Metadata requirements for source authority, licence and update frequency
  • Audit logging for edits to regulated assets and geographic boundaries
  • Release checklists for spatial schema changes and published query views

Participants can move data and query logic between common GIS and database environments.

  • PostGIS, SQL Server and Oracle Spatial function mapping considerations
  • OGC Simple Features SQL interoperability limits and vendor extensions
  • QGIS database connections for inspecting query outputs and source tables
  • GDAL and OGR conversions between file formats and database layers
  • GeoJSON, GeoPackage and shapefile strengths, constraints and field limitations
  • Portable SQL design choices for multi-platform spatial data estates

Participants can translate operational questions into testable spatial SQL specifications.

  • Problem framing using entities, locations, measures, rules and decision outputs
  • Source assessment covering coverage, scale, currency and positional accuracy
  • Query acceptance criteria defined with examples, tolerances and exception rules
  • Data model sketches linking assets, events, zones and reference boundaries
  • Performance targets for recurring reports, services and interactive maps
  • Documentation structure for assumptions, methods, limitations and ownership

Participants can review spatial SQL for correctness, efficiency, maintainability and data-risk issues.

  • Code review criteria covering predicates, SRIDs, units and index usage
  • Diagnosing empty result sets from coordinate system mismatches
  • Investigating duplicate records created through many-to-many spatial joins
  • Comparing map outputs against SQL counts and sampled source records
  • Refactoring repeated spatial expressions into views and database functions
  • Peer review records capturing defects, decisions and approved corrections

Participants can build, review and present a complete documented spatial SQL analysis pack for an operational scenario.

  • Define a spatial decision question, users, outputs and acceptance criteria
  • Design tables, geometry columns, constraints and coordinate reference system choices
  • Load and validate source datasets with documented quality findings
  • Build spatial joins, proximity queries, aggregates and derived geometries
  • Tune selected queries using indexes, statistics and execution-plan evidence
  • Publish map-ready outputs through documented views and GeoJSON extracts
  • Present methods, findings, limitations and recommended operational actions

Exercises and examples are adapted to each cohort's sectors and roles.

What you take back to work

  1. Spatial SQL query library
  2. PostGIS schema design template
  3. Coordinate reference system selection checklist
  4. Spatial data quality-control checklist
  5. Query performance tuning plan
  6. Documented spatial analysis pack

Who should attend

  • GIS Analyst — needs repeatable database queries instead of manual desktop GIS processing
  • Database Developer — needs to add spatial types, functions and indexes to SQL solutions
  • Data Engineer — needs to load, validate and transform geographic datasets reliably
  • Business Intelligence Developer — needs location-based measures and map-ready reporting datasets
  • Asset Management Specialist — needs to analyse infrastructure location, proximity and service coverage
  • Technical Product Manager — needs to specify spatial data requirements and assess delivery quality

Skills and tools covered

Spatial SQL queryingPostGIS data modellingCoordinate system managementSpatial performance tuningTopology validationGeographic data publishing

Tools and standards

PostgreSQL, PostGIS, QGIS, OGC Simple Features SQL

How the course runs

Training methodology

The course uses short instructor briefings followed by guided SQL demonstrations and progressive case work in a spatial database environment. Participants inspect source data, write queries, compare alternative methods and review outputs against maps and business rules. Group exercises focus on query design, coordinate-system decisions, data-quality findings and performance trade-offs. Simulated requests from asset, service-planning and risk teams require participants to translate operational questions into tested spatial SQL. Individual application planning connects the methods to participants’ own databases and reporting requirements.

Requirements and prerequisites

Participants should be comfortable writing basic SQL SELECT statements, filtering rows, joining tables and using aggregate functions. Familiarity with relational database concepts such as tables, primary keys, foreign keys and data types is assumed. Some experience handling GIS data or viewing maps is useful but not essential. Participants do not need prior PostGIS, PostgreSQL, Python, desktop GIS or spatial statistics experience. The course explains geometry concepts, coordinate reference systems and spatial functions from first principles before moving to advanced query design and performance work.

A typical training day

08:30 – 10:30First session
10:30 – 10:45Refreshment break
10:45 – 12:30Second session
12:30 – 13:30Lunch and networking
13:30 – 15:00Third session
15:00 – 15:15Refreshment break
15:15 – 16:30Workshop and daily review

Live online deliveries follow the same structure in East Africa Time, with shorter screen blocks and longer breaks.

What the fee includes

  • Instruction by a practitioner facilitator
  • Full course workbook and materials
  • Exercise files, templates and case studies
  • Refreshments and lunch on classroom deliveries
  • Certificate of completion
  • Post-course application plan

Frequently asked questions

You should be able to write basic SELECT statements, filter records, join tables and use GROUP BY. You do not need prior PostGIS, GIS, Python or spatial statistics experience.

Bring a laptop if attending live online or if your organisation requires use of its managed device. Course datasets and access instructions are provided; participants may also bring non-sensitive examples of their own spatial data questions.

It is intended for GIS analysts, database developers, data engineers, BI developers and technical asset or risk specialists. It is most valuable for people who need repeatable location-based analysis in a database rather than manual map work.

General SQL courses focus on relational querying without geometry, coordinate systems or spatial indexes. Desktop GIS courses focus on visual analysis tools; this course concentrates on database-resident spatial data, SQL functions, performance and governed outputs.

Participants can use the methods to build service-area queries, asset proximity reports, customer catchments, incident summaries, risk overlays and map-ready reporting views. The final analysis pack provides a structure for documenting and reviewing such work.

Each training day runs from 08:30 to 16:30 and provides about 6.5 contact hours. The first part establishes spatial SQL foundations and working query patterns; the later part addresses performance, quality, publication, governance and a complete capstone build.

Questions about this course?

Ask about dates, fees, group bookings or running it for your team. Our training team replies by email.