In the world of GIS and Geoinformatics, terms like web services and APIs often come up. While they might sound technical, understanding these concepts can enhance how we interact with geospatial data. This note provides a straightforward explanation of both, with GIS-related examples to illustrate their roles.


What is an API?

An API (Application Programming Interface) is like a menu in a restaurant. It tells you what you can order and how to order it, but not how the kitchen prepares the food. In the context of software, an API allows different applications to communicate and share information or functionalities without needing to know the intricate details of each other’s code.

Example in GIS:

  • Map Integration: When you embed a Google Map into a website, you’re using Google’s Maps API. It allows your website to display maps, add markers, and provide directions without having to build the mapping software from scratch.

What is a Web Service?

A web service is a specific kind of API that operates over the internet. It’s like an online service that you can access through a web address. Web services allow applications to communicate over a network, often providing data or functionality that can be integrated into other applications.

Example in GIS:

  • Accessing Geospatial Data: Suppose you’re working on a project that requires the latest weather data for a specific region. A web service can provide this data in real-time, which your application can request and use to display weather patterns on a map.

Bringing It Together: A GIS Example

In our note on the Danish address system, we used the following web service call:

https://api.dataforsyningen.dk/adresser?kommunekode=0360&format=geojson

Here’s how this example illustrates both concepts:

  • API Aspect: The URL includes parameters like kommunekode=0360 and format=geojson, which are part of the API’s “menu.” They specify what data we want (addresses in a particular municipality) and in what format (GeoJSON).

  • Web Service Aspect: This API call is made over the internet to api.dataforsyningen.dk, accessing a web service that returns geospatial data.

When you enter this URL in a web browser or use it in an application, you receive geospatial data in GeoJSON format. This data can then be used to plot addresses on a map within your GIS application.


Why It Matters

Understanding web services and APIs helps you:

  • Access Real-Time Data: Retrieve up-to-date geospatial information from various sources.
  • Enhance Applications: Integrate different functionalities like mapping, routing, or data analysis without building them from scratch.
  • Improve Interoperability: Ensure that different systems and applications can work together seamlessly.

By grasping these concepts, you can better navigate the tools and resources available in GIS and make more informed decisions in your projects.