@mailwoman/nominatim 11.2.0 → 11.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/geocoder.ts +58 -0
- package/cli/main.ts +12 -34
- package/lib/engine.ts +4 -4
- package/lib/schema.ts +1 -1
- package/out/cli/geocoder.d.ts +27 -0
- package/out/cli/geocoder.d.ts.map +1 -0
- package/out/cli/geocoder.js +32 -0
- package/out/cli/geocoder.js.map +1 -0
- package/out/cli/main.js +12 -32
- package/out/cli/main.js.map +1 -1
- package/out/engine.d.ts +4 -4
- package/out/schema.js +1 -1
- package/out/tools/capture-search-golden.run.js +2 -2
- package/out/tools/capture-search-golden.run.js.map +1 -1
- package/package.json +15 -16
- package/tools/capture-search-golden.run.ts +2 -2
package/cli/geocoder.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The forward geocoder behind `mailwoman-nominatim serve`: the data layers the
|
|
6
|
+
* server composes, and the geocode of one query through its session.
|
|
7
|
+
*
|
|
8
|
+
* The module is separate from `main.ts` because that file runs the command line when it loads.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { GeocodeResult } from "@mailwoman/core/geocode"
|
|
12
|
+
import { type DropInGeocoder, openDropInGeocoder } from "mailwoman/cli/kit/dropin"
|
|
13
|
+
import type { LayerContribution } from "mailwoman/geocode/layers/contributions"
|
|
14
|
+
import { banLayer, forkEntityProbe, observationRoutes, osmLayer, regionDatabases } from "mailwoman/services/entry/node"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The data layers Nominatim composes.
|
|
18
|
+
*
|
|
19
|
+
* The server consults the national open register (BAN) and then the OpenStreetMap tier.
|
|
20
|
+
* It leaves national Overture out.
|
|
21
|
+
*
|
|
22
|
+
* That order is the one it had before the active selection existed.
|
|
23
|
+
*/
|
|
24
|
+
const NOMINATIM_LAYERS: readonly LayerContribution[] = [
|
|
25
|
+
banLayer,
|
|
26
|
+
osmLayer,
|
|
27
|
+
regionDatabases,
|
|
28
|
+
forkEntityProbe,
|
|
29
|
+
observationRoutes,
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* What `mailwoman-nominatim serve` opens to answer `/search`.
|
|
34
|
+
*/
|
|
35
|
+
export interface NominatimGeocoder extends DropInGeocoder {
|
|
36
|
+
/**
|
|
37
|
+
* Geocodes one query.
|
|
38
|
+
*
|
|
39
|
+
* @param country An ISO 3166-1 code the caller restricts the answer to,
|
|
40
|
+
* even to the point of zero results.
|
|
41
|
+
*/
|
|
42
|
+
geocode(query: string, country?: string): Promise<GeocodeResult>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Opens the gazetteer and the server's session, and ends the process when either is unavailable.
|
|
47
|
+
*
|
|
48
|
+
* @param candidateDBFlag The `--candidate-db` value, or `null` to read the conventional path.
|
|
49
|
+
*/
|
|
50
|
+
export async function openNominatimGeocoder(candidateDBFlag: string | null): Promise<NominatimGeocoder> {
|
|
51
|
+
const opened = await openDropInGeocoder(candidateDBFlag, NOMINATIM_LAYERS)
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
...opened,
|
|
55
|
+
geocode: async (query, country) =>
|
|
56
|
+
(await opened.session.geocode(query, country ? { defaultCountry: country } : {})).result,
|
|
57
|
+
}
|
|
58
|
+
}
|
package/cli/main.ts
CHANGED
|
@@ -19,7 +19,6 @@ import { dataRootPath } from "@mailwoman/core/data-root"
|
|
|
19
19
|
import { pathExists } from "@mailwoman/core/fs/readers/stat"
|
|
20
20
|
import { parseArguments } from "@mailwoman/core/scripting/arguments"
|
|
21
21
|
import { makeNUTSAnnotator, NUTSLookup } from "@mailwoman/nuts-lookup"
|
|
22
|
-
import { createWOFResolver } from "@mailwoman/resolver"
|
|
23
22
|
import { coordinateFormatAnnotator } from "@mailwoman/spatial"
|
|
24
23
|
import { makeTimezoneAnnotator, TimezoneLookup } from "@mailwoman/timezone-lookup"
|
|
25
24
|
import { timezoneDatabasePath } from "@mailwoman/timezone-lookup/paths"
|
|
@@ -29,17 +28,14 @@ import {
|
|
|
29
28
|
gazetteerBannerLines,
|
|
30
29
|
rightsBannerLines,
|
|
31
30
|
gazetteerFreshness,
|
|
32
|
-
loadClassifierOrExit,
|
|
33
31
|
openAPICommand,
|
|
34
|
-
|
|
32
|
+
readListenPort,
|
|
35
33
|
runDropInCLI,
|
|
36
34
|
} from "mailwoman/cli/kit/dropin"
|
|
37
35
|
import type { ResolvedEngineStamp } from "mailwoman/cli/kit/engine-stamp"
|
|
38
|
-
import { geocodeAddress, USStateDatabaseProvider } from "mailwoman/geocode"
|
|
39
|
-
import { openServingRooftopProviders } from "mailwoman/geocode/serving-layers"
|
|
40
|
-
import { createResolverBackend } from "mailwoman/resolver-backend"
|
|
41
36
|
import { resolvePath } from "path-ts"
|
|
42
37
|
|
|
38
|
+
import { openNominatimGeocoder } from "#cli/geocoder"
|
|
43
39
|
import { forwardToResolved } from "#forward-address"
|
|
44
40
|
import {
|
|
45
41
|
createNominatimApp,
|
|
@@ -87,7 +83,7 @@ async function serve(engineStamp: ResolvedEngineStamp): Promise<void> {
|
|
|
87
83
|
port: { type: "string", default: "8080" },
|
|
88
84
|
host: { type: "string", default: "0.0.0.0" },
|
|
89
85
|
"candidate-db": { type: "string" },
|
|
90
|
-
// Permissive
|
|
86
|
+
// Permissive CORS is on by default (browser geocoder clients need it).
|
|
91
87
|
// `--no-cors` turns it off for deployments where a reverse proxy already sets the headers.
|
|
92
88
|
cors: { type: "boolean", default: true },
|
|
93
89
|
},
|
|
@@ -95,23 +91,12 @@ async function serve(engineStamp: ResolvedEngineStamp): Promise<void> {
|
|
|
95
91
|
allowPositionals: true,
|
|
96
92
|
})
|
|
97
93
|
|
|
98
|
-
const port =
|
|
94
|
+
const port = readListenPort(values.port)
|
|
99
95
|
const host = values.host ?? "0.0.0.0"
|
|
100
96
|
|
|
101
|
-
const
|
|
102
|
-
const gazetteer = await
|
|
103
|
-
const { adminDBPath, candidateDB
|
|
104
|
-
const classifier = await loadClassifierOrExit()
|
|
105
|
-
|
|
106
|
-
const backend = await createResolverBackend(resolverMod, { wofPaths, candidateDB })
|
|
107
|
-
const resolver = createWOFResolver(backend)
|
|
108
|
-
const extracts = await USStateDatabaseProvider.create(resolverMod, dataRootPath())
|
|
109
|
-
// National open-register rooftop tier: BAN-FR ahead of the OSM tier for a non-US parse.
|
|
110
|
-
// A no-op when the extract isn't on disk, so the endpoint falls back to the OSM tier without an error.
|
|
111
|
-
// Both read one generation of the active selection, else their conventional paths.
|
|
112
|
-
const rooftops = await openServingRooftopProviders(dataRootPath())
|
|
113
|
-
const banExtracts = rooftops.national
|
|
114
|
-
const osmExtracts = rooftops.osm
|
|
97
|
+
const { WOFReverseGeocoder } = await import("@mailwoman/resolver-wof-sqlite")
|
|
98
|
+
const { gazetteer, geocode } = await openNominatimGeocoder(values["candidate-db"] ?? null)
|
|
99
|
+
const { adminDBPath, candidateDB } = gazetteer
|
|
115
100
|
// The annotation fallback adds no country constraint to the geocode.
|
|
116
101
|
// The default-on placer already routes the query's country.
|
|
117
102
|
// `defaultCountry` is a hard override that beats it, so forcing "US" would
|
|
@@ -121,7 +106,7 @@ async function serve(engineStamp: ResolvedEngineStamp): Promise<void> {
|
|
|
121
106
|
// US-centric data without a candidate DB omits it for US results, where "US" is
|
|
122
107
|
// the right guess, while non-US results include the country tag.
|
|
123
108
|
const annotationCountryFallback = candidateDB ? undefined : "US"
|
|
124
|
-
const reverseGeo = adminDBPath ? new
|
|
109
|
+
const reverseGeo = adminDBPath ? new WOFReverseGeocoder({ adminDBPath }) : null
|
|
125
110
|
const annotators = [coordinateFormatAnnotator, countryReferenceAnnotator]
|
|
126
111
|
const tzDBPath = timezoneDatabasePath("timezone.db")
|
|
127
112
|
|
|
@@ -144,7 +129,7 @@ async function serve(engineStamp: ResolvedEngineStamp): Promise<void> {
|
|
|
144
129
|
const annotate = composeAnnotators(annotators)
|
|
145
130
|
|
|
146
131
|
// Read once at boot from the artifacts themselves, so this describes what the
|
|
147
|
-
// endpoint serves
|
|
132
|
+
// endpoint serves for as long as it runs.
|
|
148
133
|
// Every artifact appears, including one carrying no manifest.
|
|
149
134
|
const status = nominatimStatus(await gazetteerFreshness(gazetteer))
|
|
150
135
|
|
|
@@ -160,14 +145,7 @@ async function serve(engineStamp: ResolvedEngineStamp): Promise<void> {
|
|
|
160
145
|
// For a list we apply the first, the common geopy case.
|
|
161
146
|
const userCountry = params.countrycodes?.[0]?.toUpperCase()
|
|
162
147
|
|
|
163
|
-
const result = await
|
|
164
|
-
classifier,
|
|
165
|
-
resolver,
|
|
166
|
-
databases: extracts.for,
|
|
167
|
-
nationalDatabases: banExtracts.for,
|
|
168
|
-
...(osmExtracts ? { osmDatabases: osmExtracts.for } : {}),
|
|
169
|
-
...(userCountry ? { defaultCountry: { country: userCountry, source: "caller" } } : {}),
|
|
170
|
-
})
|
|
148
|
+
const result = await geocode(query, userCountry)
|
|
171
149
|
|
|
172
150
|
if (result.lat == null || result.lon == null) return []
|
|
173
151
|
const resolved = forwardToResolved(result)
|
|
@@ -291,8 +269,8 @@ async function serve(engineStamp: ResolvedEngineStamp): Promise<void> {
|
|
|
291
269
|
fetch: app.fetch,
|
|
292
270
|
port,
|
|
293
271
|
hostname: host,
|
|
294
|
-
onListen: () => {
|
|
295
|
-
console.error(`[@mailwoman/nominatim] listening on http://${host}:${port}`)
|
|
272
|
+
onListen: (info) => {
|
|
273
|
+
console.error(`[@mailwoman/nominatim] listening on http://${host}:${info.port}`)
|
|
296
274
|
|
|
297
275
|
for (const line of gazetteerBannerLines(gazetteer)) {
|
|
298
276
|
console.error(line)
|
package/lib/engine.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The Nominatim engine interface
|
|
5
|
+
* The Nominatim engine interface and wire types that the router delegates to.
|
|
6
6
|
*
|
|
7
7
|
* The resolved-address → {@link NominatimResult} formatter
|
|
8
8
|
* (`toNominatimResult`, `toFeatureCollection`, `nominatimResultToSchemaOrg`) lives in `format.ts`.
|
|
@@ -68,7 +68,7 @@ export interface NominatimResult {
|
|
|
68
68
|
*/
|
|
69
69
|
export interface NominatimResultExtension {
|
|
70
70
|
/**
|
|
71
|
-
* The register row
|
|
71
|
+
* The register row that supplied the coordinate, with its provenance stamp verbatim.
|
|
72
72
|
*
|
|
73
73
|
* `openstreetmap:<cc>` names a row from an OpenStreetMap layer the operator built and attached.
|
|
74
74
|
*/
|
|
@@ -201,8 +201,8 @@ export interface NominatimStatus {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
|
-
* A freshness report as this surface consumes it, structurally `mailwoman/freshness`'s
|
|
205
|
-
* and declared here so the wire interface keeps no import from the engine implementation.
|
|
204
|
+
* A freshness report as this surface consumes it, structurally `mailwoman/diagnostics/freshness`'s
|
|
205
|
+
* `FreshnessReport` and declared here so the wire interface keeps no import from the engine implementation.
|
|
206
206
|
*/
|
|
207
207
|
export interface NominatimFreshnessReport {
|
|
208
208
|
dataUpdated: string | null
|
package/lib/schema.ts
CHANGED
|
@@ -34,7 +34,7 @@ export const NominatimAddressDetailsSchema = z
|
|
|
34
34
|
.openapi("NominatimAddressDetails")
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* The register row
|
|
37
|
+
* The register row that supplied a house-grade result's coordinate, under the result's `mailwoman` block.
|
|
38
38
|
*/
|
|
39
39
|
const NominatimCoordinateSourceSchema = z
|
|
40
40
|
.object({
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The forward geocoder behind `mailwoman-nominatim serve`: the data layers the
|
|
3
|
+
* server composes, and the geocode of one query through its session.
|
|
4
|
+
*
|
|
5
|
+
* The module is separate from `main.ts` because that file runs the command line when it loads.
|
|
6
|
+
*/
|
|
7
|
+
import type { GeocodeResult } from "@mailwoman/core/geocode";
|
|
8
|
+
import { type DropInGeocoder } from "mailwoman/cli/kit/dropin";
|
|
9
|
+
/**
|
|
10
|
+
* What `mailwoman-nominatim serve` opens to answer `/search`.
|
|
11
|
+
*/
|
|
12
|
+
export interface NominatimGeocoder extends DropInGeocoder {
|
|
13
|
+
/**
|
|
14
|
+
* Geocodes one query.
|
|
15
|
+
*
|
|
16
|
+
* @param country An ISO 3166-1 code the caller restricts the answer to,
|
|
17
|
+
* even to the point of zero results.
|
|
18
|
+
*/
|
|
19
|
+
geocode(query: string, country?: string): Promise<GeocodeResult>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Opens the gazetteer and the server's session, and ends the process when either is unavailable.
|
|
23
|
+
*
|
|
24
|
+
* @param candidateDBFlag The `--candidate-db` value, or `null` to read the conventional path.
|
|
25
|
+
*/
|
|
26
|
+
export declare function openNominatimGeocoder(candidateDBFlag: string | null): Promise<NominatimGeocoder>;
|
|
27
|
+
//# sourceMappingURL=geocoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geocoder.d.ts","sourceRoot":"","sources":["../../cli/geocoder.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,0BAA0B,CAAA;AAoBlF;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACxD;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;CAChE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAQtG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
import { openDropInGeocoder } from "mailwoman/cli/kit/dropin";
|
|
4
|
+
import { banLayer, forkEntityProbe, observationRoutes, osmLayer, regionDatabases } from "mailwoman/services/entry/node";
|
|
5
|
+
/**
|
|
6
|
+
* The data layers Nominatim composes.
|
|
7
|
+
*
|
|
8
|
+
* The server consults the national open register (BAN) and then the OpenStreetMap tier.
|
|
9
|
+
* It leaves national Overture out.
|
|
10
|
+
*
|
|
11
|
+
* That order is the one it had before the active selection existed.
|
|
12
|
+
*/
|
|
13
|
+
const NOMINATIM_LAYERS = [
|
|
14
|
+
banLayer,
|
|
15
|
+
osmLayer,
|
|
16
|
+
regionDatabases,
|
|
17
|
+
forkEntityProbe,
|
|
18
|
+
observationRoutes,
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Opens the gazetteer and the server's session, and ends the process when either is unavailable.
|
|
22
|
+
*
|
|
23
|
+
* @param candidateDBFlag The `--candidate-db` value, or `null` to read the conventional path.
|
|
24
|
+
*/
|
|
25
|
+
export async function openNominatimGeocoder(candidateDBFlag) {
|
|
26
|
+
const opened = await openDropInGeocoder(candidateDBFlag, NOMINATIM_LAYERS);
|
|
27
|
+
return {
|
|
28
|
+
...opened,
|
|
29
|
+
geocode: async (query, country) => (await opened.session.geocode(query, country ? { defaultCountry: country } : {})).result,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=geocoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geocoder.js","sourceRoot":"","sources":["../../cli/geocoder.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAUlE,OAAO,EAAuB,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAElF,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEvH;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAiC;IACtD,QAAQ;IACR,QAAQ;IACR,eAAe;IACf,eAAe;IACf,iBAAiB;CACjB,CAAA;AAeD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,eAA8B;IACzE,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAA;IAE1E,OAAO;QACN,GAAG,MAAM;QACT,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CACjC,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM;KACzF,CAAA;AACF,CAAC"}
|
package/out/cli/main.js
CHANGED
|
@@ -17,16 +17,13 @@ import { dataRootPath } from "@mailwoman/core/data-root";
|
|
|
17
17
|
import { pathExists } from "@mailwoman/core/fs/readers/stat";
|
|
18
18
|
import { parseArguments } from "@mailwoman/core/scripting/arguments";
|
|
19
19
|
import { makeNUTSAnnotator, NUTSLookup } from "@mailwoman/nuts-lookup";
|
|
20
|
-
import { createWOFResolver } from "@mailwoman/resolver";
|
|
21
20
|
import { coordinateFormatAnnotator } from "@mailwoman/spatial";
|
|
22
21
|
import { makeTimezoneAnnotator, TimezoneLookup } from "@mailwoman/timezone-lookup";
|
|
23
22
|
import { timezoneDatabasePath } from "@mailwoman/timezone-lookup/paths";
|
|
24
23
|
import { makeUNLocodeAnnotator, UNLocodeLookup } from "@mailwoman/un-locode-lookup";
|
|
25
|
-
import { corsBannerLine, gazetteerBannerLines, rightsBannerLines, gazetteerFreshness,
|
|
26
|
-
import { geocodeAddress, USStateDatabaseProvider } from "mailwoman/geocode";
|
|
27
|
-
import { openServingRooftopProviders } from "mailwoman/geocode/serving-layers";
|
|
28
|
-
import { createResolverBackend } from "mailwoman/resolver-backend";
|
|
24
|
+
import { corsBannerLine, gazetteerBannerLines, rightsBannerLines, gazetteerFreshness, openAPICommand, readListenPort, runDropInCLI, } from "mailwoman/cli/kit/dropin";
|
|
29
25
|
import { resolvePath } from "path-ts";
|
|
26
|
+
import { openNominatimGeocoder } from "#cli/geocoder";
|
|
30
27
|
import { forwardToResolved } from "#forward-address";
|
|
31
28
|
import { createNominatimApp, nominatimStatus, NOMINATIM_DOC_INFO, toNominatimResult, } from "#index";
|
|
32
29
|
/**
|
|
@@ -61,28 +58,18 @@ async function serve(engineStamp) {
|
|
|
61
58
|
port: { type: "string", default: "8080" },
|
|
62
59
|
host: { type: "string", default: "0.0.0.0" },
|
|
63
60
|
"candidate-db": { type: "string" },
|
|
64
|
-
// Permissive
|
|
61
|
+
// Permissive CORS is on by default (browser geocoder clients need it).
|
|
65
62
|
// `--no-cors` turns it off for deployments where a reverse proxy already sets the headers.
|
|
66
63
|
cors: { type: "boolean", default: true },
|
|
67
64
|
},
|
|
68
65
|
allowNegative: true,
|
|
69
66
|
allowPositionals: true,
|
|
70
67
|
});
|
|
71
|
-
const port =
|
|
68
|
+
const port = readListenPort(values.port);
|
|
72
69
|
const host = values.host ?? "0.0.0.0";
|
|
73
|
-
const
|
|
74
|
-
const gazetteer = await
|
|
75
|
-
const { adminDBPath, candidateDB
|
|
76
|
-
const classifier = await loadClassifierOrExit();
|
|
77
|
-
const backend = await createResolverBackend(resolverMod, { wofPaths, candidateDB });
|
|
78
|
-
const resolver = createWOFResolver(backend);
|
|
79
|
-
const extracts = await USStateDatabaseProvider.create(resolverMod, dataRootPath());
|
|
80
|
-
// National open-register rooftop tier: BAN-FR ahead of the OSM tier for a non-US parse.
|
|
81
|
-
// A no-op when the extract isn't on disk, so the endpoint falls back to the OSM tier without an error.
|
|
82
|
-
// Both read one generation of the active selection, else their conventional paths.
|
|
83
|
-
const rooftops = await openServingRooftopProviders(dataRootPath());
|
|
84
|
-
const banExtracts = rooftops.national;
|
|
85
|
-
const osmExtracts = rooftops.osm;
|
|
70
|
+
const { WOFReverseGeocoder } = await import("@mailwoman/resolver-wof-sqlite");
|
|
71
|
+
const { gazetteer, geocode } = await openNominatimGeocoder(values["candidate-db"] ?? null);
|
|
72
|
+
const { adminDBPath, candidateDB } = gazetteer;
|
|
86
73
|
// The annotation fallback adds no country constraint to the geocode.
|
|
87
74
|
// The default-on placer already routes the query's country.
|
|
88
75
|
// `defaultCountry` is a hard override that beats it, so forcing "US" would
|
|
@@ -92,7 +79,7 @@ async function serve(engineStamp) {
|
|
|
92
79
|
// US-centric data without a candidate DB omits it for US results, where "US" is
|
|
93
80
|
// the right guess, while non-US results include the country tag.
|
|
94
81
|
const annotationCountryFallback = candidateDB ? undefined : "US";
|
|
95
|
-
const reverseGeo = adminDBPath ? new
|
|
82
|
+
const reverseGeo = adminDBPath ? new WOFReverseGeocoder({ adminDBPath }) : null;
|
|
96
83
|
const annotators = [coordinateFormatAnnotator, countryReferenceAnnotator];
|
|
97
84
|
const tzDBPath = timezoneDatabasePath("timezone.db");
|
|
98
85
|
if (await pathExists(tzDBPath)) {
|
|
@@ -108,7 +95,7 @@ async function serve(engineStamp) {
|
|
|
108
95
|
}
|
|
109
96
|
const annotate = composeAnnotators(annotators);
|
|
110
97
|
// Read once at boot from the artifacts themselves, so this describes what the
|
|
111
|
-
// endpoint serves
|
|
98
|
+
// endpoint serves for as long as it runs.
|
|
112
99
|
// Every artifact appears, including one carrying no manifest.
|
|
113
100
|
const status = nominatimStatus(await gazetteerFreshness(gazetteer));
|
|
114
101
|
const engine = {
|
|
@@ -120,14 +107,7 @@ async function serve(engineStamp) {
|
|
|
120
107
|
// so it is honored as the country constraint even to the point of no result.
|
|
121
108
|
// For a list we apply the first, the common geopy case.
|
|
122
109
|
const userCountry = params.countrycodes?.[0]?.toUpperCase();
|
|
123
|
-
const result = await
|
|
124
|
-
classifier,
|
|
125
|
-
resolver,
|
|
126
|
-
databases: extracts.for,
|
|
127
|
-
nationalDatabases: banExtracts.for,
|
|
128
|
-
...(osmExtracts ? { osmDatabases: osmExtracts.for } : {}),
|
|
129
|
-
...(userCountry ? { defaultCountry: { country: userCountry, source: "caller" } } : {}),
|
|
130
|
-
});
|
|
110
|
+
const result = await geocode(query, userCountry);
|
|
131
111
|
if (result.lat == null || result.lon == null)
|
|
132
112
|
return [];
|
|
133
113
|
const resolved = forwardToResolved(result);
|
|
@@ -217,8 +197,8 @@ async function serve(engineStamp) {
|
|
|
217
197
|
fetch: app.fetch,
|
|
218
198
|
port,
|
|
219
199
|
hostname: host,
|
|
220
|
-
onListen: () => {
|
|
221
|
-
console.error(`[@mailwoman/nominatim] listening on http://${host}:${port}`);
|
|
200
|
+
onListen: (info) => {
|
|
201
|
+
console.error(`[@mailwoman/nominatim] listening on http://${host}:${info.port}`);
|
|
222
202
|
for (const line of gazetteerBannerLines(gazetteer)) {
|
|
223
203
|
console.error(line);
|
|
224
204
|
}
|
package/out/cli/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../cli/main.ts"],"names":[],"mappings":";AACA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AACpE,OAAO,EAAE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QACf,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,IAAI;QACJ,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;YAClB,OAAO,CAAC,KAAK,CAAC,8CAA8C,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;YAEhF,KAAK,MAAM,IAAI,IAAI,oBAAoB,CAAC,SAAS,CAAC,EAAE,CAAC;gBACpD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACpB,CAAC;YAED,qFAAqF;YACrF,wFAAwF;YACxF,KAAK,MAAM,IAAI,IAAI,iBAAiB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,SAAS,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;gBAC3G,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACpB,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;YAC1C,OAAO,CAAC,KAAK,CAAC,4FAA4F,CAAC,CAAA;QAC5G,CAAC;KACD,CAAC,CAAA;AACH,CAAC;AAED,MAAM,YAAY,CAAC;IAClB,UAAU,EAAE,WAAW;IACvB,OAAO,EAAE,cAAc,CAAC,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,EAAE,CAAC;IAChF,KAAK;IACL,KAAK,EAAE;QACN,4EAA4E;QAC5E,6CAA6C;KAC7C;CACD,CAAC,CAAA"}
|
package/out/engine.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Nominatim engine interface
|
|
2
|
+
* The Nominatim engine interface and wire types that the router delegates to.
|
|
3
3
|
*
|
|
4
4
|
* The resolved-address → {@link NominatimResult} formatter
|
|
5
5
|
* (`toNominatimResult`, `toFeatureCollection`, `nominatimResultToSchemaOrg`) lives in `format.ts`.
|
|
@@ -60,7 +60,7 @@ export interface NominatimResult {
|
|
|
60
60
|
*/
|
|
61
61
|
export interface NominatimResultExtension {
|
|
62
62
|
/**
|
|
63
|
-
* The register row
|
|
63
|
+
* The register row that supplied the coordinate, with its provenance stamp verbatim.
|
|
64
64
|
*
|
|
65
65
|
* `openstreetmap:<cc>` names a row from an OpenStreetMap layer the operator built and attached.
|
|
66
66
|
*/
|
|
@@ -185,8 +185,8 @@ export interface NominatimStatus {
|
|
|
185
185
|
mailwoman?: NominatimStatusExtension;
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
|
-
* A freshness report as this surface consumes it, structurally `mailwoman/freshness`'s
|
|
189
|
-
* and declared here so the wire interface keeps no import from the engine implementation.
|
|
188
|
+
* A freshness report as this surface consumes it, structurally `mailwoman/diagnostics/freshness`'s
|
|
189
|
+
* `FreshnessReport` and declared here so the wire interface keeps no import from the engine implementation.
|
|
190
190
|
*/
|
|
191
191
|
export interface NominatimFreshnessReport {
|
|
192
192
|
dataUpdated: string | null;
|
package/out/schema.js
CHANGED
|
@@ -30,7 +30,7 @@ export const NominatimAddressDetailsSchema = z
|
|
|
30
30
|
.loose()
|
|
31
31
|
.openapi("NominatimAddressDetails");
|
|
32
32
|
/**
|
|
33
|
-
* The register row
|
|
33
|
+
* The register row that supplied a house-grade result's coordinate, under the result's `mailwoman` block.
|
|
34
34
|
*/
|
|
35
35
|
const NominatimCoordinateSourceSchema = z
|
|
36
36
|
.object({
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* Run from the repo root after `yarn compile`: `node nominatim/dev-tools/capture-search-golden.run.ts`
|
|
12
12
|
*/
|
|
13
13
|
import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { spawnProcess } from "@mailwoman/core/scripting/process";
|
|
15
|
+
import { stringifyJSON } from "@mailwoman/core/values/json";
|
|
16
16
|
import { JSONSpliterator, TextSpliterator } from "spliterator";
|
|
17
17
|
const PORT = 8199;
|
|
18
18
|
const BASE = `http://127.0.0.1:${PORT}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-search-golden.run.js","sourceRoot":"","sources":["../../tools/capture-search-golden.run.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"capture-search-golden.run.js","sourceRoot":"","sources":["../../tools/capture-search-golden.run.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE9D,MAAM,IAAI,GAAG,IAAI,CAAA;AACjB,MAAM,IAAI,GAAG,oBAAoB,IAAI,EAAE,CAAA;AACvC,MAAM,WAAW,GAAG,wEAAwE,CAAA;AAC5F,MAAM,cAAc,GAAG,yEAAyE,CAAA;AAChG,MAAM,QAAQ,GAAG,sDAAsD,CAAA;AAOvE,mGAAmG;AACnG,MAAM,eAAe,GAAG,MAAM,eAAe,CAAC,SAAS,CAAY,WAAW,CAAC;KAC7E,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CACf,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,cAAc,IAAI,MAAM,CAAC,CACxG;KACA,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC;KACvB,IAAI,CAAC,GAAG,CAAC;KACT,OAAO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,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAA;IAChF,CAAC;IAED,MAAM,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAExC,OAAO,CAAC,KAAK,CACZ,YAAY,IAAI,CAAC,MAAM,uBAAuB,eAAe,CAAC,MAAM,uCAAuC,CAC3G,CAAA;AACF,CAAC;QAAS,CAAC;IACV,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/nominatim",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.0",
|
|
4
4
|
"description": "Nominatim drop-in — a Nominatim-compatible HTTP geocoding API (search / reverse / lookup / status) over the Mailwoman engine. Run it with `npx @mailwoman/nominatim serve`.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -108,22 +108,21 @@
|
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
110
|
"@hono/zod-openapi": "^1.6.3",
|
|
111
|
-
"@mailwoman/annotations": "11.
|
|
112
|
-
"@mailwoman/api-kit": "11.
|
|
113
|
-
"@mailwoman/codex": "11.
|
|
114
|
-
"@mailwoman/core": "11.
|
|
115
|
-
"@mailwoman/gazetteer": "11.
|
|
116
|
-
"@mailwoman/neural": "11.
|
|
117
|
-
"@mailwoman/neural-weights-en-us": "11.
|
|
118
|
-
"@mailwoman/nuts-lookup": "11.
|
|
119
|
-
"@mailwoman/resolver": "11.
|
|
120
|
-
"@mailwoman/
|
|
121
|
-
"@mailwoman/
|
|
122
|
-
"@mailwoman/
|
|
123
|
-
"@mailwoman/
|
|
124
|
-
"@mailwoman/un-locode-lookup": "11.2.0",
|
|
111
|
+
"@mailwoman/annotations": "11.4.0",
|
|
112
|
+
"@mailwoman/api-kit": "11.4.0",
|
|
113
|
+
"@mailwoman/codex": "11.4.0",
|
|
114
|
+
"@mailwoman/core": "11.4.0",
|
|
115
|
+
"@mailwoman/gazetteer": "11.4.0",
|
|
116
|
+
"@mailwoman/neural": "11.4.0",
|
|
117
|
+
"@mailwoman/neural-weights-en-us": "11.4.0",
|
|
118
|
+
"@mailwoman/nuts-lookup": "11.4.0",
|
|
119
|
+
"@mailwoman/resolver-wof-sqlite": "11.4.0",
|
|
120
|
+
"@mailwoman/spatial": "11.4.0",
|
|
121
|
+
"@mailwoman/sqlite": "11.4.0",
|
|
122
|
+
"@mailwoman/timezone-lookup": "11.4.0",
|
|
123
|
+
"@mailwoman/un-locode-lookup": "11.4.0",
|
|
125
124
|
"hono": "^4.13.14",
|
|
126
|
-
"mailwoman": "11.
|
|
125
|
+
"mailwoman": "11.4.0",
|
|
127
126
|
"path-ts": "^2.5.0",
|
|
128
127
|
"spliterator": "^10.1.1",
|
|
129
128
|
"zod": "^4.6.7"
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { writeLocalTextFile } from "@mailwoman/core/fs/writers"
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { spawnProcess } from "@mailwoman/core/scripting/process"
|
|
17
|
+
import { stringifyJSON } from "@mailwoman/core/values/json"
|
|
18
18
|
import { JSONSpliterator, TextSpliterator } from "spliterator"
|
|
19
19
|
|
|
20
20
|
const PORT = 8199
|