By Jan Tschada | Updated a month ago | Location
Health Check



Geospatial Land Cover API Service

Classify locations into well-known land cover categories.

Classify locations using Python

We have some named locations with coordinates and want to classify them using the service.

import requests
import os
import pandas as pd

api_key = os.environ.get('x_rapidapi_key')

You need some helper functions accessing the API using the requests module.

def classify_landcover(latitudes, longitudes):
    url = ""
    payload = {
        'lat': latitudes,
        'lon': longitudes
    headers = {
        'content-type': 'application/json',
        'X-RapidAPI-Key': api_key,
        'X-RapidAPI-Host': ''
    result =, json=payload, headers=headers)
    return result.json()

You define two named locations.

named_locations = [
        'name': 'Kernkraftwerk Brokdorf',
        'lat': 53.850833,
        'lon': 9.344722
        'name': 'Kernkraftwerk Stendal',
        'lat': 52.723774,
        'lon': 12.017516

You create a pandas dataframe using the dictionary and enrich this dataframe using the API.

named_locations_df = pd.DataFrame.from_dict(named_locations)
latitudes = named_locations_df['lat'].values.tolist()
longitudes = named_locations_df['lon'].values.tolist()
classifications = classify_landcover(latitudes, longitudes)
named_locations_df['category'] = classifications[1]
name lat lon category
Kernkraftwerk Brokdorf 53.850833 9.344722 Industrial or commercial units
Kernkraftwerk Stendal 52.723774 12.017516 Industrial or commercial units
Followers: 1
Product Website Terms of use
API Creator:
Rapid account: Jan Tschada
Jan Tschada
Log In to Rate API
Rating: 4 - Votes: 1