OffStreetParking (GeoJSON)
This example demonstrates how to transform a GeoJSON file containing Milan’s off-street parking facilities into FIWARE-compliant NGSI-LD entities. It showcases advanced template features for conditional logic and dynamic categorization.
Source Data
The source data follows GeoJSON FeatureCollection format with Point geometries. Properties include:
-
id — Unique identifier
-
nome — Parking facility name
-
n_posti — Total number of parking spaces
-
indirizzo — Street address
-
comune — Municipality
-
tipo — Parking type category (Italian codes)
Conditional Logic
The parking type (tipo) contains Italian codes that must be translated into standardized FIWARE categories. Use Tera conditional logic:
category: {
source: "{% if properties.tipo == 'RESIDENTI/PUBBLICI' or properties.tipo == 'PUBBLICI/RESIDENTI' %}publicPrivate{% elif properties.tipo == 'PUBBLICI' %}public{% elif properties.tipo == 'AUTORIMESSA CONVENZIONATA' %}onlyWithPermit{% endif %}",
type: "Property",
transformation: "array",
}
Static Array Values
Some attributes require predefined constant arrays:
allowedVehicleType: {
source: "car",
type: "Property",
transformation: "array",
},
occupancyDetectionType: {
source: ["none", "manual"],
type: "Property",
transformation: "array",
}