Serving Spatial Data

The dataset is finished. Now other people need it over HTTP.

The serving path, from what to serve to cache headers on the finished service. the dataset is finished — now other people need it1files, features, tilespick one2OGC API Featuresfilters and paging3tilesdynamic or static4cachingETags, max-agePaging is in stage two because an unbounded endpoint is a denial of service you wrote yourself

Sending a colleague a 400 MB GeoPackage works exactly once. An API is what you build when the data changes, the audience is more than one person, or a map in a browser needs the part of it that is on screen. These guides cover the shapes a spatial service can take — features, tiles and imagery — the filters and paging that keep a response small, the caching that makes the second request free, and the failures that only appear once somebody else is pointing a browser at it.

The route goes from deciding what to serve — files, features or tiles — through the standards that mean callers already know how to ask, to the caching that decides whether the service survives being popular. Paging appears early on purpose: an endpoint with no limit is a denial of service you wrote yourself.

The full path, in order

The concepts underneath the work, then each task, then the errors that task produces. Work down, or jump to the step you need.

  1. OGC API Features Explained: The Standard Behind Modern Spatial APIs ogc api features explained 🧭 Concept
  2. How to Add Bounding Box and Attribute Filters to a Spatial API spatial api bbox filter ⚙️ How-To
  3. How to Paginate a Large Feature API in Python paginate feature api python ⚙️ How-To
  4. GeoJSON, Vector Tiles or Parquet: Choosing an API Response Format api response format geojson 🧭 Concept
  5. How to Implement OGC API Features in Python implement ogc api features ⚙️ How-To
  6. Dynamic Tile Server or Static Tiles: What to Serve tile server vs static tiles 🧭 Concept
  7. How to Serve Vector Tiles from PostGIS with ST_AsMVT serve vector tiles postgis ⚙️ How-To
  8. How to Serve Raster Tiles from a COG with TiTiler serve raster tiles titiler ⚙️ How-To
  9. HTTP Caching for Spatial Data: ETags, Max-Age and Invalidation http caching spatial data 🧭 Concept
  10. How to Set Cache Headers on a Spatial API and Tile Service cache headers spatial api ⚙️ How-To
  11. How to Stream Large Query Results from a Spatial API stream large api response ⚙️ How-To
  12. Authentication and Rate Limits for a Spatial API spatial api authentication 🧭 Concept
  13. How to Rate Limit and Throttle a Spatial API rate limit spatial api ⚙️ How-To
  14. How to Test a Spatial API with pytest and httpx test spatial api pytest ⚙️ How-To
  15. Fixing CORS Errors on a Spatial API spatial api cors error 🔧 Fix
  16. Fixing a Tile Endpoint That Returns 404 or Blank Tiles tile endpoint 404 blank 🔧 Fix
  17. Fixing a Spatial API That Is Slow Under Load spatial api slow under load 🔧 Fix
  18. Fixing Coordinates in the Wrong Order in an API Response api coordinates wrong order 🔧 Fix
  19. Fixing an API Worker That Runs Out of Memory api worker out of memory 🔧 Fix

Topics this path covers

A path is a route; a topic is everything the site has on a subject. Open a topic to see the guides this path skips.

Other ways in