Kosznajderia · Business requirements

Handoff for continuing development — use case, goals and current context

Kosznajderia — Business requirements

Document purpose: a complete handoff for a human or another AI coding assistant (for example Claude) continuing development of the Kosznajderia web map. Status: proof of concept is live. A full-region painted watercolor basemap is not being implemented yet (decision of 27 November 2026). Date: 27 November 2026, Europe/Warsaw (CET). Live site: https://kosznajderia.commonplaceapp.workers.dev This file on the site: https://kosznajderia.commonplaceapp.workers.dev/business-requirements.md Readable page: https://kosznajderia.commonplaceapp.workers.dev/business-requirements/

Do not invent historical facts. If a date, population figure, name or boundary is not in the sources listed here or in villages.csv / heritage files, treat it as an open question.


1. Vision and use case

Kosznajderia (German: Koschneiderei) is an educational, board-game-like web map of a historical rural region in northern Poland (today the border of Pomorskie and Kujawsko-Pomorskie, around Chojnice, Tuchola and Kamień Krajeński). The educational time span in mind is roughly 1400–1945. The idea was inspired by Andrej Karpathy’s Civ-style map.

The product should feel more like a historic board or atlas you can explore than like a generic modern web map. The owner has said the current MapLibre map still lacks “soul”, and that a watercolor-on-parchment look is the direction he likes. That painted basemap is designed, sampled and estimated, but explicitly deferred.

Who it is for

What they do today

What they should be able to do later

The product is being built by WM in Poland, who also develops the Commonplace app. The working language of this document and of the code comments is English; the live app UI is Polish by default, with an English toggle.


2. Goals, success criteria, and non-goals

Goals

Success criteria (POC, current)

Non-goals for now

Principle: “keep it simple”

This is a standing preference from the owner. Prefer a small, clear change over a large framework. Do not add services (D1, auth, a new build tool) until a feature actually needs them. Do not invent historical content to fill gaps.


3. Region scope

The map covers the union of the 19 villages’ present-day cadastral precincts (obręby ewidencyjne), used as a convenient region proxy. This is not a historical boundary of Koschneiderei. A simple local-metre estimate of the current region_obreby.geojson is about 232 km². Earlier working notes used ~218 km². Treat the exact area as approximate until it is recomputed in a proper equal-area projection.

Showcase village: Ciechocin (German: Deutsch Cekzin). All close-zoom detail, the 3D building work, and the isometric paintings are centred here.

Nearby towns (shown for orientation, outside the region): Chojnice (Konitz), Tuchola (Tuchel), Kamień Krajeński (Kamin), Sępólno Krajeńskie (Zempelburg).

The 19 villages

Compiled in villages.csv from Rink 1932 (via Sadurska 2022), Polish and German Wikipedia, OSM Nominatim coordinates, and other sources cited in that file. Some rows are sparse. One identification (Dąbrówka, 1333 Cistercian exchange) is noted in the spreadsheet as not independently checked. Do not treat this table as independently verified history.

Polish nameGerman nameApprox. coordinatesFirst mention / founding (as recorded)Notes (as recorded)
OstrowiteOsterwick53.6327, 17.67131338, location as “Ostirwig”Informal capital (Sadurska; pl.wikipedia). Gmina Chojnice.
AngowiceHennigsdorf53.6557, 17.56191357, 48 łany, Chełmno law
CiechocinDeutsch Cekzin53.6132, 17.700917 Jan 1342, location charter issued in TucholaShowcase village. Early Teutonic Order village. Church of St Martin (Kościół pw. Świętego Marcina) is used in the app from OSM.
DąbrówkaDamerau53.5774, 17.62041333 (Cistercian exchange; identification not independently checked)Gmina Kamień Krajeński.
DoręgowiceDöringsdorf53.6268, 17.4900(not filled)Sparse facts in the spreadsheet.
Duża CerkwicaGroß Zirkwitz53.5319, 17.56411217; 1454 “Cerekwica privileges” associated with the village
GranowoGranau53.6601, 17.6482Before 1356 (privilege confirmed 1356)Early Teutonic Order village.
JerzmionkiHarmsdorf53.6048, 17.5107(not filled)Sparse facts.
LichnowyLichnau53.6496, 17.604724 Aug 1338; location charter 4 Mar 1363Early Teutonic Order village.
MoszczenicaMosnitz53.6420, 17.4971Location charter from komtur Dietrich von Lichtenhain (date not in sources consulted)Birthplace of Joseph Rink (as recorded).
NiwyBlumfelde53.5779, 17.430115 Nov 1354, location charterOSM point is the sołectwo centre; approximate.
Nowa WieśAnnafeld53.5771, 17.4893(not filled)Gmina Kamień Krajeński.
ObkasObkas53.5711, 17.55161217; located on Chełmno law 1347
ObrowoAbrau53.5875, 17.6829(not filled)Birthplace of Bishop Augustinus Rosentreter (as recorded).
OgorzelinyGersdorf53.6020, 17.555826 Dec 1236; location charter 29 Jun 1338
PiastoszynPetztin53.6283, 17.73581339 court case; 1345 tavern privilegeEarly Teutonic Order village.
SilnoFrankenhagen53.6470, 17.70761319Site of the Kosznajder hut museum area (as recorded). Early Teutonic Order village.
SławęcinSchlagenthin53.6021, 17.615024 Aug 1338; location charter 15 Jul 1368Early Teutonic Order village.
ZamarteJakobsdorf53.6005, 17.48261354 as “Jacobsdorf”Gmina Kamień Krajeński.

