@welldot/core 0.4.0-next.20261014.26249fd → 0.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.
Files changed (48) hide show
  1. package/README.md +14 -4
  2. package/dist/index.cjs +51 -2
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +20 -1
  5. package/dist/index.d.ts +20 -1
  6. package/dist/index.js +50 -2
  7. package/dist/index.js.map +1 -1
  8. package/examples/README.md +83 -0
  9. package/examples/belem-pa-condominio-outorga.well +961 -0
  10. package/examples/belem-pa-monitoramento-posto.well +1141 -0
  11. package/examples/belem-pa-pirabas-abastecimento.well +1751 -0
  12. package/examples/belem-pa-poco-colmatado.well +496 -0
  13. package/examples/belem-pa-poco-raso-abandonado.well +388 -0
  14. package/examples/belem-pa-qualidade-agua-acida.well +895 -0
  15. package/examples/colatina-es-gnaisse-rural.well +1047 -0
  16. package/examples/coluna-mg-cristalino-abastecimento.well +1437 -0
  17. package/examples/estrela-doeste-sp-bauru-serra-geral.well +919 -0
  18. package/examples/extremoz-rn-barreiras-raso.well +623 -0
  19. package/examples/gastao-vidigal-sp-dados-inconsistentes.well +222 -0
  20. package/examples/index.json +452 -0
  21. package/examples/irece-ba-carste-bambui.well +861 -0
  22. package/examples/lagoa-santa-mg-carste-abastecimento.well +1087 -0
  23. package/examples/minas-novas-mg-cadastro-incompleto.well +157 -0
  24. package/examples/quixeramobim-ce-cristalino-salobro.well +989 -0
  25. package/examples/rinopolis-sp-estratigrafico-guarani.well +287 -0
  26. package/examples/santarem-pa-jorrante-alter-do-chao.well +554 -0
  27. package/examples/sao-gabriel-rs-cacimba.well +360 -0
  28. package/examples/sete-lagoas-mg-carste-industrial.well +410 -0
  29. package/examples/thumbs/belem-pa-condominio-outorga.svg +1 -0
  30. package/examples/thumbs/belem-pa-monitoramento-posto.svg +1 -0
  31. package/examples/thumbs/belem-pa-pirabas-abastecimento.svg +1 -0
  32. package/examples/thumbs/belem-pa-poco-colmatado.svg +1 -0
  33. package/examples/thumbs/belem-pa-poco-raso-abandonado.svg +1 -0
  34. package/examples/thumbs/belem-pa-qualidade-agua-acida.svg +1 -0
  35. package/examples/thumbs/colatina-es-gnaisse-rural.svg +1 -0
  36. package/examples/thumbs/coluna-mg-cristalino-abastecimento.svg +1 -0
  37. package/examples/thumbs/estrela-doeste-sp-bauru-serra-geral.svg +1 -0
  38. package/examples/thumbs/extremoz-rn-barreiras-raso.svg +1 -0
  39. package/examples/thumbs/gastao-vidigal-sp-dados-inconsistentes.svg +1 -0
  40. package/examples/thumbs/irece-ba-carste-bambui.svg +1 -0
  41. package/examples/thumbs/lagoa-santa-mg-carste-abastecimento.svg +1 -0
  42. package/examples/thumbs/minas-novas-mg-cadastro-incompleto.svg +1 -0
  43. package/examples/thumbs/quixeramobim-ce-cristalino-salobro.svg +1 -0
  44. package/examples/thumbs/rinopolis-sp-estratigrafico-guarani.svg +1 -0
  45. package/examples/thumbs/santarem-pa-jorrante-alter-do-chao.svg +1 -0
  46. package/examples/thumbs/sao-gabriel-rs-cacimba.svg +1 -0
  47. package/examples/thumbs/sete-lagoas-mg-carste-industrial.svg +1 -0
  48. package/package.json +5 -3
