From e7264e89bce3b14f2f013376b0c1159b9b5fa634 Mon Sep 17 00:00:00 2001 From: Jo Date: Sun, 10 Dec 2023 12:00:18 +0000 Subject: [PATCH] Support jsonld for items with null geometry (#1423) * - added condition to avoid doing operations on the geometry, when the geometry is null (case of records) * - moving id out of the geometry condition * - removed commented line --------- Co-authored-by: doublebyte1 --- pygeoapi/linked_data.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pygeoapi/linked_data.py b/pygeoapi/linked_data.py index c502922..b79a72a 100644 --- a/pygeoapi/linked_data.py +++ b/pygeoapi/linked_data.py @@ -211,8 +211,10 @@ def geojson2jsonld(cls, data: dict, dataset: str, data.update(data.pop('properties')) # Include multiple geometry encodings - data['type'] = 'schema:Place' - jsonldify_geometry(data) + if (data.get('geometry') is not None): + data['type'] = 'schema:Place' + jsonldify_geometry(data) + data['@id'] = identifier else: