feat(server): ask the TREK services' Photon before Nominatim for search and reverse lookups

An installation that holds a key for the TREK services and has no
NOMINATIM_URL of its own now sends the OpenStreetMap search and the
reverse lookups to photon.liketrek.com first. The answers are read into
Nominatim's shape, so the place records stay the same, and every miss
(refused key, allowance spent, timeout, error, foreign body) falls back
to Nominatim, with a one minute pause after four misses in a row.

TREK_PHOTON_URL points at another copy, and the default of
TREK_SERVICES_HOSTS now lists photon.liketrek.com and
valhalla.liketrek.com beside places.liketrek.com.
This commit is contained in:
Maurice
2026-10-29 10:27:02 +01:00
committed by Maurice
parent 4ab3244f8f
commit 256f8c08e2
22 changed files with 1091 additions and 48 deletions
@@ -163,6 +163,14 @@ describe('the TREK services switches in the templates', () => {
expect(envExample).toContain('# TREK_SERVICES_HOSTS=');
});
it('every template names the Photon address and the default hosts it joined', () => {
expect(envExample).toContain('# TREK_PHOTON_URL=https://photon.liketrek.com ');
expect(compose).toContain('# - TREK_PHOTON_URL=https://photon.liketrek.com ');
expect(helmValues).toContain('# TREK_PHOTON_URL:');
expect(helmConfigMap).toContain('TREK_PHOTON_URL: {{ .Values.env.TREK_PHOTON_URL | quote }}');
expect(envExample).toContain('(default: places.liketrek.com,photon.liketrek.com,valhalla.liketrek.com)');
});
it('the Helm ConfigMap passes the switch and the hosts, the Secret carries the key', () => {
for (const name of ['TREK_SERVICES', 'TREK_SERVICES_HOSTS']) {
expect(helmValues).toContain(`# ${name}:`);
+20 -3
View File
@@ -249,6 +249,14 @@ describe('deriveIntegrations', () => {
expect(deriveIntegrations({ OVERPASS_TIMEOUT_MS: '-1' }).overpassTimeoutMs).toBe(OVERPASS_TIMEOUT_DEFAULT_MS);
});
it('says whether the operator set a Nominatim of their own, which keeps search off Photon', () => {
expect(deriveIntegrations({}).nominatimOwn).toBe(false);
expect(deriveIntegrations({ NOMINATIM_URL: ' ' }).nominatimOwn).toBe(false);
expect(deriveIntegrations({ NOMINATIM_URL: 'http://nominatim:8080' }).nominatimOwn).toBe(true);
// The public address spelled out is still a choice the operator made.
expect(deriveIntegrations({ NOMINATIM_URL: 'https://nominatim.openstreetmap.org' }).nominatimOwn).toBe(true);
});
it('floors the LLM ceiling to a whole number — undici rejects a fractional headersTimeout', () => {
expect(deriveIntegrations({}).llmTimeoutMs).toBe(900_000);
expect(deriveIntegrations({ LLM_TIMEOUT_MS: '-1' }).llmTimeoutMs).toBe(900_000);
@@ -298,13 +306,22 @@ describe('deriveServices (servicesConfig token)', () => {
expect(deriveServices({}).key).toBeNull();
});
it('sends the key to places.liketrek.com unless TREK_SERVICES_HOSTS names others', () => {
expect(deriveServices({}).hosts).toEqual(['places.liketrek.com']);
it('sends the key to the three liketrek services unless TREK_SERVICES_HOSTS names others', () => {
const all = ['places.liketrek.com', 'photon.liketrek.com', 'valhalla.liketrek.com'];
expect(deriveServices({}).hosts).toEqual(all);
expect(deriveServices({ TREK_SERVICES_HOSTS: 'Places.LikeTrek.com, , photon.liketrek.com' }).hosts).toEqual([
'places.liketrek.com',
'photon.liketrek.com',
]);
expect(deriveServices({ TREK_SERVICES_HOSTS: ' , ' }).hosts).toEqual(['places.liketrek.com']);
expect(deriveServices({ TREK_SERVICES_HOSTS: ' , ' }).hosts).toEqual(all);
});
it('asks photon.liketrek.com unless TREK_PHOTON_URL names another copy, trimmed and without trailing slashes', () => {
expect(deriveServices({}).photonUrl).toBe('https://photon.liketrek.com');
expect(deriveServices({ TREK_PHOTON_URL: ' ' }).photonUrl).toBe('https://photon.liketrek.com');
expect(deriveServices({ TREK_PHOTON_URL: ' https://geo.example.org/photon// ' }).photonUrl).toBe(
'https://geo.example.org/photon',
);
});
});
+2 -1
View File
@@ -8,6 +8,7 @@
import { toWikiLang, haversineMetres, namesOverlap } from '../../../src/nest/maps/maps.helpers';
import { OsmClient } from '../../../src/nest/maps/providers/osm.client';
import { WikimediaClient } from '../../../src/nest/maps/providers/wikimedia.client';
import { photonOff } from '../../helpers/photon';
import { describe, it, expect, vi, afterEach } from 'vitest';
@@ -22,7 +23,7 @@ vi.mock('../../../src/utils/ssrfGuard', () => ({
}));
const wikiOf = () => new WikimediaClient();
const osmOf = () => new OsmClient();
const osmOf = () => new OsmClient(photonOff());
// The Brandenburg Gate and the underground station named after it, 250m apart.
const GATE = { lat: 52.5163, lng: 13.3777 };
@@ -6,10 +6,11 @@
* had there.
*/
import { OsmClient } from '../../../src/nest/maps/providers/osm.client';
import { photonOff } from '../../helpers/photon';
import { describe, it, expect, vi, afterEach } from 'vitest';
const osm = new OsmClient();
const osm = new OsmClient(photonOff());
afterEach(() => {
vi.unstubAllGlobals();
+150
View File
@@ -0,0 +1,150 @@
/**
* OSM-PHOTON-001..009: the OpenStreetMap search and reverse lookup ask Photon
* first where the installation holds a key, answer in the shape Nominatim's
* answers always had, and fall back to Nominatim whenever Photon gives none.
* Lookups by id stay on Nominatim. The network is a stubbed global fetch
* routed by host.
*/
import { deriveServices } from '../../../src/app-config/boot-derive';
import { OsmClient } from '../../../src/nest/maps/providers/osm.client';
import { PhotonClient } from '../../../src/nest/maps/providers/photon.client';
import { serviceIdentitySlot } from '../../../src/nest/service-identity/service-identity.interface';
import { FakeServiceIdentity, gateFeature, photonAnswer } from '../../helpers/photon';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
const NOMINATIM_GATE = {
osm_type: 'way',
osm_id: '518071791',
class: 'tourism',
type: 'attraction',
name: 'Brandenburger Tor',
display_name: 'Brandenburger Tor, Pariser Platz, Mitte, Berlin, 10117, Deutschland',
lat: '52.5163',
lon: '13.3777',
extratags: { wikidata: 'Q82425', wikipedia: 'de:Brandenburger Tor' },
};
const NOMINATIM_REVERSE = {
display_name: 'Unter den Linden 77, Mitte, Berlin, Deutschland',
name: '',
address: { road: 'Unter den Linden', city: 'Berlin' },
};
let identity: FakeServiceIdentity;
let photonReply: () => Response;
let osm: OsmClient;
const hosts: string[] = [];
beforeEach(() => {
identity = new FakeServiceIdentity();
serviceIdentitySlot.install(identity);
photonReply = () => photonAnswer([gateFeature()]);
hosts.length = 0;
vi.stubEnv('NOMINATIM_URL', '');
vi.stubGlobal(
'fetch',
vi.fn(async (input: string | URL) => {
const url = new URL(String(input));
hosts.push(url.hostname);
if (url.hostname === 'photon.liketrek.com') return photonReply();
const body = url.pathname.endsWith('/reverse') ? NOMINATIM_REVERSE : [NOMINATIM_GATE];
return new Response(JSON.stringify(body), { status: 200, headers: { 'content-type': 'application/json' } });
}),
);
osm = new OsmClient(new PhotonClient(deriveServices({})));
});
afterEach(() => {
serviceIdentitySlot.release(identity);
vi.unstubAllGlobals();
vi.unstubAllEnvs();
});
describe('search', () => {
it('OSM-PHOTON-001: answers from Photon in the record a Nominatim hit gives, and leaves Nominatim alone', async () => {
const fromPhoton = await osm.searchNominatim('Brandenburger Tor', 'de');
expect(hosts).toEqual(['photon.liketrek.com']);
identity.bearer = null;
const fromNominatim = await osm.searchNominatim('Brandenburger Tor', 'de');
expect(hosts).toEqual(['photon.liketrek.com', 'nominatim.openstreetmap.org']);
expect(fromPhoton).toEqual(fromNominatim);
expect(fromPhoton[0]).toMatchObject({
osm_id: 'way:518071791',
name: 'Brandenburger Tor',
lat: 52.5163,
lng: 13.3777,
category: 'attraction',
source: 'openstreetmap',
wikidata: 'Q82425',
});
});
it('OSM-PHOTON-002: asks Nominatim when Photon fails, with the bias it would have had', async () => {
photonReply = () => photonAnswer([], 503);
const places = await osm.searchNominatim('Brandenburger Tor', 'de', 'interactive', { lat: 52.5, lng: 13.4 });
expect(hosts).toEqual(['photon.liketrek.com', 'nominatim.openstreetmap.org']);
expect(places[0]).toMatchObject({ osm_id: 'way:518071791' });
});
it('OSM-PHOTON-003: leaves out a Photon hit without an OpenStreetMap id', async () => {
photonReply = () => photonAnswer([gateFeature({ osm_type: undefined }), gateFeature({ osm_id: 7, osm_type: 'N' })]);
const places = await osm.searchNominatim('Brandenburger Tor');
expect(places.map((p) => p.osm_id)).toEqual(['node:7']);
});
it('OSM-PHOTON-004: the suggestions of a keyless install come out of Photon too', async () => {
const { suggestions } = await osm.autocompleteNominatim('Brandenb', 'de');
expect(hosts).toEqual(['photon.liketrek.com']);
expect(suggestions).toEqual([
{
placeId: 'way:518071791',
mainText: 'Brandenburger Tor',
secondaryText: 'Pariser Platz, Mitte, Berlin, 10117, Deutschland',
},
]);
});
});
describe('reverse', () => {
it('OSM-PHOTON-005: names a point from Photon, the sight before its street', async () => {
expect(await osm.reverse('52.5163', '13.3777', 'de')).toEqual({
name: 'Brandenburger Tor',
address: 'Brandenburger Tor, Pariser Platz, Mitte, Berlin, 10117, Deutschland',
});
expect(hosts).toEqual(['photon.liketrek.com']);
});
it('OSM-PHOTON-006: names the town for a locality', async () => {
expect((await osm.reverse('52.5163', '13.3777', 'de', { locality: true })).name).toBe('Berlin');
});
it('OSM-PHOTON-007: asks Nominatim when Photon fails or finds nothing there', async () => {
photonReply = () => photonAnswer([], 429);
expect(await osm.reverse('52.5', '13.4', 'de')).toEqual({
name: 'Unter den Linden',
address: 'Unter den Linden 77, Mitte, Berlin, Deutschland',
});
photonReply = () => photonAnswer([]);
expect((await osm.reverse('52.5', '13.4', 'de')).name).toBe('Unter den Linden');
expect(hosts).toEqual([
'photon.liketrek.com',
'nominatim.openstreetmap.org',
'photon.liketrek.com',
'nominatim.openstreetmap.org',
]);
});
it('OSM-PHOTON-008: the raw answer for a pasted link comes from Photon, else from Nominatim', async () => {
expect((await osm.reverseRaw(52.5163, 13.3777)).address?.tourism).toBe('Brandenburger Tor');
photonReply = () => photonAnswer([], 500);
expect(await osm.reverseRaw(52.5, 13.4)).toEqual(NOMINATIM_REVERSE);
});
});
it('OSM-PHOTON-009: a lookup by id stays on Nominatim', async () => {
await osm.lookupNominatim('way', '518071791', 'de');
expect(hosts).toEqual(['nominatim.openstreetmap.org']);
});
@@ -16,6 +16,7 @@ import {
OsmClient,
OverpassCoolingDown,
} from '../../../src/nest/maps/providers/osm.client';
import { photonOff } from '../../helpers/photon';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
@@ -61,7 +62,7 @@ const queryOf = (call: unknown[] | undefined) =>
decodeURIComponent(String((call?.[1] as RequestInit | undefined)?.body ?? '')).replace(/^data=/, '');
beforeEach(() => {
osm = new OsmClient();
osm = new OsmClient(photonOff());
logWarn.mockClear();
vi.spyOn(console, 'error').mockImplementation(() => {});
});
@@ -0,0 +1,164 @@
/**
* PHOTON-001..014: when Photon is asked, what it is asked, and every way it
* hands the question back to Nominatim. The network is a stubbed global fetch,
* the installation identity a fake in the slot the service-identity module fills.
*/
import { deriveServices } from '../../../src/app-config/boot-derive';
import { PhotonClient } from '../../../src/nest/maps/providers/photon.client';
import { serviceIdentitySlot } from '../../../src/nest/service-identity/service-identity.interface';
import { FakeServiceIdentity, gateFeature, photonAnswer } from '../../helpers/photon';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
let identity: FakeServiceIdentity;
let fetchMock: ReturnType<typeof vi.fn>;
const client = (env: Record<string, string> = {}) => new PhotonClient(deriveServices(env));
/** The URL and headers of the n-th request that went out. */
function request(n = 0): { url: URL; headers: Record<string, string> } {
const [url, init] = fetchMock.mock.calls[n] as [URL, RequestInit & { headers: Record<string, string> }];
return { url: new URL(String(url)), headers: init.headers };
}
beforeEach(() => {
identity = new FakeServiceIdentity();
serviceIdentitySlot.install(identity);
fetchMock = vi.fn(async () => photonAnswer([gateFeature()]));
vi.stubGlobal('fetch', fetchMock);
vi.stubEnv('NOMINATIM_URL', '');
});
afterEach(() => {
serviceIdentitySlot.release(identity);
vi.unstubAllGlobals();
vi.unstubAllEnvs();
vi.useRealTimers();
});
describe('which installations ask Photon', () => {
it('PHOTON-001: one with a key for the TREK services, at photon.liketrek.com with the key', async () => {
const found = await client().search('Brandenburger Tor', { lang: 'de' });
expect(found).toHaveLength(1);
const { url, headers } = request();
expect(`${url.origin}${url.pathname}`).toBe('https://photon.liketrek.com/api');
expect(headers.Authorization).toBe('Bearer tk1.kid.payload.signature');
expect(headers['User-Agent']).toBe('TREK/test');
expect(identity.observed).toEqual([{ host: 'photon.liketrek.com', status: 200 }]);
});
it('PHOTON-002: none without a key, since Photon has no shared pool', async () => {
identity.bearer = null;
expect(await client().search('Brandenburger Tor')).toBeNull();
expect(await client().reverse(52.5, 13.4)).toBeNull();
expect(fetchMock).not.toHaveBeenCalled();
});
it('PHOTON-003: none with the TREK services off', async () => {
expect(await client({ TREK_SERVICES: 'off' }).search('Brandenburger Tor')).toBeNull();
expect(fetchMock).not.toHaveBeenCalled();
});
it('PHOTON-004: none beside a Nominatim the operator runs, which keeps answering', async () => {
vi.stubEnv('NOMINATIM_URL', 'http://nominatim:8080');
expect(await client().search('Brandenburger Tor')).toBeNull();
expect(await client().reverse(52.5, 13.4)).toBeNull();
expect(fetchMock).not.toHaveBeenCalled();
});
it('PHOTON-005: one pointed at another copy by TREK_PHOTON_URL', async () => {
await client({ TREK_PHOTON_URL: 'https://geo.example.org/photon/' }).search('Rostock');
const { url } = request();
expect(`${url.origin}${url.pathname}`).toBe('https://geo.example.org/photon/api');
});
});
describe('what Photon is asked', () => {
it('PHOTON-006: a search carries the query, the limit, the language and the bias', async () => {
await client().search('Hase-dera', { lang: 'br', bias: { lat: 35.31, lng: 139.53 } });
const { searchParams } = request().url;
expect(Object.fromEntries(searchParams)).toEqual({
q: 'Hase-dera',
limit: '10',
lang: 'pt',
lat: '35.31',
lon: '139.53',
zoom: '10',
});
});
it('PHOTON-007: a search without a bias carries none, and one without a language the names on the spot', async () => {
await client().search('Rostock');
const { searchParams } = request().url;
expect(searchParams.has('lat')).toBe(false);
expect(searchParams.get('lang')).toBe('default');
});
it('PHOTON-008: a reverse lookup asks /reverse for the nearest feature', async () => {
await client().reverse(52.5163, 13.3777, 'gr');
const { url } = request();
expect(url.pathname).toBe('/reverse');
expect(Object.fromEntries(url.searchParams)).toEqual({ lat: '52.5163', lon: '13.3777', limit: '1', lang: 'el' });
});
it('PHOTON-009: a point that is not one is not sent', async () => {
expect(await client().reverse(Number.NaN, 13.4)).toBeNull();
expect(fetchMock).not.toHaveBeenCalled();
});
});
describe('when Nominatim has to answer instead', () => {
it.each([401, 403, 429, 500, 503])('PHOTON-010: an answer of %i', async (status) => {
fetchMock.mockResolvedValueOnce(photonAnswer([], status));
expect(await client().search('Rostock')).toBeNull();
expect(identity.observed).toEqual([{ host: 'photon.liketrek.com', status }]);
});
it('PHOTON-011: no answer at all, or none in time', async () => {
fetchMock.mockRejectedValueOnce(new TypeError('fetch failed'));
expect(await client().search('Rostock')).toBeNull();
fetchMock.mockRejectedValueOnce(new DOMException('The operation was aborted due to timeout', 'TimeoutError'));
expect(await client().search('Rostock')).toBeNull();
});
it("PHOTON-012: an answer that is not Photon's, or one far too long", async () => {
fetchMock.mockResolvedValueOnce(new Response('{"results":[]}', { status: 200 }));
expect(await client().search('Rostock')).toBeNull();
fetchMock.mockResolvedValueOnce(new Response('<html>', { status: 200 }));
expect(await client().search('Rostock')).toBeNull();
fetchMock.mockResolvedValueOnce(photonAnswer([gateFeature({ name: 'x'.repeat(600_000) })]));
expect(await client().search('Rostock')).toBeNull();
});
it('PHOTON-013: an empty answer is an answer, not a miss', async () => {
fetchMock.mockResolvedValueOnce(photonAnswer([]));
expect(await client().search('Qwxzv')).toEqual([]);
});
});
describe('the pause after misses in a row', () => {
it('PHOTON-014: four misses stop the asking for a minute, then one try goes out, and an answer resets it', async () => {
vi.useFakeTimers({ toFake: ['Date'] });
vi.setSystemTime(new Date('2026-10-29T10:00:00Z'));
const photon = client();
fetchMock.mockImplementation(async () => photonAnswer([], 503));
for (let i = 0; i < 4; i++) expect(await photon.search('Rostock')).toBeNull();
expect(fetchMock).toHaveBeenCalledTimes(4);
expect(await photon.search('Rostock')).toBeNull();
expect(fetchMock).toHaveBeenCalledTimes(4);
vi.setSystemTime(new Date('2026-10-29T10:01:01Z'));
expect(await photon.search('Rostock')).toBeNull();
expect(fetchMock).toHaveBeenCalledTimes(5);
expect(await photon.search('Rostock')).toBeNull();
expect(fetchMock).toHaveBeenCalledTimes(5);
vi.setSystemTime(new Date('2026-10-29T10:02:02Z'));
fetchMock.mockImplementation(async () => photonAnswer([gateFeature()]));
expect(await photon.search('Rostock')).toHaveLength(1);
fetchMock.mockImplementation(async () => photonAnswer([], 503));
for (let i = 0; i < 3; i++) expect(await photon.search('Rostock')).toBeNull();
expect(fetchMock).toHaveBeenCalledTimes(9);
});
});
@@ -0,0 +1,118 @@
/**
* PHOTON-MAP-001..012: Photon's answers read into the shape Nominatim gives,
* and the language Photon is asked in.
*/
import {
asNominatimHit,
asNominatimReverse,
photonAnswerSchema,
photonDisplayName,
photonLang,
type PhotonFeature,
} from '../../../src/nest/maps/providers/photon.mapping';
import { gateFeature } from '../../helpers/photon';
import { describe, expect, it } from 'vitest';
const feature = (properties: Record<string, unknown> = {}): PhotonFeature =>
photonAnswerSchema.parse({ features: [gateFeature(properties)] }).features[0];
describe('photonLang', () => {
it('PHOTON-MAP-001: asks in the languages the import holds names for', () => {
expect(photonLang('de')).toBe('de');
expect(photonLang('en')).toBe('en');
expect(photonLang('ja')).toBe('ja');
});
it("PHOTON-MAP-002: reads TREK's own codes through toApiLang first", () => {
expect(photonLang('br')).toBe('pt');
expect(photonLang('gr')).toBe('el');
});
it('PHOTON-MAP-003: drops the region, whatever its case', () => {
expect(photonLang('pt-BR')).toBe('pt');
expect(photonLang('zh-TW')).toBe('zh');
expect(photonLang('EN-gb')).toBe('en');
});
it('PHOTON-MAP-004: asks for the names on the spot in a language without names, and without one', () => {
expect(photonLang('eo')).toBe('default');
expect(photonLang('xx-YY')).toBe('default');
expect(photonLang(undefined)).toBe('default');
expect(photonLang(' ')).toBe('default');
});
});
describe('photonDisplayName', () => {
it('PHOTON-MAP-005: names the place, then the street, quarter, town, region, postcode and country', () => {
expect(photonDisplayName(feature({ housenumber: '1' }).properties)).toBe(
'Brandenburger Tor, Pariser Platz 1, Mitte, Berlin, 10117, Deutschland',
);
});
it('PHOTON-MAP-006: leaves out what is missing and what repeats', () => {
const city = feature({ name: 'Berlin', street: undefined, district: undefined, postcode: undefined, type: 'city' });
expect(photonDisplayName(city.properties)).toBe('Berlin, Deutschland');
});
});
describe('asNominatimHit', () => {
it('PHOTON-MAP-007: spells the hit the way a Nominatim search row is spelt', () => {
expect(asNominatimHit(feature())).toEqual({
osm_type: 'way',
osm_id: '518071791',
class: 'tourism',
type: 'attraction',
name: 'Brandenburger Tor',
display_name: 'Brandenburger Tor, Pariser Platz, Mitte, Berlin, 10117, Deutschland',
lat: '52.5163',
lon: '13.3777',
extratags: { wikidata: 'Q82425', wikipedia: 'de:Brandenburger Tor' },
});
});
it('PHOTON-MAP-008: names nodes and relations in full, and keeps only text tags', () => {
expect(asNominatimHit(feature({ osm_type: 'N' }))?.osm_type).toBe('node');
expect(asNominatimHit(feature({ osm_type: 'R' }))?.osm_type).toBe('relation');
expect(asNominatimHit(feature({ extra: { wikidata: 'Q1', capacity: 12 } }))?.extratags).toEqual({ wikidata: 'Q1' });
expect(asNominatimHit(feature({ extra: undefined }))?.extratags).toBeNull();
});
it('PHOTON-MAP-009: has nothing for a hit without an OpenStreetMap id', () => {
expect(asNominatimHit(feature({ osm_type: undefined }))).toBeNull();
expect(asNominatimHit(feature({ osm_type: 'X' }))).toBeNull();
expect(asNominatimHit(feature({ osm_id: undefined }))).toBeNull();
});
});
describe('asNominatimReverse', () => {
it('PHOTON-MAP-010: fills the address fields Nominatim fills, the sight under its main tag', () => {
expect(asNominatimReverse(feature({ housenumber: '1' }))).toEqual({
display_name: 'Brandenburger Tor, Pariser Platz 1, Mitte, Berlin, 10117, Deutschland',
name: 'Brandenburger Tor',
address: {
road: 'Pariser Platz',
house_number: '1',
postcode: '10117',
suburb: 'Mitte',
city: 'Berlin',
state: 'Berlin',
country: 'Deutschland',
country_code: 'de',
tourism: 'Brandenburger Tor',
},
});
});
it('PHOTON-MAP-011: makes a town its own city and files nothing more under its tag', () => {
const town = feature({ name: 'Warnemünde', type: 'city', osm_key: 'place', city: undefined, street: undefined });
const reverse = asNominatimReverse(town);
expect(reverse.address?.city).toBe('Warnemünde');
expect(reverse.address).not.toHaveProperty('place');
});
it('PHOTON-MAP-012: a feature with nothing to name has no display name', () => {
const bare = photonAnswerSchema.parse({ features: [{ geometry: { coordinates: [0, 0] }, properties: {} }] });
expect(asNominatimReverse(bare.features[0])).toEqual({ display_name: undefined, name: undefined, address: {} });
});
});