@nspot/geo-pack-romania-localities 0.0.0-stage → 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NSpot Games
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LICENSE-DATA ADDED
@@ -0,0 +1,51 @@
1
+ Data licence for @nspot/geo-pack-romania-localities
2
+ ===================================================
3
+
4
+ `LICENSE` (MIT) covers this package's text. It does not cover the data in
5
+ `pack.json`, which is licensed separately.
6
+
7
+ The label points are a derivative database of OpenStreetMap, © OpenStreetMap
8
+ contributors, made available under the Open Database License 1.0 (ODbL):
9
+
10
+ https://opendatacommons.org/licenses/odbl/1-0/
11
+ https://www.openstreetmap.org/copyright
12
+
13
+ They were taken from Geofabrik's extract of Romania, data of 2026-10-08:
14
+
15
+ https://download.geofabrik.de/europe/romania-261008.osm.pbf
16
+
17
+ Because `pack.json` is built from those points, the whole of `pack.json` is
18
+ ODbL 1.0, names and codes included. If you publicly use or convey it, or a
19
+ database derived from it, you must offer it under the ODbL too, and keep the
20
+ credit below.
21
+
22
+ The names, SIRUTA codes and parents (the UAT each locality belongs to) come from
23
+ the Institutul Național de Statistică (INS), SIRUTA nomenclature, first
24
+ semester of 2026, published under the Creative Commons Attribution 4.0
25
+ International licence (CC BY 4.0):
26
+
27
+ https://data.gov.ro/dataset/siruta_s1-2026
28
+ https://creativecommons.org/licenses/by/4.0/
29
+ https://data.gov.ro/pages/licence
30
+
31
+ We changed the data: each locality was matched to an OpenStreetMap place node
32
+ by its SIRUTA code, or failing that by name within its UAT, checked against the
33
+ UAT's boundary, and rounded to 6 decimals. Names were converted from upper
34
+ case with cedilla forms to title case with comma-below diacritics. A locality
35
+ with no trustworthy node has no point and says why.
36
+
37
+ Attribution: a map or anything else that shows the points must credit
38
+
39
+ © OpenStreetMap contributors
40
+
41
+ (where the medium allows, link it to https://www.openstreetmap.org/copyright)
42
+
43
+ and wherever you show or distribute the names and codes, credit
44
+
45
+ Institutul Național de Statistică, SIRUTA, CC BY 4.0
46
+
47
+ The data is provided as is, with no warranty; it does not imply endorsement by
48
+ OpenStreetMap or INS.
49
+
50
+ The UATs these localities name as parents are not in this pack: they are in
51
+ @nspot/geo-pack-romania-uat (see that package's LICENSE-DATA).
package/README.md CHANGED
@@ -1,3 +1,85 @@
1
- # Temporary Holding Version
1
+ # @nspot/geo-pack-romania-localities
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A [geo-engine](https://github.com/NSpot-Games/geo-engine) locality pack: every village of
4
+ Romania and every component locality of its towns and cities, each with the point where
5
+ OpenStreetMap labels it, parented to its UAT.
6
+
7
+ ## What's in it
8
+
9
+ **13,749 localities**, each coded by its SIRUTA code (`code`, country `RO`) and named as
10
+ SIRUTA names it, in title case with comma-below diacritics (ș, ț).
11
+
12
+ - **12,959 villages**, tagged `sat`.
13
+ - **790 component localities** of towns and cities (districts and suburbs with a SIRUTA
14
+ code of their own), tagged `localitate-componenta`.
15
+ - **3,180** of them are also tagged `resedinta`: the locality where its UAT has its seat
16
+ (2,862 villages and 318 component localities).
17
+
18
+ Each locality's parent is its UAT in
19
+ [`@nspot/geo-pack-romania-uat`](https://www.npmjs.com/package/@nspot/geo-pack-romania-uat),
20
+ by slug (`bran-bv`). Its `properties` carry:
21
+
22
+ - `tip`: SIRUTA's locality type (9, 10, 11, 17, 18, 19, 22 or 23). Always there.
23
+ - `point_rule`: how the point was chosen, when there is one. `coded` is the OpenStreetMap
24
+ place node that carries the locality's SIRUTA code (13,630 localities). `coded_outside`
25
+ is the same, but the node lies up to 1 km outside the UAT's simplified border, as it can
26
+ for a village on the border (69). `name` is the one place node of that name within the
27
+ UAT, for a locality with no coded node (15).
28
+ - `osm_node`: the OpenStreetMap node id the point comes from.
29
+ - `outside_m`: how far outside the UAT the point lies, in metres, when it lies outside.
30
+
31
+ **35 localities have no point** (`point` is `null`) and carry the reason in `point_gap`:
32
+ `no_osm_node` (26: no node of theirs, or two alike in the UAT and no way to choose),
33
+ `far_outside_uat` (8: its coded node lies more than 1 km outside its UAT) and
34
+ `nodes_disagree` (1: several coded nodes more than 2 km apart). They are listed by județ in
35
+ the
36
+ [gap report](https://github.com/NSpot-Games/geo-engine/blob/main/packages/db/seed/RO/localities/report.md);
37
+ how the points are chosen is in
38
+ [`packages/db/seed/RO/localities/README.md`](https://github.com/NSpot-Games/geo-engine/blob/main/packages/db/seed/RO/localities/README.md).
39
+
40
+ **A point is a label point.** It is where OpenStreetMap puts the name of the place, not a
41
+ boundary, a centre of mass or a postal area. Do not infer a village's extent from it, and do
42
+ not assume the village lies in the UAT of the point on a border: the parent is SIRUTA's.
43
+
44
+ The country entry carries no outline, so installing this pack never overwrites Romania's.
45
+ The pack is about 4 MB.
46
+
47
+ ## Installing it
48
+
49
+ It needs `@nspot/geo-engine` 0.5.0 or later (schema 9), which has localities. Install it
50
+ beside `@nspot/geo-pack-romania-uat` (and `@nspot/geo-pack-romania`, which that needs):
51
+
52
+ ```bash
53
+ npm i @nspot/geo-pack-romania @nspot/geo-pack-romania-uat @nspot/geo-pack-romania-localities
54
+ ```
55
+
56
+ ```ts
57
+ import { installPack, localitiesIn } from "@nspot/geo-engine";
58
+
59
+ await installPack(pool, "@nspot/geo-pack-romania");
60
+ await installPack(pool, "@nspot/geo-pack-romania-uat");
61
+ await installPack(pool, "@nspot/geo-pack-romania-localities");
62
+
63
+ (await localitiesIn(pool, ["bran-bv"])).map((l) => l.name); // Bran, Predeluț, Șimon, Sohodol
64
+ ```
65
+
66
+ Install them in that order, or in any other: parents are linked by slug, so a locality
67
+ installed first stays unparented until the UAT arrives, and is linked then.
68
+
69
+ If your own tables point at a locality, make the foreign key on `(country, code)` with
70
+ `ON DELETE NO ACTION`. An update keeps localities in place by `(country, code)`. An update
71
+ that would drop a locality your rows reference, or an uninstall, then fails loudly and names
72
+ the locality instead of deleting your rows.
73
+
74
+ ## Licence
75
+
76
+ The package's text is MIT (`LICENSE`); the data is ODbL 1.0 (`LICENSE-DATA`), because the
77
+ points are a derivative of OpenStreetMap, and so is the whole of `pack.json`. A map or any
78
+ other work that shows the points must credit
79
+
80
+ - © OpenStreetMap contributors (where the medium allows, link it to
81
+ https://www.openstreetmap.org/copyright)
82
+
83
+ and wherever you show the names and codes, credit
84
+
85
+ - Institutul Național de Statistică, SIRUTA, CC BY 4.0