Rink 1926 map symbols (wheel = Koschnäwjerdorf, double circle = Koschneiderdorf) and an “early Teutonic Order village” flag are also stored, with sources, in villages.csv and poc/data/hexinfo.json.


4. Functional requirements

4.1 Map (implemented)

4.2 Zoomable H3 hexes (implemented)

Hexes are computed in the browser with h3-js 4.5.0 (bundled) for the current viewport only, not pre-generated for the whole region at every resolution. A cap of 4,500 hexes per view applies; padding is 0.12 of the viewport.

Map zoomH3 resolutionApprox. edge
below 107~1,221 m
10–11.58~461 m
11.5–139~174 m
13–14.510~66 m
14.5–1611~24.9 m
16–17.512~9.4 m
17.5 and up13~3.6 m

Counts of cells whose centre falls in the current region_obreby.geojson, recomputed 27 November 2026 with the bundled h3-js:

ResolutionCells in the region
750
8330
92,333
1016,331
11114,360
12800,531
135,603,722

(Earlier notes were 16,329 / 114,347 / 800,506 / 5,603,463 at res 10–13; small differences are expected if the polygon or library patch changes.)

Stability, important for pins: an H3 cell ID is permanent and refers to a place on the Earth, not to a pixel on a painting or a MapLibre layer. If the drawing changes, the ID does not. Parent and child hexes do not nest perfectly. When a user later pins a comment, store both the H3 ID and the point coordinates (and probably the resolution).

An older fixed hex grid (poc/data/hexes.geojson, 789 cells) is still loaded and used only to attach coarse land-cover / “nearest village” facts to the zooming cells by nearest centre. Village and town membership of a cell is computed live from coordinates.

4.3 Tap behaviour (implemented)

Priority of pick (top first): heritage, Ciechocin points, village marks, church tower, Ciechocin buildings, 3D extrusions, other buildings, Ciechocin barriers, roads, tracks, paths, water, landuse, forest, then the hex fill.

4.4 2D / 3D view (implemented)

4.5 Isometric painted page (implemented, prototype)

4.6 Memory markers — demonstration layer (implemented 1 December 2026), writes still not built

A read-only layer of 200 memories by 25 authors, served from site/data/markers.json. Everything in it is invented, including the family letters and diaries quoted; no real person, book or archive is cited. It exists so the marker experience could be designed and measured at realistic density before any store or identity system is chosen. Full reasoning: docs/ideas/memory-markers.md.

Still planned, still not implemented:


5. Visual direction

The owner wants the map to have “soul”. He responded strongly to a watercolor-on-parchment look (warm ochre fields, ink outlines, paper grain, red-tiled farmsteads, a brick church). The live main map today is a custom parchment MapLibre style (palette taken from an earlier static map): paper #f0e4c8 / #efe3c6, ink #3b2a18, forest #c3cc98, water #a8c4c2, roads #b98a54. UI type is Georgia with “EB Garamond” in the stack; map labels use self-hosted EB Garamond MapLibre glyphs.

Watercolor detail levels (explored, not implemented on the main map)

On 27 November 2026 the same ~640 m patch around Ciechocin church (village street, fields, forest edge, west shore of the lake) was painted at three scales, guided by a dimetric base of the real geometry. Files (not deployed) live at /workspace/kosznajderia/iso/levels/.

LevelScaleWhat you can readNotes
1 — regional~1 px/m (600 px wide)Fields, forest masses, lake, roads, village as red-roof dabs, church as a small spire markPainted loose, then downsampled; not a native 600 px painting.
2 — high detail~2 px/m (1200 px wide)Every farmstead, tree lines, fences, furrows, church shapeOne painting at the model’s ~1280 px width. At screen size the whole patch looks almost like Level 3.
3 — Ciechocin-level~4 px/m (2400 px wide)Roof tiles, windows, chimneys, gardens, reeds, ripplesFour overlapping tiles, seam-stitched. One seam still slightly clips a building. Fine detail can drift from the base.

