/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * `nl-kadaster`: the INSPIRE Addresses theme Kadaster publishes, read from its national GML. * * Kadaster serves the whole country in one file. The ATOM service document at * `https://service.pdok.nl/kadaster/ad/atom/adressen_inspire_geharmoniseerd.xml`, 2,247 bytes, holds * one entry, and its `rel="alternate"` link is * `https://service.pdok.nl/kadaster/ad/atom/downloads/addresses.gml.gz`, 819,465,603 bytes, which * inflates to 29,677,448,685 bytes of GML holding 10,066,060 address features. The sibling feed URL * the entry's own `` names answers HTTP 404, so the download link is the only live one. * * The size decides the shape of the reader. The document is never buffered: the adapter opens the * local `.gml.gz`, inflates it as a byte stream and takes one feature subtree at a time, and it keeps * a value rather than a subtree for each feature an address references, so the index it holds is * bounded by a string per street and per place name rather than by the document. * * Four things separate this publisher from the Czech one the shared primitives were first written * against, and each was measured over a 40,000,000-byte ranged prefix of the download, read in one * streaming pass: * * 1. The wrapper is `gml:FeatureCollection` with `gml:featureMember`, where ČÚZK writes * `base:SpatialDataSet` with `base:member`. * 2. Every `ad:component` reference is a local `#` fragment naming a `gml:id` in the same document, * and 0 of them went unresolved. * 3. The postcode is inline. The prefix holds 0 `ad:PostalDescriptor` features, and the postcode * arrives as a locator designator typed `postalDeliveryIdentifier`. Its element is present on all * 40,000 addresses read in the final pass and empty on 1,769 of them, so an address with no * postcode is ordinary here and the publisher's own rendering agrees: Kadaster's Locatieserver * writes `De Paasweide 72g-11, Appingedam` for one of them, with no postcode. * 4. The number is typed `addressNumber`, and two further types hold the rest of it. * * The number is assembled from three designators, and Kadaster's own rendering of the same records * fixes how. BAG's `huis_nlt` is the house number as Kadaster writes it, and the Locatieserver serves * it beside the `nummeraanduiding` id that this theme's `base:localId` repeats. Three records of the * fixture, matched by that id: * * | `gml:id` | `addressNumber` | `addressNumberExtension` | `addressNumber2ndExtension` | `huis_nlt` | * | --- | --- | --- | --- | --- | * | `…address.0003200000140702` | `72` | `g` | `11` | `72g-11` | * | `…address.0003200000134065` | `10` | (empty) | `I` | `10-I` | * | `…address.0003200000134593` | `4` | (empty) | `01` | `4-01` | * * So the extension joins the number with no separator and the second extension follows a hyphen. * 305,542 of 345,309 addresses in the prefix write an `addressNumberExtension` that is present and * empty, spelled ``. That states an address with no extension, which is a different * condition from void. * * The place name comes from `ad:AddressAreaName`, the BAG *woonplaats*. The prefix holds exactly one * `ad:AdminUnitName` feature and it is the country, `Nederland` at `1stOrder`, so this feed publishes * no municipality name and the woonplaats is the finest place name available. An address references * that country feature, so the adapter indexes the type and reads no place name from it. * * One published defect shapes what the adapter refuses to do. `ad:situatedWithin` on an * `ad:ThoroughfareName` writes its target with a hyphen where every `gml:id` uses a dot: * `#nl-imbag-ad-addressareaname-3386` against `gml:id="nl-imbag-ad-addressareaname.1000"`. Measured * over a 5,000,000-character window, 479 local fragments resolved to no feature, all of that shape, * against 2,622 dot-form ids and 0 hyphen-form ids. The same element on an `ad:AddressAreaName` uses * the dot form and resolves. A reader walking `ThoroughfareName → situatedWithin → AddressAreaName` * would therefore read an empty locality for every street and report no failure. So the adapter reads * the street and the place from the address's own `ad:component` references, which use the dot form, * and never follows `ad:situatedWithin`. Every reference it does follow raises when it resolves to no * feature, so the hyphen form reaching an `ad:component` would be reported rather than dropped. * * Unlike Czechia, this publisher offers no string to check a whole rendered line against. * `ad:alternativeIdentifier` is void on every address. The Locatieserver's `weergavenaam` is the * nearest equivalent, and `adapter.test.ts` pins the twelve fixture rows against it. * * Kadaster states one license and states it as a URL. Both `rights` elements of the ATOM service * document read `https://creativecommons.org/publicdomain/zero/1.0/deed.nl`, the Dutch deed page for * CC0 1.0 Universal, which the address-source register elected with `spdx` `CC0-1.0`. CC0 reserves no * act, so every row records that identifier and no attribution clause is owed, although crediting * Kadaster stays good practice. * * The adapter honors `opts.limit` and `opts.signal`. `opts.country` is optional and accepts only `NL`. */ import { type CorpusAdapter } from "#types"; /** * Registry id for this adapter. * * Stamped into every row it emits, so a corpus record can be traced back to the dataset it came from. */ export declare const NL_KADASTER_ADAPTER_ID = "nl-kadaster"; /** * The publication this adapter reads. * * The literal stands in for a `SourceRegister` member until `lib/registers.ts` declares * `KadasterInspireAddresses: "nl-kadaster-inspire-ad"`, which is the id this value spells. */ export declare const NL_KADASTER_REGISTER: "nl-kadaster-inspire-ad"; /** * The one jurisdiction this adapter emits. * * The download covers the Netherlands in Europe. * The Caribbean parts of the Kingdom keep their own cadastres. * * Those cadastres publish no INSPIRE Addresses theme, so the set has one member. */ export declare const NL_KADASTER_COUNTRIES: readonly string[]; /** * The license the address-source register elected for this publisher. * * `unchecked-access-free-nl-kadaster` is elected with `electedTerms` * `Creative Commons CC0 1.0 Universal Public Domain Dedication` and `spdx` `CC0-1.0`, * read from the two `rights` elements of the ATOM service document. */ export declare const NL_KADASTER_DEFAULT_LICENSE = "CC0-1.0"; /** * The house number as Kadaster writes it in BAG's `huis_nlt`. * * The letter joins the number directly and the addition follows a hyphen, * which the table in this module's header reads off three records matched against * the Locatieserver by their `nummeraanduiding` id. * * @returns The joined number, or undefined when the publisher states no `addressNumber`. */ export declare function dutchHouseNumber(byType: ReadonlyMap): string | undefined; export declare function createNLKadasterAdapter(): CorpusAdapter; /** * The configured adapter instance registered with the corpus builder. */ export declare const nlKadasterAdapter: CorpusAdapter; //# sourceMappingURL=adapter.d.ts.map