Skip to content
← Back to GIS Fundamentals
gis-fundamentalsBeginner· 7 min read

Where Spatial Data Comes From: Open Data, Web Services and OpenStreetMap

The main sources of spatial data, how licences and credit work, how web tile and map services deliver data, and how OpenStreetMap stores features as tags.

Where spatial data comes from

Every layer on a map was produced by someone, and how it was produced decides how far you can trust it.

SourceHow it is madeExamples
Field surveyPeople or instruments measure positions on the groundGNSS surveys, total station surveys
Remote sensingSatellites, aircraft or drones record the surfaceSentinel-2, Landsat, drone imagery
Official datasetsAgencies collect and publish data for a purposeCensus boundaries, cadastral maps, national elevation models
CrowdsourcedVolunteers contribute and edit dataOpenStreetMap
CommercialA company collects data and licenses itDetailed street networks, high-resolution imagery

No source is best for everything. A survey is precise and expensive, and covers a small area. A satellite scene covers a large area at a fixed resolution. A crowdsourced map is detailed where many people map and thin where few do.

Licences and credit

A licence is the document that says what you may do with the data. Treat it as part of the dataset.

  • Some data is in the public domain, with no conditions. Landsat imagery from the US Geological Survey is an example.
  • Some data is free to use but asks for credit, such as Copernicus Sentinel data, which should be acknowledged as containing modified Copernicus Sentinel data.
  • Some licences also require that anything you build from the data is shared on the same terms. OpenStreetMap uses the Open Database Licence, which requires you to credit "© OpenStreetMap contributors" and to share an adapted database under the same licence.
  • Some data is restricted. Imagery shown in commercial map and globe applications is licensed to the provider, and its terms limit copying and reuse. Check the terms before you trace from it or publish anything made with it.

Put the credit on the map itself, or in the caption, and keep a note of the licence with the data.

Web basemaps and map services

Web services deliver data over the internet. Four kinds are common.

ServiceWhat it returnsTypical use
XYZ tilesSmall square images, requested by zoom level and column and rowBackground maps
WMS (Web Map Service)A map image for the extent and layers you ask forViewing authoritative layers such as land use
WMTSPre-made tiles with a defined tile gridFast background maps from official sources
WFS (Web Feature Service)The actual vector features, with attributesDownloading data to analyse

An XYZ tile address contains placeholders for the zoom level, column and row, written like .../{z}/{x}/{y}.png. The software fills them in for each tile on the screen.

Image-based services give you a picture. You can look at it and trace from it, but you cannot select a building or read an attribute from it. A WFS gives you features you can query, which is why the two are used for different jobs. Tile servers also have usage policies. Free community servers do not allow bulk downloading, so use them as a background and not as a data source.

OpenStreetMap

OpenStreetMap, or OSM, is a map of the world built by volunteers. It is stored as three kinds of element:

  • A node is a single point with coordinates.
  • A way is an ordered list of nodes, forming a line or a closed area.
  • A relation groups elements, for example the parts of a large park or a bus route.

What an element is described by tags. A tag is a key and a value. amenity=hospital marks a hospital, leisure=park marks a park, natural=water marks water, and highway=primary marks a main road. A tool such as QuickOSM turns a key and value into a query and returns the matching features as layers.

Three things follow from how OSM works.

  • A hospital might be mapped as a point or as a building outline, so one query can return both points and polygons.
  • Tags are chosen by contributors, so spelling and detail vary. Expect gaps and inconsistencies.
  • Coverage varies from place to place. Central Bengaluru is mapped in great detail, and many other areas are not.

Choosing and checking data

Before you trust a dataset, ask five questions.

  1. Who made it, and for what purpose?
  2. When was it made? A road layer from ten years ago may miss new roads.
  3. What scale or resolution does it have? It cannot show detail finer than that.
  4. What coordinate system is it in?
  5. How complete is it for your area?

Then record the source, the date you downloaded it and its licence. A project you cannot trace back to its sources is hard to repeat and hard to defend.

Example: hospitals in Bengaluru

In the QGIS series, hospitals in Bengaluru are downloaded from OpenStreetMap with the key amenity and the value hospital, which returns more than a thousand features. The same data is saved to a GeoPackage and shown over Sentinel-2 imagery, which is public and credited as modified Copernicus Sentinel data. The map credits both sources. Because OSM features may be points or building outlines, the tutorial counts them as features without claiming the number is a complete count of hospitals.

Common mistakes

  • Using data without reading its licence.
  • Leaving the credit off a map.
  • Treating a tile map as a dataset you can query.
  • Downloading tiles in bulk from a free community server.
  • Assuming OpenStreetMap is equally complete everywhere.
  • Not recording the source and the download date.

Glossary

TermMeaning
LicenceThe terms that say what you may do with a dataset
AttributionThe credit you must give to the data's source
TileA small image that forms part of a web map
WMS and WFSServices that return map images and vector features
TagA key and value that describes an OpenStreetMap element
Open dataData that anyone can use under a published licence

Practise it

The tutorial Data capture and format conversion adds web basemaps, downloads OpenStreetMap data with QuickOSM and converts it between formats.

Test yourself

1. What does the Open Database Licence ask of you when you use OpenStreetMap data?

You must credit "© OpenStreetMap contributors", and if you share an adapted database, you must share it under the same licence.

2. Why can you not select a building on an XYZ tile map?

Tiles are pictures. They hold no features or attributes, so there is nothing to select. A WFS returns the features themselves.

3. What do the key and value in leisure=park mean?

The key leisure is the kind of tag, and the value park says what this feature is.

Quick quiz

1. Which service returns the vector features themselves?
2. An OpenStreetMap query for amenity=hospital returns points and polygons. Why?
3. What should you record about every dataset?
0 of 3 answered

Key takeaways