Recommendation (not a decision): Level 1 for the countryside, Level 3 for village centres where people will zoom in and pin. A full-region Level 3 would spend most of its effort on empty fields. Rough effort for the whole region was estimated at 1–2 days (Level 1 everywhere), 3–5 days (the recommended mix), 1–2 weeks (Level 2 everywhere), or several weeks (Level 3 everywhere). These are guesses; the first village would set the real pace.

Owner decision, 27 November 2026: do not implement the painted watercolor basemap yet. Keep the samples and this recommendation for later.

Pixel art was produced only as a comparison on the church close-up; watercolor is the preferred style.


6. Current state

Live URLs

There is no public git remote in the working copy. The development tree is /workspace/kosznajderia on the project box. poc/site/ is the folder that gets uploaded as the Worker’s static assets.

Hosting

Tech stack

PieceVersion / note
MapLibre GL JS5.24.1, vendored in poc/lib/maplibre-gl.js
PMTiles4.5.0 (project notes; vendored poc/lib/pmtiles.js)
h3-js4.5.0 (project notes; vendored poc/lib/h3-js.js)
tippecanoebuilds koszn.pmtiles, zooms 8–14
three.js0.170, vendored in iso/vendor/ for the dimetric renderer (not shipped to the main map)
FontsEB Garamond as MapLibre glyphs under poc/fonts/
HostingCloudflare Workers static assets

koszn.pmtiles is about 2.3 MB; dem.pmtiles about 1.6 MB.

Data sources

An older experimental static site under web/ also mentions SLUB Dresden Virtuelles Kartenforum Messtischblatt / TK100 tiles. Those sheets (especially post-1900) may be rights-reserved and were streamed for viewing, not redistributed. They are not part of the live POC Worker.

OSM enrichment layers, 30 November 2026

Five further classes of OpenStreetMap data were already available for this area but unused. They were added as plain client-side GeoJSON — no tile rebuild — and every one is clipped to the region, which for this purpose was rebuilt from GUGiK ULDK as the union of the 19 villages’ precincts (215.8 km² by a local-metre estimate, against the 217.4 km² recorded in koszn.pmtiles; the two agree within the accuracy of either figure). OSM snapshot: Overpass timestamp_osm_base 2026-11-30T12:52Z.

FileWhat it holdsCount in the region
data/hamlets.geojsonplace=hamlet / locality / isolated_dwelling, mostly PRNG-sourced names — the Wybudowanie outlying settlements, the mill hamlets (Obkas-Młyn), and the Pierwszy / Drugi pairs34
data/trees.geojsonnatural=tree_row lines (clipped at the region boundary) and natural=tree points60 row segments, 308 trees
data/railhist.geojsonrailway=disused / abandoned / razed / dismantled2 segments (both unnamed spurs)
data/histbld.geojsonbuilding footprints carrying any historic=* tag26
data/lakelabels.geojsongains a de field from OSM old_name:de / name:de4 lakes

Notes, so a successor does not redo the work:

BDOT10k (Geoportal) layers, 30 November 2026

A survey of Polish public geodata found a second body of usable material, this time from GUGiK rather than OSM. Four layers were built from BDOT10k, the national topographic object database, in the same way as the OSM enrichment above: plain client-side GeoJSON, no tile rebuild, everything clipped to the same 19 cadastral precincts. Source files are the open BDOT10k GML for the three powiats the region straddles — chojnicki (2202), sępoleński (0413) and tucholski (0416) — dated 15 October 2026 and downloaded on 30 November 2026. Coordinates were converted from EPSG:2180; lines are cut at the precinct boundary, polygons kept by centroid.

FileWhat it holdsCount in the regionSize
data/bdot_relief.geojsoncontour lines at 5 m (thinned from the native 1.25 m), plus scarps and gullies647 contour segments across levels 110–185 m, 236 scarps, 23 gullies384 kB
data/bdot_trees.geojsonsurveyed tree rows, hedges and shrub belts, and trees registered as pomnik przyrody441 tree rows (9 of them protected), 113 hedges, 18 protected trees110 kB
data/bdot_earth.geojsonearthworks and micro-relief: banks, dykes, dry moats and cuttings, mounds, pits, spot heights128 banks, 205 moats/cuttings, 51 dykes, 79 mounds, 48 pits, 219 spot heights126 kB
data/bdot_bld.geojsonsurveyed building footprints for Ciechocin only, with function and floor count180 buildings (110 outbuildings, 49 single-family, 11 multi-family, 1 church, 1 production, 1 garage); floors 1–363 kB