@@ -0,0 +1,83 @@
1
+ # `.well` example wells
2
+
3
+ Nineteen complete `.well` v2.3 files that serve as a reference for the format. Each one stays valid and covers a different situation. The profiler offers them in its "New well" dialog, which opens when the editor starts empty, and serves them at `https://welldot.org/examples/<file>`. They also ship with `@welldot/core` (`@welldot/core/examples/<file>`).
4
+
5
+ `src/examples.test.ts` checks that every file passes `WellSchema`, round-trips through `deserializeWell` / `serializeWell`, and matches `index.json`, and that every category lists at least three examples.
6
+
7
+ ## Data provenance
8
+
9
+ Each example is **illustrative**. It is built on a real well from SIAGAS (Serviço Geológico do Brasil), but it is not that well's record.
10
+
11
+ - **From SIAGAS (the physical base):** region and approximate coordinates, geology and lithology, construction (hole and pipe diameters, casing, screens, annulus, depths), aquifer type, and the order of magnitude of test values (static and dynamic level, flow rate, specific capacity, transmissivity).
12
+ - **Invented, but consistent with the base:** well names and codes, owners, drillers, `well_id`s, permits and their conditions, meters, production, operating regime, pumps, history, water analyses, and pumping-test readings. The readings are synthesized with Cooper-Jacob / Theis-recovery shapes fitted to the base's static level, final drawdown and flow rate.
13
+
14
+ Every file says so at the root:
15
+
16
+ ```json
17
+ "x-welldot-example": {
18
+ "illustrative": true,
19
+ "based_on": "https://siagasweb.sgb.gov.br/layout/detalhe.php?ponto=3100020129"
20
+ }
21
+ ```
22
+
23
+ The authorities are the real ones for each state (IGAM/MG, SP Águas/SP, SEMAS-PA, SEMA-RS, SRH-CE, AGERH/ES, INEMA/BA, IGARN/RN, CNARH/ANA). The identifiers they issued in these files are invented. The files contain no names of real individuals.
24
+
25
+ ## The examples
26
+
27
+ | File | Place | What it shows |
28
+ | --------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
29
+ | `coluna-mg-cristalino-abastecimento.well` | Coluna/MG | Fractured granite under 66 m of saprolite. Telescoping hole (12"→6"), Nold screens alternating with casing, stick-up, centralizers, water-bearing fractures. 24 h test with recovery and a Cooper-Jacob analysis. Three permits (granted → renewed → renewal `requested`) with conditions and fulfillments. Meter replacement (mechanical → telemetered electromagnetic), semiannual then telemetered production, operating regime, two samples. |
30
+ | `sete-lagoas-mg-carste-industrial.well` | Sete Lagoas/MG | Bambuí karst with a cave (`caves`) and a solution-widened fracture. An old test with only the final reading. A 1989 analysis. Status runs active → inactive → decommissioned. |
31
+ | `minas-novas-mg-cadastro-incompleto.well` | Minas Novas/MG | Incomplete record: construction and lithology only. No test, sample or status (status unknown). |
32
+ | `quixeramobim-ce-cristalino-salobro.well` | Quixeramobim/CE | Brackish water in the semi-arid crystalline basement: biotite schist with seven water entries, TDS ≈ 3.5 g/L (Ca–Mg chloride, ion balance within 1%). Community well with a reverse-osmosis desalinator; level and salinity during the 2012–2017 drought and after the 2024 rains. |
33
+ | `colatina-es-gnaisse-rural.well` | Colatina/ES | Rural well in Paraíba do Sul gneiss with a single producing fracture. Drilled in 1999 and left unequipped until 2017. Insignificant-use `exemption`, then an irrigation `abstraction_permit` that supersedes it, with a meter, yearly volume reports and meter readings that match them. |
34
+ | `rinopolis-sp-estratigrafico-guarani.well` | Rinópolis/SP | 1561 m stratigraphic well through 1092 m of basalt into the confined Guarani. Flowing (negative `static_level`), with alkaline thermal water. Stress test for render scale. |
35
+ | `estrela-doeste-sp-bauru-serra-geral.well` | Estrela d'Oeste/SP | Five hole diameters (18"→6"), five screens, surface casing, mixed intake from Bauru sandstone and Serra Geral basalt. Pump in the open hole. Nitrate time series approaching the potability limit. |
36
+ | `irece-ba-carste-bambui.well` | Irecê/BA | Bambuí karst with three `caves` (one dry) and a solution fracture. Old test with 0.3 m of drawdown at 25.5 m³/h. Pump lowered below the main cave in the 2012 drought, turbidity and coliforms with the first rains, very hard water and nitrate rising from 9 to 68 mg/L NO₃. |
37
+ | `lagoa-santa-mg-carste-abastecimento.well` | Lagoa Santa/MG | Urban supply in the Sete Lagoas Formation karst: 100 m³/h with 3 m of drawdown from a conduit at 70 m. 2019 constant-rate test with recovery and Cooper-Jacob analysis, telemetered meter with yearly readings, and an IGAM permit renewed with a lower rate and an environmental condition inside the protected area. |
38
+ | `gastao-vidigal-sp-dados-inconsistentes.well` | Gastão Vidigal/SP | Inconsistencies kept on purpose: casing starts at 0.7 m, grouting recorded twice, a test with 0.2 m of drawdown, static levels that disagree. |
39
+ | `belem-pa-pirabas-abastecimento.well` | Belém/PA | 265 m urban supply well. 36"/24"/17½" hole, 14"→8" `reduction`, stainless wire-wrap screens, gravel pack and bottom plug, 25 lithology layers (Barreiras over Pirabas). Step-drawdown test with Jacob B/C and efficiency. Redevelopment, permit, telemetered production, a sample with high iron. |
40
+ | `belem-pa-condominio-outorga.well` | Belém/PA | Current regulatory path for a condominium well: CNARH registration, permit with conditions (one fulfilled late), meter, monthly readings. |
41
+ | `belem-pa-qualidade-agua-acida.well` | Icoaraci, Belém/PA | Water quality: acidic Barreiras water (pH < 5), censored results (`<`, `not_detected`, `estimated` with DL/QL), purge readings, field duplicate and field blank, a bacterial contamination incident with disinfection. |
42
+ | `belem-pa-poco-colmatado.well` | Belém/PA | Clogging: specific capacity drops over time, camera inspection, acid treatment and air-lift that do not recover it, then decommissioning. |
43
+ | `belem-pa-poco-raso-abandonado.well` | Belém/PA | 12 m jetted well (`x-jetting`) with a high yield, contaminated by sewage, abandoned without being plugged. |
44
+ | `santarem-pa-jorrante-alter-do-chao.well` | Santarém/PA | Flowing well (head 3.98 m above ground) in the Alter do Chão aquifer. 52 h test with high well loss and Jacob transmissivity. |
45
+ | `sao-gabriel-rs-cacimba.well` | São Gabriel/RS | Hand-dug well (`hand_dug`, Ø 1.2 m, brick lining). Levels during the 2022–23 drought and after the 2024 flood, coliforms, disinfection, registration as insignificant use. |
46
+ | `extremoz-rn-barreiras-raso.well` | Extremoz/RN | 26 m Dunas-Barreiras well by a lagoon: two stainless wire-wrap screens and gravel pack. Flowing when drilled (static level −0.01 m), now 3 m below ground. Nitrate series from 2.1 to 12.6 mg/L N as the town grew around it. |
47
+ | `belem-pa-monitoramento-posto.well` | Belém/PA | 2" monitoring well at a fuel station. Low-flow sampling with purge stabilization. BTEX by CAS code (`vocabulary: "cas"`) declining during remediation. |
48
+
49
+ `index.json` lists the same set for applications: `slug`, `file`, `title` and `summary` in `pt`/`en`, `tags`, `categories`, `well_depth`, `well_type`, `place` and `thumbnail`. Its root `categories` (`id` plus `title` in `pt`/`en`, in display order) are the filters of the profiler's example list; each example names the ones it appears under.
50
+
51
+ ## Thumbnails
52
+
53
+ `thumbs/<slug>.svg` is a 120 × 248 drawing of each well made by `@welldot/render`: lithology and construction, with no labels, legend or axis. The editor's example list shows it. The files are generated, not drawn by hand:
54
+
55
+ ```bash
56
+ pnpm --filter @welldot/core build && pnpm --filter @welldot/render build
57
+ pnpm --filter @welldot/render thumbnails:examples
58
+ ```
59
+
60
+ The script ([`packages/render/scripts/generate-example-thumbnails.mjs`](../../render/scripts/generate-example-thumbnails.mjs)) draws each example in jsdom. It then merges duplicate texture patterns, drops text and classes, and renames ids so a rerun only changes what was really redrawn. Run it again after adding or changing an example, or when the renderer's drawing changes.
61
+
62
+ ## Mapping rules used for the physical base
63
+
64
+ These examples were built by hand. To import a real SIAGAS record as it is, without invented data, use `importSiagasWell` from `@welldot/utils/siagas` (or "Import from SIAGAS" in the profiler). It follows the same rules, except that it interprets zeros per field and does not convert nominal pipe sizes to outer diameters.
65
+
66
+ - **Coordinates:** SIAGAS latitude/longitude (GGMMSS, south/west) → negative decimal degrees, with `original_crs` set to the SIRGAS 2000 UTM zone. A SIAGAS elevation (`cota`) of 0 means unknown. Where an elevation is given, it is orthometric (`elevation_datum: "x-imbituba"`).
67
+ - **Zero means missing:** SIAGAS writes 0 for an unknown value. It is never copied as 0.
68
+ - **Diameters:** hole diameters use the bit size in mm. Pipes use the real outer diameter of the nominal size (6" steel → 168 mm, 8" → 219 mm, 14" → 356 mm).
69
+ - **Stick-up:** the SIAGAS "altura da boca" becomes a negative `from` on the first casing.
70
+ - **Annulus:** grouting → `hole_fill` `seal`; gravel and sand → `gravel_pack`.
71
+ - **Lithology:** each SIAGAS layer, plus `geologic_unit` from "Formação Geológica" and `aquifer_unit` from "Aquífero no Ponto". `color` and FGDC `texture` are taken from the description.
72
+ - **Water entries** → `fractures` with `water_intake: true`.
73
+ - **Censored results:** SIAGAS writes values below the detection limit as negatives. They become `qualifier: "<"` with the absolute value.
74
+ - **Flowing wells:** when SIAGAS shows "Surgência: S", the static level is written negative (head above ground).
75
+ - **SIAGAS status** (Parado, Fechado, Colmatado, Abandonado, Equipado) → a `status_change` entry in `history_logs`.
76
+
77
+ ## Adding an example
78
+
79
+ 1. Add the `.well` file here. Name it `<place>-<state>-<scenario>.well` in lowercase ASCII.
80
+ 2. Add its entry to `index.json`, with `"thumbnail": "thumbs/<slug>.svg"` and at least one id from the root `categories`.
81
+ 3. Generate its thumbnail (see [Thumbnails](#thumbnails)).
82
+ 4. Run `pnpm test` in `packages/core`.
83
+ 5. Check that `getOperationWarnings`, `getPermitWarnings`, `getPumpInstallationWarnings` and `getWaterSampleWarnings` from `@welldot/utils` return no warnings. All current examples are warning-free, including the inconsistent one: its problems are ones these helpers don't detect yet.