importer: a geonorge: provider — Geonorge's order→deliver download API (anonymous, no credential) #219

Open
opened 2026-08-24 17:05:51 +00:00 by art-bot · 0 comments
Collaborator

Norway (#210, #217) needs one piece of new importer code and only one: a fetcher for
Geonorge's order→deliver download API.

What the flow actually is — verified end to end 2026-08-24

It is Lantmäteriet's Geotorget shape without the OAuth. No account, no email, no token,
no API key:

GET  https://nedlasting.geonorge.no/api/capabilities/<uuid>
GET  https://nedlasting.geonorge.no/api/codelists/{area,format,projection}/<uuid>
POST https://nedlasting.geonorge.no/api/order      {metadataUuid, areas[], formats[], projections[]}
  → 200 {referenceNumber, files:[{name, status, downloadUrl}]}
GET  https://nedlasting.geonorge.no/api/order/<referenceNumber>     (poll)
GET  <downloadUrl>

A live order for N50 Kartdata (ea192681-d039-42ec-b1bc-f3ce04c189ac), area Fedje (4633),
format GML, projection 25833 returned referenceNumber 48142795-… with the file already
ReadyForDownload; the zip downloaded and unpacked into seven themed GML files. A second
order for Alvdal (3428) behaved identically.

Because there is no credential, this is not an R142 case — nothing goes in
conf/secrets.yaml. But it is also not a plain downloads: GET, because the fetch needs a
POST and a reference number. Hence a provider.

Notes for the implementation

  • landsdekkende exists: the N50 area codelist has 373 entries — 15 fylke,
    357 kommune and 1 landsdekkende, code 0000 "Hele landet". Order the country in
    one go; do not loop 357 municipalities.
  • Formats offered for N50: FGDB, GML, PostGIS, SOSI. Projections: EUREF89 UTM 32/33/35
    (EPSG:25833 is the sensible national default).
  • capabilities advertises supportsDownloadBundling, supportsPolygonSelection,
    supportsAreaSelection, deliveryNotificationByEmail: false.
  • R8 applies: short-circuit before ordering. If the target files are already on disk and
    complete, do not place an order at all.
  • R9 applies: the completion marker must encode what was ordered (uuid + area + format
    • projection), so widening the request invalidates it.
  • Unit-test the flow against a local httptest server, the way importer/clms.go's tests
    do — capabilities, codelists, order, the poll transition, and a terminal failure.
  • Wire it into appConfig, include.go, the import fetch phase, and both the fetch
    and list subcommands, and update docs/importer-cli.md's usage lines for both — the
    CLMS work missed the list half of that the first time.

The same provider covers every Kartverket dataset Norway needs: N50 Kartdata, NVDB Vegnett,
Stedsnavn (komplett SSR), Administrative enheter kommuner — all CC BY 4.0, all
GEONORGE:DOWNLOAD.

Norway (#210, #217) needs one piece of new importer code and only one: a fetcher for Geonorge's order→deliver download API. ## What the flow actually is — verified end to end 2026-08-24 It is Lantmäteriet's Geotorget shape **without the OAuth**. No account, no email, no token, no API key: ``` GET https://nedlasting.geonorge.no/api/capabilities/<uuid> GET https://nedlasting.geonorge.no/api/codelists/{area,format,projection}/<uuid> POST https://nedlasting.geonorge.no/api/order {metadataUuid, areas[], formats[], projections[]} → 200 {referenceNumber, files:[{name, status, downloadUrl}]} GET https://nedlasting.geonorge.no/api/order/<referenceNumber> (poll) GET <downloadUrl> ``` A live order for N50 Kartdata (`ea192681-d039-42ec-b1bc-f3ce04c189ac`), area Fedje (4633), format GML, projection 25833 returned `referenceNumber 48142795-…` with the file already `ReadyForDownload`; the zip downloaded and unpacked into seven themed GML files. A second order for Alvdal (3428) behaved identically. Because there is **no credential**, this is *not* an R142 case — nothing goes in `conf/secrets.yaml`. But it is also not a plain `downloads:` GET, because the fetch needs a POST and a reference number. Hence a provider. ## Notes for the implementation - **`landsdekkende` exists**: the N50 area codelist has 373 entries — 15 `fylke`, 357 `kommune` and **1 `landsdekkende`, code `0000` "Hele landet"**. Order the country in one go; do not loop 357 municipalities. - Formats offered for N50: FGDB, GML, PostGIS, SOSI. Projections: EUREF89 UTM 32/33/35 (**EPSG:25833** is the sensible national default). - `capabilities` advertises `supportsDownloadBundling`, `supportsPolygonSelection`, `supportsAreaSelection`, `deliveryNotificationByEmail: false`. - **R8 applies**: short-circuit before ordering. If the target files are already on disk and complete, do not place an order at all. - **R9 applies**: the completion marker must encode *what* was ordered (uuid + area + format + projection), so widening the request invalidates it. - Unit-test the flow against a local `httptest` server, the way `importer/clms.go`'s tests do — capabilities, codelists, order, the poll transition, and a terminal failure. - Wire it into `appConfig`, `include.go`, the import fetch phase, and **both** the `fetch` and `list` subcommands, and update `docs/importer-cli.md`'s usage lines for **both** — the CLMS work missed the `list` half of that the first time. The same provider covers every Kartverket dataset Norway needs: N50 Kartdata, NVDB Vegnett, Stedsnavn (komplett SSR), Administrative enheter kommuner — all CC BY 4.0, all `GEONORGE:DOWNLOAD`.
art-bot self-assigned this 2026-08-24 17:05:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
art/ismap#219
No description provided.