Notes:

Surveyed but not used, with the reason, so a successor does not repeat the search:

Versioning and changelog, 30 November 2026

The site carries a version number, shown as a v0.2.0 button under Requirements ›, which opens a changelog panel in the same card used for object details.

The Nowy Dwór enclave, 1 December 2026

The region outline had a hole in it. The union of the 19 precincts enclosed, but did not contain, the cadastral precinct of Nowy Dwór (TERYT 220203_2.0018, gmina Chojnice) — about 7.3 km² in the middle of the region. MapLibre paints a polygon’s interior rings exactly like its outer ring, so that exclusion was drawn with the same bold dashed border as the region edge and read as if it were a highlighted area of its own.

Nowy Dwór is not a Koschneider village, and including its precinct changes the region from “the 19 villages’ precincts” to “the 19 plus the one they surround”. It is drawn as a 20th village point and its card carries a tag saying it is not one of the 19.

It has no German name in any source this project uses. OSM carries no name:de or old_name:de on the place node; PRNG records no historical or variant name for it; the Polish Wikipedia article has no German interwiki and no niem. gloss. None was invented. The likely reason is in the article: the village was formed in 1908, when the last owner of the Nowodworski estate sold it to the Prussian colonisation commission — a 20th-century foundation, not one of the old Koschneider villages. That founding date is recorded in hexinfo.json with its source. If a German form turns up in Rink 1926, a Messtischblatt sheet or Sadurska 2022, add de to the village in villages.geojson and hexinfo.json and both the label and the card will pick it up.

Known data limitations

File and repo layout (/workspace/kosznajderia)

There is no git repository in this working copy.

PathRole
poc/Source of the live app. index.html, app.js, app.css, style.js, worker.js
poc/lib/Vendored MapLibre, PMTiles, h3-js
poc/fonts/EB Garamond glyph PBFs for the map
poc/data/koszn.pmtiles, dem.pmtiles, hexinfo.json, hexes.geojson, heritage/villages/towns/lakes GeoJSON, plus geo/ and tc/ build inputs
poc/site/Deploy snapshot of the Worker static assets (copy of the app + /iso/)
iso/Isometric renderer, paintings, viewer, data/scene.json, detail-level samples in iso/levels/
villages.csv, towns.csvMaster village / town tables
boundary/, heritage/, dem/, facts/, hist/Source data and historical georeferencing work
data/OSM PBF extracts
app/, web/Earlier prototypes; not what is deployed today
BUSINESS_REQUIREMENTS.mdThis document (repo root). Also published as /business-requirements.md

Build scripts (high level)

  1. fetch_obreby.py — cadastral precincts from ULDK.
  2. poc/extract_poc.py — OSM features from the two PBF extracts into poc/osm_poc.pkl.
  3. poc/build_geojson.py — layer GeoJSON under poc/data/geo/ (Ciechocin features flagged c=1).
  4. poc/build_tiles.sh — tippecanoe → poc/data/koszn.pmtiles (z8–14).
  5. poc/build_dem.py — Copernicus raster → dem.pmtiles.
  6. build_heritage.py — NID + OSM heritage points.
  7. Hex info and villages are assembled into poc/data/hexinfo.json (see existing build helpers in poc/).
  8. Isometric: iso/prepare_data.py (and prepare_data_patch.py) write scene.json; iso/render.html + iso/render.js render the dimetric base (headless Chrome); paintings are produced separately and stored as images.

Deploy: upload the contents of poc/site/ as Workers static assets with correct Content-Type per file, then PUT the kosznajderia script with the assets JWT and run_worker_first: ['/data/*.pmtiles']. Delete upload JWTs afterwards. Verify MIME types and Range 206.


7. Roadmap, open decisions, and next steps

Already decided

Suggested next steps (when the owner asks)

  1. Writable user markers and comments (D1, H3 ID + coordinates), including a simple moderation/identity plan. The read-only layer in §4.6 already fixes the schema and the UI; what is left is the store, identity and moderation.
  2. If and when painting is approved: start with the recommended mix (Level 1 countryside + Level 3 village centres), first village as a pace check, hex overlay via the affine transform.
  3. A sharper tiled isometric Ciechocin with hexes on /iso/ (watercolor, geometry-guided, 20–30 overlapping tiles was the earlier plan for the village alone).
  4. Fill obvious fact gaps in villages.csv from sourced literature — never by invention.
  5. Better building types/heights where OSM or a surveyed source actually has them.
  6. A clearer historical “era” experience (time slider or period layers) — only after the owner defines what an era means here.

Open questions

Rules for a successor assistant


*End of handoff. For the live app, start at the main map URL above. For code, start at /workspace/kosznajderia/poc/.*