mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 10:27:57 +00:00
Compare commits
2540 Commits
v3.5.1
...
docs-4.5.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc9105d1ea | ||
|
|
76838632d6 | ||
|
|
3734f1d0b8 | ||
|
|
a66c063314 | ||
|
|
fe0ade81f5 | ||
|
|
f52212abbd | ||
|
|
8f30a32466 | ||
|
|
157c3cccd1 | ||
|
|
3e6be0b0be | ||
|
|
882fb16881 | ||
|
|
72be143cef | ||
|
|
086116b3a1 | ||
|
|
ed7f0d9e46 | ||
|
|
b5a6d7a4a6 | ||
|
|
7f11de0db9 | ||
|
|
f535340d5a | ||
|
|
c7d80a2cc8 | ||
|
|
0efdd1b9a6 | ||
|
|
fd9437277e | ||
|
|
968f1cd453 | ||
|
|
adce7261ac | ||
|
|
b01a836d1e | ||
|
|
c2594aca40 | ||
|
|
8b41b80bff | ||
|
|
feb8cc29a5 | ||
|
|
1cd8ffad0b | ||
|
|
d648561a87 | ||
|
|
8e8f7a641b | ||
|
|
69369c08c8 | ||
|
|
fdb3fc2f7b | ||
|
|
054efc8311 | ||
|
|
d7cf81c047 | ||
|
|
19eb4d91a0 | ||
|
|
5a61d3d5f6 | ||
|
|
52ee5dc73c | ||
|
|
0c25e80be0 | ||
|
|
4e0602919c | ||
|
|
d22ca186e4 | ||
|
|
4f4a288757 | ||
|
|
14cc047cf4 | ||
|
|
043d52821c | ||
|
|
3905dd68dd | ||
|
|
bd0316b5c3 | ||
|
|
fd33ef92dc | ||
|
|
6527b7cdcd | ||
|
|
3cc20581ae | ||
|
|
a2a44b875a | ||
|
|
a14ab1c08c | ||
|
|
0ba3d01982 | ||
|
|
f6e792f31b | ||
|
|
882f182374 | ||
|
|
d1e7b85cc5 | ||
|
|
6b1c32893b | ||
|
|
474a22cb3b | ||
|
|
8e46458d9e | ||
|
|
7282d816c8 | ||
|
|
7cf21f8caf | ||
|
|
738e99ce71 | ||
|
|
e104115134 | ||
|
|
f0390cfe85 | ||
|
|
a4d7cdd2ad | ||
|
|
2914284a83 | ||
|
|
a97bfaf26c | ||
|
|
cfe5284f64 | ||
|
|
2048009600 | ||
|
|
d47acbc18a | ||
|
|
f5fd2f0e7a | ||
|
|
c8d45972bb | ||
|
|
474aea61da | ||
|
|
67462e0953 | ||
|
|
804fb5f93e | ||
|
|
f52097c064 | ||
|
|
d336b81293 | ||
|
|
507c0286da | ||
|
|
04a3f39371 | ||
|
|
bc75e5626e | ||
|
|
0add25e335 | ||
|
|
253dc7d7cd | ||
|
|
221b5cd8a2 | ||
|
|
9659afbade | ||
|
|
3742fa2929 | ||
|
|
71249bd94a | ||
|
|
e3353deee0 | ||
|
|
00563a1fa2 | ||
|
|
b8686c19a0 | ||
|
|
b89144dcb2 | ||
|
|
8e5a19b392 | ||
|
|
5d12121f6d | ||
|
|
24f103dcbe | ||
|
|
0109f167f9 | ||
|
|
b63633857e | ||
|
|
8cb0d5b262 | ||
|
|
e51973f8b1 | ||
|
|
c314a3092c | ||
|
|
8dafd8bcb6 | ||
|
|
ecf4693a79 | ||
|
|
fa1c402b47 | ||
|
|
4da4cbfe27 | ||
|
|
139cea5720 | ||
|
|
e2416f90af | ||
|
|
1e88321371 | ||
|
|
a93ec09932 | ||
|
|
9abf2c248e | ||
|
|
ab746eebaf | ||
|
|
3ba330c948 | ||
|
|
aef1357066 | ||
|
|
5d302a03a6 | ||
|
|
3a8c5df82d | ||
|
|
44d5148e5f | ||
|
|
63da70685a | ||
|
|
2bab0ca060 | ||
|
|
c903559415 | ||
|
|
6511821001 | ||
|
|
75abf237a6 | ||
|
|
dc7c11a9d1 | ||
|
|
44fface92a | ||
|
|
6e89310a92 | ||
|
|
0fb4fe8e4d | ||
|
|
b0067a0345 | ||
|
|
4c72cdaa86 | ||
|
|
350bb0e1cd | ||
|
|
ad95ff1d06 | ||
|
|
90eea6b909 | ||
|
|
5b02cd22b9 | ||
|
|
60b03d506f | ||
|
|
5c7073901e | ||
|
|
b33afee468 | ||
|
|
6a748204ff | ||
|
|
9889c72c55 | ||
|
|
01f0f453dd | ||
|
|
7f0d969d71 | ||
|
|
a47fa07558 | ||
|
|
2b3ea0abb7 | ||
|
|
755ae0ef94 | ||
|
|
ccb5cf155d | ||
|
|
7080a13c54 | ||
|
|
cf2697f8f4 | ||
|
|
a6b829e4a0 | ||
|
|
f92e580293 | ||
|
|
bc84db6460 | ||
|
|
77631f90fd | ||
|
|
332de72045 | ||
|
|
a2cf6db61b | ||
|
|
82a98f3780 | ||
|
|
7fb3ef4633 | ||
|
|
8f3845660f | ||
|
|
d2bf986eae | ||
|
|
9410263485 | ||
|
|
82970e2b4f | ||
|
|
f923304eea | ||
|
|
1a0f851d0d | ||
|
|
28444d9435 | ||
|
|
8c54f9d704 | ||
|
|
c24dc56c65 | ||
|
|
5c4c98d17e | ||
|
|
657aae5f1b | ||
|
|
38798bba13 | ||
|
|
05eb1d5f42 | ||
|
|
fe873ad0e2 | ||
|
|
bdded69ab6 | ||
|
|
9f42c3f3b8 | ||
|
|
424ebd7fe9 | ||
|
|
78c19bc006 | ||
|
|
e53eb79923 | ||
|
|
c39fc5d180 | ||
|
|
a96b6a1289 | ||
|
|
8f6f113e1c | ||
|
|
436aff2fd3 | ||
|
|
44922af20e | ||
|
|
4315debff5 | ||
|
|
ace84ed0e3 | ||
|
|
ff3230a7f3 | ||
|
|
07b7fd1dbb | ||
|
|
bb5de9b955 | ||
|
|
40b87bbadf | ||
|
|
1c195eb1e4 | ||
|
|
9c48726691 | ||
|
|
4fa349315b | ||
|
|
50beac8305 | ||
|
|
9de6bdd7dd | ||
|
|
6e688a0113 | ||
|
|
dc7cfd1708 | ||
|
|
e5a5f02666 | ||
|
|
11ced26025 | ||
|
|
edb1eec46d | ||
|
|
63eacc5589 | ||
|
|
e929693cae | ||
|
|
ae7c584e28 | ||
|
|
4d5faf9423 | ||
|
|
b7eea4d53a | ||
|
|
dd2c794de5 | ||
|
|
3b6d35fc12 | ||
|
|
9fa73cfb15 | ||
|
|
62b7670e0c | ||
|
|
d7bb449e74 | ||
|
|
247065ff6f | ||
|
|
9a84adef59 | ||
|
|
1879cf902c | ||
|
|
019a68a4bb | ||
|
|
110491011f | ||
|
|
36b1660121 | ||
|
|
56201feb28 | ||
|
|
c6d40d4bf4 | ||
|
|
a4f2e6a893 | ||
|
|
b427fc7965 | ||
|
|
e264604894 | ||
|
|
3a5d9f0377 | ||
|
|
8be27015b2 | ||
|
|
100391fb8e | ||
|
|
dc1baaa0af | ||
|
|
7205491b84 | ||
|
|
918fec73c6 | ||
|
|
b6df486525 | ||
|
|
8bd8a040e0 | ||
|
|
781e83ddc3 | ||
|
|
5afd96d210 | ||
|
|
cf49a070fd | ||
|
|
4aba36c5ac | ||
|
|
ca6e65fff1 | ||
|
|
1e0025b095 | ||
|
|
173e85c9e6 | ||
|
|
ffb467028e | ||
|
|
05fad607ff | ||
|
|
19360a9552 | ||
|
|
b087f3ab7b | ||
|
|
2c8fb31381 | ||
|
|
b2d3f0a8b3 | ||
|
|
bd8025feab | ||
|
|
4c19762e33 | ||
|
|
1015ac40ae | ||
|
|
4ce13f5c1f | ||
|
|
2833362cf6 | ||
|
|
bc51378aee | ||
|
|
39039e2a55 | ||
|
|
f523c01571 | ||
|
|
81eed0680c | ||
|
|
33c0f249b1 | ||
|
|
76eadc562c | ||
|
|
3cc3e3b2e3 | ||
|
|
f07f8530a8 | ||
|
|
103800a732 | ||
|
|
f9ba7a465a | ||
|
|
fed46240d5 | ||
|
|
2703442fd2 | ||
|
|
2813bf18e6 | ||
|
|
dcebea376d | ||
|
|
b3a2b3d484 | ||
|
|
7321e66d08 | ||
|
|
9627352ee4 | ||
|
|
bfc7acbb18 | ||
|
|
e0ca2ce6ec | ||
|
|
b969c5a62f | ||
|
|
28f7e51279 | ||
|
|
d35eb4105e | ||
|
|
b2afe3ce3e | ||
|
|
7337898b84 | ||
|
|
4305160c91 | ||
|
|
dc52d0954e | ||
|
|
d3a575319f | ||
|
|
2592bf1954 | ||
|
|
88d7ffa274 | ||
|
|
474d4230b8 | ||
|
|
10a5424a71 | ||
|
|
7eb04f67e2 | ||
|
|
1d7e078a2c | ||
|
|
f03ec3ea12 | ||
|
|
8e90fa3395 | ||
|
|
02af0a2c87 | ||
|
|
fa4e5513d1 | ||
|
|
93afe5a7c3 | ||
|
|
af85ad390f | ||
|
|
ab45db5360 | ||
|
|
89094cf92e | ||
|
|
3f5484f48f | ||
|
|
ff06b64329 | ||
|
|
6d39563b87 | ||
|
|
0d840c8d4e | ||
|
|
381bd0b576 | ||
|
|
b5c61e0b5b | ||
|
|
df6eddebcd | ||
|
|
b6c8c0e72b | ||
|
|
b06f5fddcb | ||
|
|
8791c6cb69 | ||
|
|
615b166c68 | ||
|
|
c41f2fed21 | ||
|
|
05e47fbb28 | ||
|
|
1b7c8240ba | ||
|
|
c4fd3ab97f | ||
|
|
8c7140d92b | ||
|
|
3969ce0f55 | ||
|
|
4f5f5ea8fc | ||
|
|
5f7cc91cf9 | ||
|
|
424c1f0d41 | ||
|
|
cff05394a1 | ||
|
|
638b40c3ec | ||
|
|
53d2050dc5 | ||
|
|
97ac036df5 | ||
|
|
482f7fe3ba | ||
|
|
567c31ab6a | ||
|
|
7d28fc35d1 | ||
|
|
c06f902398 | ||
|
|
59ae63e6f5 | ||
|
|
9c7d947fd1 | ||
|
|
58db0ad6d8 | ||
|
|
3b09c39dbf | ||
|
|
db917cb0d4 | ||
|
|
ba6cdd875d | ||
|
|
d231ff60ed | ||
|
|
c74904d075 | ||
|
|
22204050f2 | ||
|
|
667197a47e | ||
|
|
e8b866aa88 | ||
|
|
e7b8e1a2c2 | ||
|
|
279b4fd6d2 | ||
|
|
b7c83d3580 | ||
|
|
d4018f2e3b | ||
|
|
38369ca3cf | ||
|
|
cc0bdd34e9 | ||
|
|
8e71ff329c | ||
|
|
b4e3d0ea44 | ||
|
|
992703b15e | ||
|
|
ba5ec80611 | ||
|
|
1c1447e709 | ||
|
|
3c32c0354a | ||
|
|
8a2c6067a2 | ||
|
|
d60a45715a | ||
|
|
3c7a28dab0 | ||
|
|
0c72a434e0 | ||
|
|
32e7b59b1f | ||
|
|
f448423727 | ||
|
|
b2319e52ff | ||
|
|
25279d009a | ||
|
|
3f72ca4bca | ||
|
|
70dc4957dc | ||
|
|
d8ed565bce | ||
|
|
a7f5c6c8f5 | ||
|
|
a8b023e57e | ||
|
|
47ca56f21b | ||
|
|
580a7b032f | ||
|
|
8fcc2bb7f5 | ||
|
|
d6fe58f84e | ||
|
|
2d54de09bb | ||
|
|
4e4d29f653 | ||
|
|
195c13ee8a | ||
|
|
ac5ef64701 | ||
|
|
e7dc24c026 | ||
|
|
155f26060d | ||
|
|
a87fe8d8bf | ||
|
|
158df6b2e8 | ||
|
|
b8db76c925 | ||
|
|
fffdfc9b88 | ||
|
|
6478409b05 | ||
|
|
ee556fd42e | ||
|
|
9a1b8a67d6 | ||
|
|
383e3ccd25 | ||
|
|
b4ce1fb599 | ||
|
|
2bf8e62580 | ||
|
|
afb439b089 | ||
|
|
78a87ad16b | ||
|
|
5bf55a69a5 | ||
|
|
ca782e2f20 | ||
|
|
308de35802 | ||
|
|
a9ac68a729 | ||
|
|
84d6b481ae | ||
|
|
613c8635a8 | ||
|
|
899a04ad26 | ||
|
|
d8dca2a3a9 | ||
|
|
8216899a9a | ||
|
|
b1d419f458 | ||
|
|
0417946153 | ||
|
|
1149578e8f | ||
|
|
37488ee82b | ||
|
|
06bbd501fd | ||
|
|
07e6c5cf69 | ||
|
|
d0c91e4acf | ||
|
|
114cdafe7e | ||
|
|
837bdecde8 | ||
|
|
d9d0e70e5b | ||
|
|
1255efba7f | ||
|
|
6ad397d4a9 | ||
|
|
570ca22d71 | ||
|
|
418f381b49 | ||
|
|
2cae37ccde | ||
|
|
650fbc2563 | ||
|
|
9ec26c60ff | ||
|
|
06204dfcd8 | ||
|
|
fbe40e005d | ||
|
|
e9efef9095 | ||
|
|
95c3181a35 | ||
|
|
12dbfb0777 | ||
|
|
b62dbd1f92 | ||
|
|
5011fde176 | ||
|
|
54cb9a33b1 | ||
|
|
f1fbcd863d | ||
|
|
b00b16aa3a | ||
|
|
0f19695225 | ||
|
|
7fcbe13669 | ||
|
|
87c91ec5c4 | ||
|
|
0e10916b07 | ||
|
|
21df87dedc | ||
|
|
fd26310d6a | ||
|
|
5762a5bc80 | ||
|
|
8106e67f14 | ||
|
|
f029fb3c65 | ||
|
|
44da684d1d | ||
|
|
64c1a4fc8c | ||
|
|
ec47459410 | ||
|
|
c55c3657c3 | ||
|
|
8b56b55761 | ||
|
|
9056c9276f | ||
|
|
09ae312f09 | ||
|
|
d6960c72e4 | ||
|
|
b529e054cf | ||
|
|
b4a4ca81d1 | ||
|
|
c284df2dc9 | ||
|
|
18b2a4c204 | ||
|
|
e1303fb592 | ||
|
|
bd25cf04ed | ||
|
|
ce1f4cbbdc | ||
|
|
e0aea0f27a | ||
|
|
9848c4c56c | ||
|
|
cb8149f8ea | ||
|
|
0e74e82a38 | ||
|
|
15e09f2b24 | ||
|
|
2de8256863 | ||
|
|
aff43fb1a3 | ||
|
|
cafd8e2b1e | ||
|
|
3794080327 | ||
|
|
4e2683f068 | ||
|
|
6e5f595d48 | ||
|
|
2c24ba6d2d | ||
|
|
3bb27fbee6 | ||
|
|
ef1b52eee5 | ||
|
|
f917fa67aa | ||
|
|
386b4c82da | ||
|
|
a987f22cfb | ||
|
|
558c42ec83 | ||
|
|
309ac46b98 | ||
|
|
399b04596e | ||
|
|
75513a23a8 | ||
|
|
e672de036e | ||
|
|
6533af6a91 | ||
|
|
d3372e69ec | ||
|
|
f3809a52e8 | ||
|
|
c5f5ab5363 | ||
|
|
26dfb868e9 | ||
|
|
d5b6042118 | ||
|
|
1115705cbc | ||
|
|
161d17d85b | ||
|
|
5a2ebfcd4a | ||
|
|
06a974df36 | ||
|
|
2762c45569 | ||
|
|
fd85483ce3 | ||
|
|
0a2d0c3b5c | ||
|
|
de7f9a4bd9 | ||
|
|
c5836c8090 | ||
|
|
dcdda314e2 | ||
|
|
a9edd57fe2 | ||
|
|
cbd9fad94b | ||
|
|
bc1009f8c2 | ||
|
|
719b66e5ed | ||
|
|
5f09ba4e10 | ||
|
|
517a0cb673 | ||
|
|
7c79b07817 | ||
|
|
23eed4ff2f | ||
|
|
4559886d83 | ||
|
|
bfc706a596 | ||
|
|
9805a461eb | ||
|
|
bcf8433ba8 | ||
|
|
746dd057b9 | ||
|
|
b710297d05 | ||
|
|
0a8e8cec0f | ||
|
|
96e5a23727 | ||
|
|
611b925368 | ||
|
|
cab2a74740 | ||
|
|
fa3ac22a8f | ||
|
|
95d1048789 | ||
|
|
38b2b8a143 | ||
|
|
3d0bc85b4d | ||
|
|
25a391070b | ||
|
|
926c4a7d04 | ||
|
|
5683f55646 | ||
|
|
671f4e943e | ||
|
|
282c0da941 | ||
|
|
78648f1faf | ||
|
|
8d9b5e4775 | ||
|
|
996026e5ed | ||
|
|
2c7e1db5f6 | ||
|
|
2171b38551 | ||
|
|
afdbdb02a1 | ||
|
|
8adeaa2c7e | ||
|
|
d15f605129 | ||
|
|
252fe42612 | ||
|
|
67e1c7dc72 | ||
|
|
c29ffc38e6 | ||
|
|
4d61cc87cf | ||
|
|
2350018106 | ||
|
|
8fc3dd9457 | ||
|
|
d97ca9fcb2 | ||
|
|
e523da9e12 | ||
|
|
67706cec4e | ||
|
|
fac8c32cda | ||
|
|
1c6f426363 | ||
|
|
8cba65809c | ||
|
|
77ed4f98bb | ||
|
|
848e5ac5de | ||
|
|
9448c5e16f | ||
|
|
0722495434 | ||
|
|
d545c6d73c | ||
|
|
f69fea4210 | ||
|
|
4cd0a4ced4 | ||
|
|
0804cc0cff | ||
|
|
faeee7528f | ||
|
|
261e0cfd5a | ||
|
|
66ecb56cea | ||
|
|
79bd54f610 | ||
|
|
30cef4d5fd | ||
|
|
8d52032263 | ||
|
|
4a5786334b | ||
|
|
587698a6f3 | ||
|
|
927d2cc824 | ||
|
|
7f9cb4e68d | ||
|
|
d48ea4f22c | ||
|
|
412bd2ec20 | ||
|
|
1c189060c2 | ||
|
|
4a00a3c0f5 | ||
|
|
8366e4ca83 | ||
|
|
283db76e45 | ||
|
|
8a36ed4f6f | ||
|
|
d0f45155c8 | ||
|
|
9fc235d670 | ||
|
|
42c549274f | ||
|
|
2e56182a7f | ||
|
|
7932b1849b | ||
|
|
886374d779 | ||
|
|
d42e2e391f | ||
|
|
f264eaeda2 | ||
|
|
35fd74af6d | ||
|
|
4b53cf1464 | ||
|
|
26e78efbb9 | ||
|
|
157f0b8a83 | ||
|
|
d743cf308e | ||
|
|
f4cdcb995c | ||
|
|
75139961a3 | ||
|
|
3e2dd59a94 | ||
|
|
c01386b5b4 | ||
|
|
f59a072aa6 | ||
|
|
9cb8447673 | ||
|
|
e67355ab0e | ||
|
|
9cb9b670d1 | ||
|
|
3e725bb2db | ||
|
|
cc45930ef9 | ||
|
|
3266daa8fd | ||
|
|
ce17b0eeca | ||
|
|
17a65d82bb | ||
|
|
cc7646665c | ||
|
|
82216ebf8b | ||
|
|
49e0d83d5d | ||
|
|
673c3c7a55 | ||
|
|
5135041405 | ||
|
|
42631b85c7 | ||
|
|
9f6f12cfeb | ||
|
|
6c4c9ec1f2 | ||
|
|
4bb4db0668 | ||
|
|
505fdd02ca | ||
|
|
a873f260cf | ||
|
|
b45f761227 | ||
|
|
d7a3039c2a | ||
|
|
6c5589c9d2 | ||
|
|
645ea5a057 | ||
|
|
2755ebe883 | ||
|
|
4b829b5ff9 | ||
|
|
ed19340af0 | ||
|
|
2d05ff0190 | ||
|
|
0d338fa4c0 | ||
|
|
15a66e7b7d | ||
|
|
3a21999a17 | ||
|
|
08dcd05d7b | ||
|
|
2337cc653b | ||
|
|
0deb9262c9 | ||
|
|
9bc5be837b | ||
|
|
b79d5494f9 | ||
|
|
ded2c5bf68 | ||
|
|
bd2c64876f | ||
|
|
7c66fef63f | ||
|
|
4ad8818809 | ||
|
|
2f4342810d | ||
|
|
36df56b093 | ||
|
|
d0a1e8e311 | ||
|
|
1b50381852 | ||
|
|
3443d2c129 | ||
|
|
1f83efa8f2 | ||
|
|
a7bd39b62a | ||
|
|
1177b30a60 | ||
|
|
10e56e0de7 | ||
|
|
6f3339cc49 | ||
|
|
771be0e056 | ||
|
|
71ad4fc406 | ||
|
|
6a5695d059 | ||
|
|
aaf0e7db06 | ||
|
|
7aa0aba382 | ||
|
|
9af190a43c | ||
|
|
2e46bc0aea | ||
|
|
a413aae8a3 | ||
|
|
317cc5c544 | ||
|
|
41bf162306 | ||
|
|
43c27dffd2 | ||
|
|
8f299838f7 | ||
|
|
146a0b29c0 | ||
|
|
964bc7fbe0 | ||
|
|
75aa3cc9bd | ||
|
|
0843fefad3 | ||
|
|
371a780ef4 | ||
|
|
c7db69a30c | ||
|
|
b48cda7173 | ||
|
|
0608cf1476 | ||
|
|
f335e78d1e | ||
|
|
dcfb228c9a | ||
|
|
dc99bbb0af | ||
|
|
c42273a4db | ||
|
|
3bf489cd7c | ||
|
|
d8240f9ee4 | ||
|
|
2448cf2a14 | ||
|
|
004883bdb1 | ||
|
|
11a1191ba0 | ||
|
|
ff66595f7a | ||
|
|
9de2a342e8 | ||
|
|
562f8bc84a | ||
|
|
d69411f414 | ||
|
|
39ccb15880 | ||
|
|
d2c56f9f96 | ||
|
|
7f1a0ce94a | ||
|
|
32dbf83747 | ||
|
|
d9d8b9c526 | ||
|
|
9036bf3398 | ||
|
|
bef5cea48e | ||
|
|
84abf7c95a | ||
|
|
1f0e1bec0e | ||
|
|
8f88613a6b | ||
|
|
e5f332bd71 | ||
|
|
07589cfc34 | ||
|
|
68e0306e62 | ||
|
|
5751686fdc | ||
|
|
2af20f8df8 | ||
|
|
60c1301fca | ||
|
|
b8a7319212 | ||
|
|
6ef4d04b46 | ||
|
|
1dce2b98b4 | ||
|
|
86c4897c9b | ||
|
|
2237603677 | ||
|
|
6e81596609 | ||
|
|
4607c7ed04 | ||
|
|
63638eb447 | ||
|
|
c92ac84679 | ||
|
|
ed9cd9f0e5 | ||
|
|
7d30dbebc5 | ||
|
|
8f03c80ce8 | ||
|
|
ee0366af88 | ||
|
|
683a3cb3ec | ||
|
|
f8bca4fbcb | ||
|
|
1e2a1d9ce5 | ||
|
|
1feac2069b | ||
|
|
26ee6b6dde | ||
|
|
c150ca4889 | ||
|
|
e717e349d0 | ||
|
|
e158017086 | ||
|
|
36d068871d | ||
|
|
6c67a4b500 | ||
|
|
86b43dc605 | ||
|
|
300921a93e | ||
|
|
35b52c4656 | ||
|
|
878302a622 | ||
|
|
55277738d4 | ||
|
|
2f54732500 | ||
|
|
41da298b18 | ||
|
|
ebcf8c2b6b | ||
|
|
1facfd019b | ||
|
|
00e3a752c9 | ||
|
|
d03fd3f883 | ||
|
|
fa3d13ac7e | ||
|
|
434bd5a5bb | ||
|
|
9aca389bda | ||
|
|
69ce42b22c | ||
|
|
114cc776be | ||
|
|
5e5cff897f | ||
|
|
a8bedb6ab9 | ||
|
|
81430bd3bd | ||
|
|
93203f355a | ||
|
|
b730d286ad | ||
|
|
3f2296e3ea | ||
|
|
2b7eb4906a | ||
|
|
db1aa4d02e | ||
|
|
ad88d7a3e0 | ||
|
|
e42c1c9c7a | ||
|
|
556bb2386d | ||
|
|
1e58cef174 | ||
|
|
01010e443f | ||
|
|
da0a7a765e | ||
|
|
9769a0dcdb | ||
|
|
fbff4fa218 | ||
|
|
d17ec56e54 | ||
|
|
9a5f75dba7 | ||
|
|
ca149fb796 | ||
|
|
08f19e074b | ||
|
|
36388cafe9 | ||
|
|
8191c747b9 | ||
|
|
d078763fa1 | ||
|
|
412ead5f2d | ||
|
|
513175ce23 | ||
|
|
8db6dd995a | ||
|
|
4be6970bd4 | ||
|
|
fa681ce246 | ||
|
|
dd5cd97713 | ||
|
|
89d47d26f0 | ||
|
|
d574ceb598 | ||
|
|
92e2f5ca8e | ||
|
|
f2bc792178 | ||
|
|
8ed096f938 | ||
|
|
3405dbf90e | ||
|
|
ee0c5e24bb | ||
|
|
b320f1c7e3 | ||
|
|
6c6b1c0606 | ||
|
|
a5f5add630 | ||
|
|
8557105c40 | ||
|
|
24e7ffb289 | ||
|
|
0b9bcfe01d | ||
|
|
1a0e8f810b | ||
|
|
7698f0672d | ||
|
|
da064ea702 | ||
|
|
0c65289a80 | ||
|
|
95c90a785f | ||
|
|
42c3754dcd | ||
|
|
b742200442 | ||
|
|
3ac70f7cc2 | ||
|
|
104722a56a | ||
|
|
1924beeb20 | ||
|
|
70f6f9a711 | ||
|
|
f1ceefe9a6 | ||
|
|
e1fc1566f3 | ||
|
|
189f74a40d | ||
|
|
370c9b38c0 | ||
|
|
df65c10360 | ||
|
|
4573389da7 | ||
|
|
5c55c1d8a1 | ||
|
|
a1d4e53eb8 | ||
|
|
16b6484c65 | ||
|
|
2156fd4909 | ||
|
|
7f5fbe1dc7 | ||
|
|
2e9090d121 | ||
|
|
23f2690c54 | ||
|
|
5226cd2a0b | ||
|
|
c7e8a82d68 | ||
|
|
77bec1261e | ||
|
|
dfcb24061e | ||
|
|
f85b0c6208 | ||
|
|
e490a30a4a | ||
|
|
654b652530 | ||
|
|
8f4426fbc8 | ||
|
|
32c1e59622 | ||
|
|
e56957f047 | ||
|
|
3cc357bffa | ||
|
|
388faa2c54 | ||
|
|
ce9ed993c8 | ||
|
|
929a13d4cd | ||
|
|
56f0d678e3 | ||
|
|
02645277c8 | ||
|
|
5f4e98e0d9 | ||
|
|
e9e14834bc | ||
|
|
5a57d6308e | ||
|
|
cb73d562d5 | ||
|
|
6c61690ef3 | ||
|
|
bf1f6a997c | ||
|
|
90b29aa808 | ||
|
|
31d0468cd2 | ||
|
|
38f467bae3 | ||
|
|
5c7c4bb9a8 | ||
|
|
9646ec4edd | ||
|
|
c665796c52 | ||
|
|
a72e2ecb3f | ||
|
|
0c47558729 | ||
|
|
93b9288c30 | ||
|
|
9d31a67116 | ||
|
|
cf19036ce6 | ||
|
|
7219ee6532 | ||
|
|
d7bc846c3c | ||
|
|
1adb0a9886 | ||
|
|
8aa01c9c8e | ||
|
|
23dabad0b0 | ||
|
|
45c675bd78 | ||
|
|
860c6ecbcc | ||
|
|
3f38091421 | ||
|
|
7704b3fc7b | ||
|
|
151b3c4021 | ||
|
|
610af95ed1 | ||
|
|
018ef5bd53 | ||
|
|
200eae3bc0 | ||
|
|
9321e425a4 | ||
|
|
9395c0dadc | ||
|
|
a40065878b | ||
|
|
e8d3c0a99a | ||
|
|
2e6ff1b750 | ||
|
|
15f9e397dd | ||
|
|
87a109d0e9 | ||
|
|
f3ffbe167d | ||
|
|
89a34e7508 | ||
|
|
f6fc750f08 | ||
|
|
c32f686c62 | ||
|
|
2ca83efc36 | ||
|
|
06796745ff | ||
|
|
093d531509 | ||
|
|
a915815e4d | ||
|
|
de3c28104c | ||
|
|
d9d13a6204 | ||
|
|
d1f5820711 | ||
|
|
7592f8f189 | ||
|
|
ffbb61713a | ||
|
|
6f51c1ba33 | ||
|
|
cd861345b7 | ||
|
|
823502a40a | ||
|
|
4efad0bb95 | ||
|
|
922352e215 | ||
|
|
8a0b2dc0be | ||
|
|
7eced34e20 | ||
|
|
64d00c1c8e | ||
|
|
6d48798d45 | ||
|
|
0e186835b9 | ||
|
|
b607eb9678 | ||
|
|
85a68f1e56 | ||
|
|
45d13bc295 | ||
|
|
2231401483 | ||
|
|
2abe9e6fd9 | ||
|
|
20f56dfc77 | ||
|
|
67664406da | ||
|
|
0ed60d29cb | ||
|
|
04ee39467a | ||
|
|
1f3edf6eba | ||
|
|
a15c197547 | ||
|
|
13dbeb75c7 | ||
|
|
6aded60045 | ||
|
|
8dfdf64dd5 | ||
|
|
41e8bddaa9 | ||
|
|
fd3dec8efe | ||
|
|
55ee08f42b | ||
|
|
b6ff697ff0 | ||
|
|
925ac1e1b9 | ||
|
|
77acc1c2be | ||
|
|
ebe489c227 | ||
|
|
9c152a030a | ||
|
|
b310c86c55 | ||
|
|
c9ff7d2130 | ||
|
|
52456230cc | ||
|
|
4422533adb | ||
|
|
c4b13f2b7f | ||
|
|
4f05a03d13 | ||
|
|
7a2e586cce | ||
|
|
98ce424650 | ||
|
|
3059a3da4e | ||
|
|
d63d7cb9a8 | ||
|
|
f3f542e864 | ||
|
|
93ada250f7 | ||
|
|
d8e3ba3b54 | ||
|
|
a46348da38 | ||
|
|
36cf0eb922 | ||
|
|
63a9bc94f7 | ||
|
|
2dafc4cf4f | ||
|
|
68d09f9cad | ||
|
|
b98d3d3f00 | ||
|
|
3683cf7ddc | ||
|
|
84e5e601e1 | ||
|
|
a1da149211 | ||
|
|
74405e9684 | ||
|
|
2fac507453 | ||
|
|
51ed55cc32 | ||
|
|
de2a3bd5f8 | ||
|
|
981e9700be | ||
|
|
b52ce4f9f2 | ||
|
|
64c591da7f | ||
|
|
2387648a85 | ||
|
|
846ecff0c5 | ||
|
|
26a5b59c28 | ||
|
|
6ddb39fda3 | ||
|
|
1fdcec985a | ||
|
|
30f526c943 | ||
|
|
253127cb9f | ||
|
|
3237ca587f | ||
|
|
0dbc0ae6d5 | ||
|
|
7461ff4680 | ||
|
|
afc714e1d3 | ||
|
|
3bc0db8d91 | ||
|
|
d573da5b2c | ||
|
|
ecd5a3fdf9 | ||
|
|
543d63e7a9 | ||
|
|
7a22ae6bf9 | ||
|
|
ebe23d6882 | ||
|
|
33c805aee0 | ||
|
|
244b6fcef6 | ||
|
|
616ff4ae25 | ||
|
|
e221eaa977 | ||
|
|
eed7abb839 | ||
|
|
5f6dcd36ed | ||
|
|
f395054536 | ||
|
|
afeafc8aa7 | ||
|
|
f1ece658f8 | ||
|
|
b3abb355eb | ||
|
|
5877b69d51 | ||
|
|
5ec2c1b712 | ||
|
|
0a73ed7d64 | ||
|
|
abf349fb0d | ||
|
|
3185fad918 | ||
|
|
0ab0f0ea44 | ||
|
|
ac467c7a2d | ||
|
|
c85b74497b | ||
|
|
3381a92d92 | ||
|
|
a2ee58d8a1 | ||
|
|
051f3720ce | ||
|
|
f017e1e9a1 | ||
|
|
33ba6896a8 | ||
|
|
f4d3ae6f70 | ||
|
|
860f3559a1 | ||
|
|
d8be8a7293 | ||
|
|
9750a361c9 | ||
|
|
ed3dd81d04 | ||
|
|
bef1aebf1c | ||
|
|
26688ba35d | ||
|
|
a1158feeb8 | ||
|
|
aef014a47d | ||
|
|
d6a0947e5a | ||
|
|
bc94318d83 | ||
|
|
d4c6e58b57 | ||
|
|
66832cf0a5 | ||
|
|
bcfe817212 | ||
|
|
07d72f950b | ||
|
|
dddfa3a075 | ||
|
|
74019877a4 | ||
|
|
465d82a92f | ||
|
|
49f889bf09 | ||
|
|
5e477e3b5b | ||
|
|
67cfad6a2c | ||
|
|
487e81fe3c | ||
|
|
18f525ac54 | ||
|
|
e0c184e097 | ||
|
|
78716ab8b9 | ||
|
|
8d082c13e0 | ||
|
|
196dc2a659 | ||
|
|
4fe797d704 | ||
|
|
3c188164ab | ||
|
|
5330370076 | ||
|
|
eecc73ea1a | ||
|
|
8c73c0795e | ||
|
|
7d68aa8f04 | ||
|
|
a0cd96e05e | ||
|
|
b19c90b9a6 | ||
|
|
e427712cb0 | ||
|
|
9864b191b1 | ||
|
|
e7574f119e | ||
|
|
51b6d16dc6 | ||
|
|
34d27ed45c | ||
|
|
094100bbf6 | ||
|
|
c8873d34af | ||
|
|
f0d640961a | ||
|
|
3746befd88 | ||
|
|
a8b037669a | ||
|
|
d819036daa | ||
|
|
6d41046b15 | ||
|
|
7b7203c149 | ||
|
|
95d4061b2a | ||
|
|
375b57a96a | ||
|
|
12ace4329d | ||
|
|
09e0be0e39 | ||
|
|
cd4bcea894 | ||
|
|
1bee151fe3 | ||
|
|
f5e52e748f | ||
|
|
b7f6c7c76a | ||
|
|
bc7f6209d8 | ||
|
|
372a548c28 | ||
|
|
5aad105c73 | ||
|
|
f40c83d025 | ||
|
|
83054af46f | ||
|
|
cb81f11422 | ||
|
|
a849f3c9ec | ||
|
|
25d854dc5c | ||
|
|
9963261d8d | ||
|
|
459ab3bbdc | ||
|
|
a21d4d3ac4 | ||
|
|
4da1f0da6f | ||
|
|
17bbe2637a | ||
|
|
6c6bbe5747 | ||
|
|
18b16e06ca | ||
|
|
e37cfc64d2 | ||
|
|
77510f4a3b | ||
|
|
d35e3c25b6 | ||
|
|
62eedbb8f6 | ||
|
|
5617bffe2f | ||
|
|
8adab2c6ca | ||
|
|
d0c44431d0 | ||
|
|
282a61ce51 | ||
|
|
7a1d22ff15 | ||
|
|
0dff71a410 | ||
|
|
26f30bff28 | ||
|
|
e6775e713c | ||
|
|
69f9122bef | ||
|
|
fc254fc744 | ||
|
|
845c43137a | ||
|
|
aaf2b6032e | ||
|
|
c4928c646d | ||
|
|
f12fe54d2b | ||
|
|
fc03c0266a | ||
|
|
7b042de300 | ||
|
|
681aad7e0d | ||
|
|
f22fa992f7 | ||
|
|
992e6f72cf | ||
|
|
e6ee3c772c | ||
|
|
9d716f0f7d | ||
|
|
95ed95c616 | ||
|
|
bf36f33e79 | ||
|
|
58ab8319b9 | ||
|
|
a87cb77ce8 | ||
|
|
2be45a35b4 | ||
|
|
9b636fdc10 | ||
|
|
b1903f0fbf | ||
|
|
00f5b78160 | ||
|
|
d58061473e | ||
|
|
33cb925f2e | ||
|
|
c70ca7f57b | ||
|
|
a6dab5e300 | ||
|
|
7cafec0750 | ||
|
|
4b12d52ef5 | ||
|
|
300612c5a8 | ||
|
|
856925d19b | ||
|
|
cbbcbb1fd7 | ||
|
|
bce93d60bd | ||
|
|
69e51aebab | ||
|
|
8ac133f2ee | ||
|
|
67996929e0 | ||
|
|
ccf119206d | ||
|
|
bc63f10057 | ||
|
|
6f15306766 | ||
|
|
161d83af5b | ||
|
|
3bf3b894ea | ||
|
|
536f08f33a | ||
|
|
3dd7410bb7 | ||
|
|
93d5be097a | ||
|
|
6eb9044353 | ||
|
|
612d34930b | ||
|
|
5be320368c | ||
|
|
7f2ad4ac7e | ||
|
|
0f00f4968c | ||
|
|
37b2c6a830 | ||
|
|
e86db3001f | ||
|
|
7b6ec4fc6c | ||
|
|
67dfa38e60 | ||
|
|
2eca9fc8af | ||
|
|
b5e5efc131 | ||
|
|
80ea13437d | ||
|
|
bf86b45178 | ||
|
|
4885fdf0f9 | ||
|
|
b7704833e4 | ||
|
|
ca7b46511d | ||
|
|
18864afa8a | ||
|
|
5ba75df507 | ||
|
|
9cf700e85d | ||
|
|
9172696324 | ||
|
|
49626ba709 | ||
|
|
baee6f3de0 | ||
|
|
28ab2f6048 | ||
|
|
90d4d339db | ||
|
|
6e0014e138 | ||
|
|
8080625747 | ||
|
|
21fb501699 | ||
|
|
0cd3a1b9bd | ||
|
|
8de483a45b | ||
|
|
3ea87169ac | ||
|
|
42d16d8296 | ||
|
|
adf3ae004f | ||
|
|
fced1172c4 | ||
|
|
299e98776e | ||
|
|
b803505402 | ||
|
|
8fb9795d04 | ||
|
|
d8623d6818 | ||
|
|
6c58a4c46c | ||
|
|
19f67e167c | ||
|
|
00d8df6fc3 | ||
|
|
02068aec7f | ||
|
|
3493d317e4 | ||
|
|
a2b486a5b0 | ||
|
|
3d0f8bdc39 | ||
|
|
04644102f2 | ||
|
|
f833cc80df | ||
|
|
df0142678a | ||
|
|
800240550b | ||
|
|
15cf7dd416 | ||
|
|
2c05fc858a | ||
|
|
a024c7665c | ||
|
|
cbb4749996 | ||
|
|
4b0d9f71e8 | ||
|
|
218c56f9a6 | ||
|
|
a35eda3d2a | ||
|
|
8a0e3e2f3d | ||
|
|
12a3d51bcc | ||
|
|
60367d95dd | ||
|
|
bd0e157b91 | ||
|
|
1821f68ca0 | ||
|
|
b5ac546275 | ||
|
|
46689df668 | ||
|
|
e828d0d3f7 | ||
|
|
cce0e5ea38 | ||
|
|
042e314589 | ||
|
|
61d813bfef | ||
|
|
ecee5cf801 | ||
|
|
9e4e913bf7 | ||
|
|
98fc528d8e | ||
|
|
d1cd2d1674 | ||
|
|
b593fe9c3e | ||
|
|
6ca6725f6e | ||
|
|
1d203fdb3c | ||
|
|
3f30699131 | ||
|
|
22bd9c4993 | ||
|
|
4654701c10 | ||
|
|
8a67ddcb2b | ||
|
|
ab71f17c47 | ||
|
|
f314abcfe1 | ||
|
|
2d1a22705f | ||
|
|
e74e577029 | ||
|
|
aa0ae610c6 | ||
|
|
dc6c4bf22e | ||
|
|
a7a5f0161f | ||
|
|
739fe1c2c4 | ||
|
|
3ba975466c | ||
|
|
d14a585cc9 | ||
|
|
7f7a7df3a2 | ||
|
|
5d5f40a82f | ||
|
|
ae6b029543 | ||
|
|
bb2bd76f91 | ||
|
|
4e1e166c6a | ||
|
|
5ff35d9984 | ||
|
|
c6a426a885 | ||
|
|
11103268e9 | ||
|
|
b332b1ae23 | ||
|
|
7e70e5f503 | ||
|
|
99fa23040a | ||
|
|
adeebec32a | ||
|
|
b93ef23d3f | ||
|
|
4002bee0c1 | ||
|
|
ed6fda6968 | ||
|
|
2ae13c5583 | ||
|
|
821dabb138 | ||
|
|
9d468f6da0 | ||
|
|
3a8ddf736e | ||
|
|
720c7b7519 | ||
|
|
0de83c4a51 | ||
|
|
8c073993ef | ||
|
|
a79ab41782 | ||
|
|
f509526e5c | ||
|
|
896199c9d4 | ||
|
|
08672cdf0a | ||
|
|
8163723e22 | ||
|
|
32a5f812a9 | ||
|
|
372874e89a | ||
|
|
8ebb8ee304 | ||
|
|
3d58254462 | ||
|
|
95de411a81 | ||
|
|
439d17569d | ||
|
|
8bcdba1a14 | ||
|
|
37e5f07d83 | ||
|
|
3c68b12176 | ||
|
|
63dc4b39bc | ||
|
|
0ea099bfd5 | ||
|
|
310776671b | ||
|
|
4b84de400b | ||
|
|
8677da2a72 | ||
|
|
de828b723e | ||
|
|
a515761193 | ||
|
|
784dad866f | ||
|
|
403e6f7e5c | ||
|
|
27f7c7fd88 | ||
|
|
4f59644cc2 | ||
|
|
c3f1d34b71 | ||
|
|
f8f20899a3 | ||
|
|
a319b0a0b4 | ||
|
|
604ddc0f9d | ||
|
|
126cabacb8 | ||
|
|
f78ae969e9 | ||
|
|
d1479072ae | ||
|
|
9a56e53d50 | ||
|
|
7899654675 | ||
|
|
a79c1bda9b | ||
|
|
665fae8343 | ||
|
|
6bee188f24 | ||
|
|
82dbcbb12a | ||
|
|
76c146f326 | ||
|
|
fd4ab3f262 | ||
|
|
cfbd3652ef | ||
|
|
e9c14979a4 | ||
|
|
e9f979b67b | ||
|
|
a323b8f63a | ||
|
|
9411c14fd2 | ||
|
|
8525e7542f | ||
|
|
7dabbc5462 | ||
|
|
de18cd1523 | ||
|
|
36a1560117 | ||
|
|
b5f311d6bc | ||
|
|
83dd4362aa | ||
|
|
a71cab639b | ||
|
|
5e0155ae29 | ||
|
|
afef83b1c6 | ||
|
|
9db13aac72 | ||
|
|
9a1f891998 | ||
|
|
7bb7ed468a | ||
|
|
4fc61d260f | ||
|
|
1ceb6926b7 | ||
|
|
d33c82cb66 | ||
|
|
4c66c35ed6 | ||
|
|
54db1d8915 | ||
|
|
a0ed80d821 | ||
|
|
e65913d376 | ||
|
|
2f266d946b | ||
|
|
b6ac4ad837 | ||
|
|
42f0282f14 | ||
|
|
af739d2f57 | ||
|
|
fa2aca1cbc | ||
|
|
943e5fe699 | ||
|
|
d09670d208 | ||
|
|
83b4b8d9c1 | ||
|
|
d32a7c1888 | ||
|
|
d0c1b73fb3 | ||
|
|
90ac15748e | ||
|
|
6be2077d92 | ||
|
|
456d439e97 | ||
|
|
2723553593 | ||
|
|
23de4c7aca | ||
|
|
ce14964943 | ||
|
|
e133476c35 | ||
|
|
524dc64ab7 | ||
|
|
17da5f45be | ||
|
|
42cd021d04 | ||
|
|
433d2f4c7d | ||
|
|
be8f5778a1 | ||
|
|
ef98a85b05 | ||
|
|
b4bd4ff67d | ||
|
|
930a5cd12a | ||
|
|
7e3701b64a | ||
|
|
165d17f7f7 | ||
|
|
3939cb614e | ||
|
|
377cf36be3 | ||
|
|
8b6652a40b | ||
|
|
479d726774 | ||
|
|
1fcc9717bb | ||
|
|
c35b3ea5c7 | ||
|
|
15beeef6ce | ||
|
|
92bc3cd0a7 | ||
|
|
0a9f971e44 | ||
|
|
4a3bbd0319 | ||
|
|
89e1446131 | ||
|
|
b694a97edf | ||
|
|
13ed184efd | ||
|
|
f03a05f6bb | ||
|
|
a6903651fc | ||
|
|
b8c544cc98 | ||
|
|
243725aae1 | ||
|
|
0bb59b2e22 | ||
|
|
837d44391c | ||
|
|
691ec08586 | ||
|
|
5425394654 | ||
|
|
1d82569f6d | ||
|
|
f74228830d | ||
|
|
a9e3329c39 | ||
|
|
a3e4e8e5cd | ||
|
|
898febcec5 | ||
|
|
855909b4e9 | ||
|
|
85d65a2fd2 | ||
|
|
cd9b0c9a20 | ||
|
|
0e11ca9b76 | ||
|
|
fd38dd02ce | ||
|
|
474418f03c | ||
|
|
6b9fea6f1a | ||
|
|
02894ca4a4 | ||
|
|
7d19209fa1 | ||
|
|
a6b4e8ff67 | ||
|
|
38c3ef3da0 | ||
|
|
610f2cc254 | ||
|
|
a79a3210e6 | ||
|
|
39ede26b5c | ||
|
|
c3f206733f | ||
|
|
69481d1590 | ||
|
|
6877668cab | ||
|
|
dc520bd156 | ||
|
|
bc4a343502 | ||
|
|
fbc8884693 | ||
|
|
c50c534d19 | ||
|
|
45627b485f | ||
|
|
b6fa121f53 | ||
|
|
9b31ffaa9f | ||
|
|
39e300640e | ||
|
|
2ffc1537e7 | ||
|
|
64abc90d30 | ||
|
|
788505095e | ||
|
|
98432395c3 | ||
|
|
6b89624f33 | ||
|
|
4b28b4fed4 | ||
|
|
fea4dbba50 | ||
|
|
83d2c440d5 | ||
|
|
e6d855b954 | ||
|
|
9f64c34f1a | ||
|
|
638ed15ada | ||
|
|
c0d8b95f67 | ||
|
|
c65938d53c | ||
|
|
2e3f3a55f1 | ||
|
|
cdd0f78bc6 | ||
|
|
9fac20ceef | ||
|
|
38bd08d25f | ||
|
|
b44493e7f2 | ||
|
|
f6ec8d2e33 | ||
|
|
c170d323d9 | ||
|
|
3ce123ab69 | ||
|
|
d8b7a51ab6 | ||
|
|
344a2bfc1a | ||
|
|
86588419fb | ||
|
|
d09db09849 | ||
|
|
1e5a8561c0 | ||
|
|
f3c9578bca | ||
|
|
3741afa6dc | ||
|
|
560a006892 | ||
|
|
4774e45218 | ||
|
|
206ee87188 | ||
|
|
a7e048484b | ||
|
|
d6b5f2f5da | ||
|
|
3df560ea38 | ||
|
|
adbaf700cd | ||
|
|
4a41bff3ab | ||
|
|
b453b0ea95 | ||
|
|
0192a7af96 | ||
|
|
630ad38a67 | ||
|
|
21156fc2a2 | ||
|
|
fa99f5bc03 | ||
|
|
09aa1e7af4 | ||
|
|
2034ed387b | ||
|
|
d6140d6d54 | ||
|
|
fb54bd3fcf | ||
|
|
a486ee347a | ||
|
|
5fb3582b31 | ||
|
|
8b0b9db31e | ||
|
|
f9889f81d6 | ||
|
|
efafa52719 | ||
|
|
8bda59fbe7 | ||
|
|
c3788d765e | ||
|
|
e407558f76 | ||
|
|
042df4198a | ||
|
|
ab6f35d83a | ||
|
|
f20d85738f | ||
|
|
f9b56a8581 | ||
|
|
fedc8ed474 | ||
|
|
79aeb31088 | ||
|
|
04857d32cd | ||
|
|
109cdce92c | ||
|
|
b7554d9ed8 | ||
|
|
6106f1a32e | ||
|
|
f2a8307bb6 | ||
|
|
470ee7aef9 | ||
|
|
aefca48e78 | ||
|
|
5e792078b3 | ||
|
|
7f7d2fd5b3 | ||
|
|
5e435b41ba | ||
|
|
44cfce1ca4 | ||
|
|
bb175cc958 | ||
|
|
5a9fb6eaf7 | ||
|
|
54d35ddfe9 | ||
|
|
7beccb7997 | ||
|
|
14a78f55cd | ||
|
|
7617a9316e | ||
|
|
a52ed366e4 | ||
|
|
7be164e2a5 | ||
|
|
a24f25c0d8 | ||
|
|
993b238a41 | ||
|
|
bbbfc8201c | ||
|
|
6f03a4d6ce | ||
|
|
c8958a22d2 | ||
|
|
37afa2180b | ||
|
|
b2df8e478a | ||
|
|
50fccb52be | ||
|
|
b90e719da5 | ||
|
|
97f1723181 | ||
|
|
80e0a3cce4 | ||
|
|
79effae933 | ||
|
|
810056349f | ||
|
|
b1d490ea53 | ||
|
|
345637290b | ||
|
|
9628df3031 | ||
|
|
423f338d04 | ||
|
|
3a2597e5c4 | ||
|
|
641f261495 | ||
|
|
5884a6e7a6 | ||
|
|
10e979e841 | ||
|
|
8dc1441635 | ||
|
|
c79dcfad9a | ||
|
|
1886952666 | ||
|
|
7326b246b7 | ||
|
|
345c812e43 | ||
|
|
fd4ba3989e | ||
|
|
e2d2571ad0 | ||
|
|
d479a0585d | ||
|
|
addfae31b6 | ||
|
|
ccf61db726 | ||
|
|
5b86b2078a | ||
|
|
a069479340 | ||
|
|
d11bf9288e | ||
|
|
86eeb4d2ed | ||
|
|
2275fe59ab | ||
|
|
48be8c33ba | ||
|
|
d3d07128b2 | ||
|
|
37eeccbf4c | ||
|
|
1722fc537f | ||
|
|
b240b182cb | ||
|
|
c0f347fc8c | ||
|
|
53dbe58ada | ||
|
|
2c4b798f9b | ||
|
|
1cf14a8e94 | ||
|
|
4864bf1509 | ||
|
|
9934421442 | ||
|
|
d7267c1603 | ||
|
|
5c778c6d32 | ||
|
|
85797acf1e | ||
|
|
c4f5c11a4e | ||
|
|
5a1c3dbea3 | ||
|
|
8e439d3dd9 | ||
|
|
9ebf921c53 | ||
|
|
7bd9094aaa | ||
|
|
16cc395f78 | ||
|
|
13e7398566 | ||
|
|
8b90ee4364 | ||
|
|
1098ab732f | ||
|
|
507fdd4f40 | ||
|
|
0ae8d7ac08 | ||
|
|
c77df2d1eb | ||
|
|
cefae021db | ||
|
|
771aee8cd8 | ||
|
|
2d13d8b3b6 | ||
|
|
c1fa70639b | ||
|
|
12643c5986 | ||
|
|
a0f5613a23 | ||
|
|
824562357b | ||
|
|
ec7184c533 | ||
|
|
e8e2502e2f | ||
|
|
c86cfefc48 | ||
|
|
2635fe8b4c | ||
|
|
632436d54d | ||
|
|
74be6828dd | ||
|
|
f4acfed48f | ||
|
|
91e1c1bea8 | ||
|
|
bbb9a41ea4 | ||
|
|
f6418887b2 | ||
|
|
a3f8a097a1 | ||
|
|
751563644f | ||
|
|
e52b801cd0 | ||
|
|
445a6428a6 | ||
|
|
d59b26dad7 | ||
|
|
47417d1871 | ||
|
|
381aecb952 | ||
|
|
45344575c6 | ||
|
|
83381625bd | ||
|
|
552fb16cb2 | ||
|
|
75c631f080 | ||
|
|
e2464fdf62 | ||
|
|
9ff98073db | ||
|
|
98ee5def37 | ||
|
|
3649487f5e | ||
|
|
4b007ae740 | ||
|
|
6c79a60e19 | ||
|
|
2a94bfc703 | ||
|
|
299934fd2a | ||
|
|
b18d042832 | ||
|
|
97a10ec218 | ||
|
|
d35400a7d7 | ||
|
|
92f6ec2328 | ||
|
|
9ba2019470 | ||
|
|
c171d88194 | ||
|
|
7cfcbacfc7 | ||
|
|
52847b61a3 | ||
|
|
5a36559834 | ||
|
|
19d4e047f6 | ||
|
|
6b348d43c6 | ||
|
|
732cd27d2e | ||
|
|
8171fe4571 | ||
|
|
16daa57e47 | ||
|
|
5e5addcdbf | ||
|
|
be65c8303f | ||
|
|
231250f2eb | ||
|
|
d44a428b74 | ||
|
|
40f9d52ad8 | ||
|
|
7f3b05c179 | ||
|
|
09c9fad6c3 | ||
|
|
bb18479d5b | ||
|
|
779ea8ac62 | ||
|
|
bd7c7ddad0 | ||
|
|
c6fdcf9b0d | ||
|
|
59fe74ddf6 | ||
|
|
6d7c067461 | ||
|
|
316205e455 | ||
|
|
834ae0a93f | ||
|
|
d562f11298 | ||
|
|
972628c751 | ||
|
|
09b1db63f4 | ||
|
|
e9d54f752c | ||
|
|
c335025167 | ||
|
|
2b2109c89a | ||
|
|
56124546a6 | ||
|
|
336258ecf8 | ||
|
|
b894d2c04a | ||
|
|
8e1d4818ac | ||
|
|
28c98584c1 | ||
|
|
1c42780bb5 | ||
|
|
18554dfed7 | ||
|
|
2e493fec46 | ||
|
|
98c2e08add | ||
|
|
94d3dee369 | ||
|
|
7e7dd769fd | ||
|
|
79da96b369 | ||
|
|
78fcabade8 | ||
|
|
284645f505 | ||
|
|
0b349761a8 | ||
|
|
d18794931a | ||
|
|
b7d4ff3201 | ||
|
|
4c6d674e03 | ||
|
|
2c97af8021 | ||
|
|
832f75a55e | ||
|
|
4e77969545 | ||
|
|
6ebbbfee61 | ||
|
|
0fabeefc3e | ||
|
|
c70d72f06b | ||
|
|
cc141bf1a5 | ||
|
|
199532c802 | ||
|
|
28ee3d0949 | ||
|
|
925195725d | ||
|
|
f6d22df76e | ||
|
|
118858a55e | ||
|
|
656c1291b1 | ||
|
|
f00b8dd1c3 | ||
|
|
5f2b9e317a | ||
|
|
4ae5ba7fc4 | ||
|
|
3656eed9ad | ||
|
|
2e82a6ce03 | ||
|
|
c4b8a3b768 | ||
|
|
1147b83b22 | ||
|
|
0fb8eade13 | ||
|
|
78d11fe628 | ||
|
|
90b40fc3e6 | ||
|
|
e25e268e2e | ||
|
|
68bff31cc9 | ||
|
|
31d9545702 | ||
|
|
e449071a35 | ||
|
|
23e3724abb | ||
|
|
75a5c7013f | ||
|
|
56d24085f9 | ||
|
|
95b82af42a | ||
|
|
87dedde5d6 | ||
|
|
8b6489c60e | ||
|
|
bf4f05fff3 | ||
|
|
b0aaa25f0d | ||
|
|
c3ddc7579a | ||
|
|
fdff579188 | ||
|
|
d48793c22c | ||
|
|
001b2aa9f9 | ||
|
|
1db098c05d | ||
|
|
324b1b5575 | ||
|
|
e42878eeda | ||
|
|
eb6814d74e | ||
|
|
6ad35aca4a | ||
|
|
70f154be8b | ||
|
|
4342b28882 | ||
|
|
5394b1fa1b | ||
|
|
5ab0a63fd6 | ||
|
|
1618aba5f2 | ||
|
|
8377528952 | ||
|
|
34dcf02dee | ||
|
|
5d7d7f15d9 | ||
|
|
0c023fb4d2 | ||
|
|
1bd068d42d | ||
|
|
e42349c963 | ||
|
|
878835e4bd | ||
|
|
8096a1d67f | ||
|
|
e16c5d5f70 | ||
|
|
2c8242c8df | ||
|
|
e7d6f89aca | ||
|
|
379f5db516 | ||
|
|
ee32315378 | ||
|
|
cca912af4e | ||
|
|
86ea077092 | ||
|
|
5d6aabc457 | ||
|
|
b14ce959d9 | ||
|
|
a48ebd9b47 | ||
|
|
3cd85eaaf1 | ||
|
|
ec3f6c9c42 | ||
|
|
143ff14466 | ||
|
|
6070c3d1d5 | ||
|
|
bc8b2d4ae0 | ||
|
|
14f777da18 | ||
|
|
6f6681ce67 | ||
|
|
06602b4ec0 | ||
|
|
cf98cff2a1 | ||
|
|
b4fec57b6d | ||
|
|
f8b5a63de3 | ||
|
|
568316f07c | ||
|
|
daa597b300 | ||
|
|
47adb2a3fc | ||
|
|
fff0012249 | ||
|
|
d5a1883b62 | ||
|
|
a08ef43e40 | ||
|
|
bc5e15996a | ||
|
|
128ca800cd | ||
|
|
000d133af6 | ||
|
|
1e40d65aa9 | ||
|
|
bffbe68ec3 | ||
|
|
58b10074ad | ||
|
|
d933ead2b5 | ||
|
|
1cdc30c5e8 | ||
|
|
3661f7a321 | ||
|
|
27af9b102c | ||
|
|
500c61685b | ||
|
|
106d960f84 | ||
|
|
322fa19ceb | ||
|
|
5bea0b6086 | ||
|
|
a5970d7548 | ||
|
|
c216144dd1 | ||
|
|
42e08da7ca | ||
|
|
a2edbbf78a | ||
|
|
1e86dc1d93 | ||
|
|
54f295be52 | ||
|
|
8bc3c0a07c | ||
|
|
d75bc20174 | ||
|
|
fd8751658f | ||
|
|
4db5a1a0b8 | ||
|
|
4c52777ef0 | ||
|
|
d4c7bf20a2 | ||
|
|
affe1300d9 | ||
|
|
62d5984b1b | ||
|
|
c32551b4e0 | ||
|
|
e85f7e7aa9 | ||
|
|
7b0f6b7905 | ||
|
|
0894ce9dc3 | ||
|
|
4fd2e961b6 | ||
|
|
b9fbfeff67 | ||
|
|
5dd24b3ef0 | ||
|
|
62828fc5c1 | ||
|
|
a6aa6360e0 | ||
|
|
c4f6c06f44 | ||
|
|
0d80a9b897 | ||
|
|
f70930b1a0 | ||
|
|
9ff4f66f55 | ||
|
|
32ca631b74 | ||
|
|
2e81084f35 | ||
|
|
a0a7b05c9f | ||
|
|
2f6e4edcdb | ||
|
|
1bd9f455fc | ||
|
|
2e3c5d4c5b | ||
|
|
8413075249 | ||
|
|
6ba00e6aee | ||
|
|
de4fac33dc | ||
|
|
c9984669a7 | ||
|
|
63755c31ff | ||
|
|
161f5f5cee | ||
|
|
c7073a1fc0 | ||
|
|
e7b4fc70e7 | ||
|
|
457982e1d2 | ||
|
|
aa558e6080 | ||
|
|
fe11d3cbbd | ||
|
|
1ce223a83b | ||
|
|
3676310efe | ||
|
|
ddf866c4c7 | ||
|
|
9e07a197e9 | ||
|
|
1c175e3a67 | ||
|
|
47fb7cd3a8 | ||
|
|
e879814e43 | ||
|
|
a4733eed90 | ||
|
|
38fbc4fcbb | ||
|
|
c6fe91bfa5 | ||
|
|
7383f05e45 | ||
|
|
3aac51c81f | ||
|
|
f0a7850edf | ||
|
|
4336ca69c7 | ||
|
|
4bca5e838b | ||
|
|
bc981d0261 | ||
|
|
b1d33e6b49 | ||
|
|
38d442edf6 | ||
|
|
72625dc72a | ||
|
|
cc2f152d70 | ||
|
|
f74dc38766 | ||
|
|
7d9665d8d2 | ||
|
|
a0e85cc17c | ||
|
|
29b02f9e56 | ||
|
|
24c986c842 | ||
|
|
4f4d15c28a | ||
|
|
fa3e48c59f | ||
|
|
02f6afa51b | ||
|
|
10143e0ac7 | ||
|
|
8f3429939f | ||
|
|
00094c43d1 | ||
|
|
8bf15fa691 | ||
|
|
63dc503b8d | ||
|
|
430c316e45 | ||
|
|
01f5a9ff84 | ||
|
|
af52eed0dd | ||
|
|
f93d0fa957 | ||
|
|
c06a1d007a | ||
|
|
65bd749918 | ||
|
|
510eb53f53 | ||
|
|
507543a482 | ||
|
|
16bb007135 | ||
|
|
1ffb6bd5d0 | ||
|
|
799a4c9ab6 | ||
|
|
b2722650d4 | ||
|
|
54b06d7abc | ||
|
|
fef1bbb1a7 | ||
|
|
3206bf59df | ||
|
|
a33f2c0f5b | ||
|
|
8b8dfc46eb | ||
|
|
06aab389ed | ||
|
|
fb0ebb5bf0 | ||
|
|
925726222f | ||
|
|
550e7edb64 | ||
|
|
2992dea5c8 | ||
|
|
e76e4bd964 | ||
|
|
7d621389ee | ||
|
|
35efe3b41c | ||
|
|
e5ffc59cd5 | ||
|
|
d7f9d2bde9 | ||
|
|
5feece64c1 | ||
|
|
b9a09129fa | ||
|
|
96e6bbe3a1 | ||
|
|
fe39185894 | ||
|
|
fc860787dd | ||
|
|
63e35574d4 | ||
|
|
db2dbf15f7 | ||
|
|
f5977dac75 | ||
|
|
8f2746fe24 | ||
|
|
41b9bc9984 | ||
|
|
1ccd4360b4 | ||
|
|
bf864b2c54 | ||
|
|
4abaf71234 | ||
|
|
a4aba23a83 | ||
|
|
cae0cf3546 | ||
|
|
38f9e18afb | ||
|
|
9d83da830f | ||
|
|
00959fac57 | ||
|
|
40cb17d299 | ||
|
|
2ae293aeb6 | ||
|
|
d8ead78e03 | ||
|
|
b2c6eca2c8 | ||
|
|
872ab91421 | ||
|
|
a263e54b94 | ||
|
|
18c99a5c5f | ||
|
|
d55fc39275 | ||
|
|
ba8ed7967d | ||
|
|
f44af49df9 | ||
|
|
3c67bae868 | ||
|
|
3dade534fd | ||
|
|
8b1a509442 | ||
|
|
8bdb9aa607 | ||
|
|
36c624ec71 | ||
|
|
7fd871a74d | ||
|
|
ced8f0f4a2 | ||
|
|
388ebcbae2 | ||
|
|
20891abe1c | ||
|
|
6ce6f62b8e | ||
|
|
602728895e | ||
|
|
fc995ea6b9 | ||
|
|
be6262c6ce | ||
|
|
893490f94e | ||
|
|
044bb6afa5 | ||
|
|
3eb4d88057 | ||
|
|
23fd1d032a | ||
|
|
7cb7cf848d | ||
|
|
bef300305e | ||
|
|
dc700c25b6 | ||
|
|
0ba93e5ba9 | ||
|
|
0da481f207 | ||
|
|
d75a235c1f | ||
|
|
9e92759ac7 | ||
|
|
ffc2d82b0e | ||
|
|
d8ed1bfc60 | ||
|
|
d711f5a81e | ||
|
|
fa2bc60468 | ||
|
|
e1c5673ac3 | ||
|
|
1b1ed820c3 | ||
|
|
a73711f3cd | ||
|
|
9397bf54b8 | ||
|
|
fbbdd31399 | ||
|
|
b5540dc35c | ||
|
|
296a66558f | ||
|
|
af968d4903 | ||
|
|
5c7b9ef909 | ||
|
|
185d369404 | ||
|
|
51d20b19b6 | ||
|
|
46e8c6b112 | ||
|
|
c8fb25201a | ||
|
|
1fd483643b | ||
|
|
a21a0864f1 | ||
|
|
4457bf7528 | ||
|
|
5ed6f18d83 | ||
|
|
abb3d56b20 | ||
|
|
c5ecb9bae0 | ||
|
|
1b68152fb2 | ||
|
|
6812f397af | ||
|
|
68bd9c6091 | ||
|
|
754f9e3a20 | ||
|
|
b951b11336 | ||
|
|
89c90bedb9 | ||
|
|
b4fe7d7c7d | ||
|
|
5071710db7 | ||
|
|
9faaf3fc88 | ||
|
|
9c51c133f7 | ||
|
|
91d2fb6b1c | ||
|
|
280406c0d7 | ||
|
|
d5fc3b5e99 | ||
|
|
f8f8c7e534 | ||
|
|
3a642d50a4 | ||
|
|
9685c68e30 | ||
|
|
95e6ec091b | ||
|
|
34f5e4a199 | ||
|
|
788baafa26 | ||
|
|
4c31813398 | ||
|
|
b7bae80616 | ||
|
|
f7e4aa51d3 | ||
|
|
696c50459f | ||
|
|
50b6d7298c | ||
|
|
26a81654a8 | ||
|
|
6430371d7d | ||
|
|
18705b3f18 | ||
|
|
c6bd2bb7fb | ||
|
|
c4fd94bd1a | ||
|
|
b88b952f56 | ||
|
|
d68b02d36a | ||
|
|
b9b85eb208 | ||
|
|
1f898405a6 | ||
|
|
6f6910101e | ||
|
|
79d55357e8 | ||
|
|
4fa6c0ad53 | ||
|
|
8f63f9516b | ||
|
|
995ba2c7c2 | ||
|
|
830e3be1e6 | ||
|
|
29a314a092 | ||
|
|
abdba5fdc7 | ||
|
|
b2ae715699 | ||
|
|
a95c748363 | ||
|
|
ec859e41c6 | ||
|
|
7aeae9da81 | ||
|
|
2ca11ccc6b | ||
|
|
d74ae669e3 | ||
|
|
9fabc5572d | ||
|
|
da98a2102a | ||
|
|
fb3353b854 | ||
|
|
b7e5c54593 | ||
|
|
68beec5590 | ||
|
|
6ba06d1eb4 | ||
|
|
0f11e311c4 | ||
|
|
886a01c796 | ||
|
|
a632b9f86a | ||
|
|
76b1885595 | ||
|
|
c55b409cf6 | ||
|
|
c64193f839 | ||
|
|
28a2a795ba | ||
|
|
e90adfc7c3 | ||
|
|
16267dc021 | ||
|
|
e7266b52ae | ||
|
|
dc02610408 | ||
|
|
dc1bfe4a93 | ||
|
|
cf69daaafb | ||
|
|
49ee7505ed | ||
|
|
ae2b2cb9a5 | ||
|
|
8c2f287ce4 | ||
|
|
2351f36315 | ||
|
|
5ecae10713 | ||
|
|
2e3d657794 | ||
|
|
90f990b806 | ||
|
|
7666d48409 | ||
|
|
be4cb190e8 | ||
|
|
2f4eca8c46 | ||
|
|
71564fa1de | ||
|
|
ce08cb6cd7 | ||
|
|
1f0cf6311a | ||
|
|
1db468b6c3 | ||
|
|
534de5ba81 | ||
|
|
492186716f | ||
|
|
07fda48cee | ||
|
|
4b31be5203 | ||
|
|
5d69c7ade1 | ||
|
|
2bfea15fdc | ||
|
|
96b0699621 | ||
|
|
6cbef84cad | ||
|
|
55fcc44c8c | ||
|
|
16a66b5326 | ||
|
|
3590e76a1c | ||
|
|
0ec3fdd3ba | ||
|
|
c0f0b66509 | ||
|
|
0f9df32d11 | ||
|
|
a370c8be4b | ||
|
|
d6e0bc698e | ||
|
|
8d8b1d4307 | ||
|
|
771b3377c0 | ||
|
|
8dbfdd59b0 | ||
|
|
cd03882536 | ||
|
|
0b154a2a1a | ||
|
|
e82de99e5a | ||
|
|
27b379c1e3 | ||
|
|
f9517e9143 | ||
|
|
e05dee6df5 | ||
|
|
3fad492c6f | ||
|
|
b7d6ae93e3 | ||
|
|
21b1b75b08 | ||
|
|
bbe0353b23 | ||
|
|
51e2654cd2 | ||
|
|
09b2510219 | ||
|
|
57ce75eb67 | ||
|
|
cde9389e75 | ||
|
|
2c19bd5ea3 | ||
|
|
ff34198569 | ||
|
|
919469c8fe | ||
|
|
1ce8b530cd | ||
|
|
2fb6018078 | ||
|
|
6d56cbb3e8 | ||
|
|
1a93319093 | ||
|
|
28b4fb12b6 | ||
|
|
5dabc0aca8 | ||
|
|
4f1bdde32e | ||
|
|
a08ca5b1b5 | ||
|
|
87d5883ddb | ||
|
|
d5acade4db | ||
|
|
9d1c23e4f5 | ||
|
|
17cb59efbd | ||
|
|
118befd7d7 | ||
|
|
0d9fe6e49c | ||
|
|
ebae3553e0 | ||
|
|
d3ff831b8a | ||
|
|
4d7c5ec089 | ||
|
|
81a6b746b8 | ||
|
|
f356a75a24 | ||
|
|
7212fa8630 | ||
|
|
6cabc44841 | ||
|
|
b108bd1c1e | ||
|
|
077a8c1f95 | ||
|
|
7a874d5b97 | ||
|
|
9086a794a1 | ||
|
|
6dd2b9c2ec | ||
|
|
3fbe4511f9 | ||
|
|
3933fc3ad3 | ||
|
|
00b05e2394 | ||
|
|
d5e8c5e975 | ||
|
|
478dfb0639 | ||
|
|
f498e40208 | ||
|
|
182f5f5d7b | ||
|
|
e5719de657 | ||
|
|
8486a83cf5 | ||
|
|
ccfad57fca | ||
|
|
64128b699a | ||
|
|
4080fbb95c | ||
|
|
14ec83c886 | ||
|
|
122c4618b9 | ||
|
|
2af82975cd | ||
|
|
35f4695b67 | ||
|
|
3c9e09545e | ||
|
|
764a41b973 | ||
|
|
9d103503f7 | ||
|
|
09f4d767e4 | ||
|
|
dd301cf5ac | ||
|
|
eacabb0e96 | ||
|
|
6cda021d9b | ||
|
|
d2bd6aa78d | ||
|
|
6b306f30b6 | ||
|
|
c48fd18344 | ||
|
|
8ea7e04363 | ||
|
|
32c2d2b248 | ||
|
|
111cca8c9a | ||
|
|
7ae9c3a9f0 | ||
|
|
bf4320a7d6 | ||
|
|
3a0a4b9175 | ||
|
|
4faefe156c | ||
|
|
86273f5e2a | ||
|
|
b4f64aa770 | ||
|
|
976c5e9121 | ||
|
|
db663dd92f | ||
|
|
90a5d23016 | ||
|
|
99e35d256a | ||
|
|
e14e7c6235 | ||
|
|
b46adbad22 | ||
|
|
afabbeb546 | ||
|
|
d14a3df10f | ||
|
|
9feb84e426 | ||
|
|
c7f40e3cee | ||
|
|
dd03aeb966 | ||
|
|
15b5906790 | ||
|
|
3ee8d9fa75 | ||
|
|
57db5819ef | ||
|
|
3c186f8030 | ||
|
|
db5e78c879 | ||
|
|
c7fd0a7af4 | ||
|
|
32683f73c7 | ||
|
|
7222235579 | ||
|
|
f6e894a53a | ||
|
|
b93ec2522e | ||
|
|
af7226393a | ||
|
|
e520613362 | ||
|
|
204fe20b4b | ||
|
|
a1f0fc1a10 | ||
|
|
68c3862270 | ||
|
|
5b7483ada5 | ||
|
|
72b01148d2 | ||
|
|
971df231b0 | ||
|
|
4b32cbe518 | ||
|
|
f08078ccca | ||
|
|
389138abfe | ||
|
|
a0ae4945cd | ||
|
|
b169e4c88c | ||
|
|
a60c34bded | ||
|
|
153dbb71b8 | ||
|
|
101a1f895d | ||
|
|
bd27310c68 | ||
|
|
42ecd535b3 | ||
|
|
c9838a02ce | ||
|
|
7ebcf602ac | ||
|
|
8eb85f1340 | ||
|
|
2a8e3741fa | ||
|
|
684378722c | ||
|
|
286a686f88 | ||
|
|
7360e6c5df | ||
|
|
fbe7be760b | ||
|
|
a3ce89aeff | ||
|
|
6a7e0d652b | ||
|
|
7cc4c53adb | ||
|
|
24b13a7a87 | ||
|
|
b6c2dbf69c | ||
|
|
0e0e9a6809 | ||
|
|
ed60154552 | ||
|
|
85589cf7dc | ||
|
|
99dcd10d3f | ||
|
|
745ae02f47 | ||
|
|
b6bd11f292 | ||
|
|
c60a0784ea | ||
|
|
3cb6f3e460 | ||
|
|
de37dc9300 | ||
|
|
8ffd7d9243 | ||
|
|
298ed11261 | ||
|
|
b9517c99ae | ||
|
|
db3ced17bb | ||
|
|
248b4cddab | ||
|
|
d81e152804 | ||
|
|
0cbf98c020 | ||
|
|
195f9f5ef3 | ||
|
|
a759c5b75b | ||
|
|
7dfe645b5f | ||
|
|
ca3283cbaa | ||
|
|
861e67dfe8 | ||
|
|
82ef02cd1a | ||
|
|
948217d5e9 | ||
|
|
6cc06828db | ||
|
|
0b2abfb115 | ||
|
|
b2f8fb6201 | ||
|
|
e2329c03fe | ||
|
|
9bca670b4e | ||
|
|
cb06d1f4ca | ||
|
|
36447c488a | ||
|
|
69092030cd | ||
|
|
109aa9c428 | ||
|
|
1d97816c53 | ||
|
|
7591c4fb42 | ||
|
|
60cbeb165e | ||
|
|
bddfc109f8 | ||
|
|
b05c379b39 | ||
|
|
7ba5283fe8 | ||
|
|
98fe5af07d | ||
|
|
59cb1d6c27 | ||
|
|
0ad1b28497 | ||
|
|
5f63d4ca1f | ||
|
|
90aaab77fc | ||
|
|
7158433cd3 | ||
|
|
e629a175ed | ||
|
|
45ea73913f | ||
|
|
01e0fd7e13 | ||
|
|
4cb6dc01f3 | ||
|
|
8f0885f6cb | ||
|
|
beb0fa0727 | ||
|
|
436cb9229b | ||
|
|
d78f0ba804 | ||
|
|
5b46fcad8e | ||
|
|
94fa7162be | ||
|
|
e6c2842b66 | ||
|
|
e6d9485c4a | ||
|
|
30cd2f2280 | ||
|
|
2c909c1f0c | ||
|
|
063a4cb403 | ||
|
|
42ec67f63c | ||
|
|
8c02786820 | ||
|
|
c26f323bf5 | ||
|
|
041ae67fd9 | ||
|
|
bfa6580ad5 | ||
|
|
52b76d1d01 | ||
|
|
a3767f9142 | ||
|
|
f62c784102 | ||
|
|
ffc221a87f | ||
|
|
8cf54a1317 | ||
|
|
77e287f669 | ||
|
|
5d95a72758 | ||
|
|
3475e1dfd6 | ||
|
|
504922ffbe | ||
|
|
c77877a934 | ||
|
|
27977411e9 | ||
|
|
b79c79fa73 | ||
|
|
cd0001b55a | ||
|
|
340e7f7210 | ||
|
|
f9c43137c9 | ||
|
|
171ed36e36 | ||
|
|
c6c907d451 | ||
|
|
19ab038724 | ||
|
|
1c26fd489d | ||
|
|
e8cfba1b10 | ||
|
|
496a3d29db | ||
|
|
438ed431dd | ||
|
|
f1f0032758 | ||
|
|
eb3b789855 | ||
|
|
c077050855 | ||
|
|
d9998bfab3 | ||
|
|
7cf9d459d6 | ||
|
|
de724aa576 | ||
|
|
8e53f63036 | ||
|
|
565356613a | ||
|
|
eda0900c8e | ||
|
|
3dd67083b2 | ||
|
|
2f73bb3643 | ||
|
|
9348fc5e15 | ||
|
|
97710ee9d1 | ||
|
|
9619cb3fe5 | ||
|
|
1c1e951826 | ||
|
|
88c57b4dc8 | ||
|
|
ba13cfd9ff | ||
|
|
1ff8751caa | ||
|
|
98dbc84836 | ||
|
|
0847964a27 | ||
|
|
bc09d7aedb | ||
|
|
04690ad8c4 | ||
|
|
ec636111ba | ||
|
|
e467b956ff | ||
|
|
ff5a237200 | ||
|
|
d6bcb7c8b7 | ||
|
|
57f5e6d898 | ||
|
|
612fd50612 | ||
|
|
a74e736283 | ||
|
|
86cd5ddd65 | ||
|
|
812de0545d | ||
|
|
3bed5516da | ||
|
|
0495dbe756 | ||
|
|
5d656891ba | ||
|
|
74122dc965 | ||
|
|
ee18a511c6 | ||
|
|
da20881096 | ||
|
|
aaabb46f20 | ||
|
|
49142eb6e5 | ||
|
|
73cbb6eb9a | ||
|
|
1f29475fa5 | ||
|
|
d586b95ff1 | ||
|
|
25557e5f14 | ||
|
|
197870e67a | ||
|
|
b8e39d2dde | ||
|
|
5dfa76a610 | ||
|
|
58c471c627 | ||
|
|
213bf7d19d | ||
|
|
12ae8a4ed3 | ||
|
|
8a93f8ed94 | ||
|
|
2712c5f90e | ||
|
|
72587b08fa | ||
|
|
faa85ded50 | ||
|
|
14e5bc7a17 | ||
|
|
f727620859 | ||
|
|
843d3a137c | ||
|
|
e4691005e2 | ||
|
|
4aba70caee | ||
|
|
5e989b9296 | ||
|
|
cba2d252c8 | ||
|
|
2ecec19df0 | ||
|
|
4ca7197826 | ||
|
|
a8ec250993 | ||
|
|
f3e0e401fd | ||
|
|
d60f89867b | ||
|
|
b133f2bc4c | ||
|
|
301fd7f7e8 | ||
|
|
45148c7078 | ||
|
|
3c75194448 | ||
|
|
f218e20522 | ||
|
|
33b038ce6f | ||
|
|
f62c65e9d9 | ||
|
|
867baab3d1 | ||
|
|
63ad0cb498 | ||
|
|
433017b990 | ||
|
|
d97aed8741 | ||
|
|
06d89e1d47 | ||
|
|
8676e45d88 | ||
|
|
992d3faac8 | ||
|
|
0947b61808 | ||
|
|
d43f30903c | ||
|
|
15a1666f8a | ||
|
|
25bdd7c6d9 | ||
|
|
ac116980ac | ||
|
|
b5480f6e36 | ||
|
|
17a8cc5e29 | ||
|
|
aeeee0d5da | ||
|
|
de03a0f924 | ||
|
|
5528918d5d | ||
|
|
9e0d5cb669 | ||
|
|
11622b2863 | ||
|
|
9610664fc5 | ||
|
|
eed2e3f2a8 | ||
|
|
1b62162e08 | ||
|
|
5cf573c340 | ||
|
|
76cd8bf258 | ||
|
|
31ba7e7cf0 | ||
|
|
a338ba695b | ||
|
|
9f6e2de4ed | ||
|
|
1b3acc4f8f | ||
|
|
56cf3b362e | ||
|
|
b59d01fe85 | ||
|
|
65d8770b28 | ||
|
|
38582c3e52 | ||
|
|
5f6fe6cab7 | ||
|
|
34f8e6ddf7 | ||
|
|
603367dced | ||
|
|
eaee87e73d | ||
|
|
ea844db847 | ||
|
|
3ca8cc0344 | ||
|
|
f67c06f128 | ||
|
|
7889509856 | ||
|
|
67c995aef6 | ||
|
|
e20defeebd | ||
|
|
cca646a19e | ||
|
|
ddc2b4b806 | ||
|
|
0334915067 | ||
|
|
987d60ccda | ||
|
|
7d520bf448 | ||
|
|
dc53288e6b | ||
|
|
db02673b60 | ||
|
|
cf9b248f29 | ||
|
|
df12954312 | ||
|
|
a9357b4dce | ||
|
|
63544db8f9 | ||
|
|
7295cad715 | ||
|
|
ff85da0a31 | ||
|
|
75b2d7ca99 | ||
|
|
3c9eeb11fa | ||
|
|
63bacaee2e | ||
|
|
5016eace34 | ||
|
|
2e5c8b5cd3 | ||
|
|
bf0f81adcb | ||
|
|
2db751700e | ||
|
|
62bee4ed37 | ||
|
|
1f07d63dc5 | ||
|
|
cc1af99dbd | ||
|
|
c5d98effc0 | ||
|
|
b68b2ff6b8 | ||
|
|
57f0d55c2e | ||
|
|
3cf763475f | ||
|
|
0f87da017f | ||
|
|
22800d7d59 | ||
|
|
f21853ea9d | ||
|
|
1e76d668bd | ||
|
|
b4b50eef15 | ||
|
|
a9ad390b9e | ||
|
|
2e9e961fff | ||
|
|
13180989d9 | ||
|
|
a4f1e40b72 | ||
|
|
04d485c550 | ||
|
|
a92bd1e2db | ||
|
|
f89e71a861 | ||
|
|
dcc075b34b | ||
|
|
49083c2597 | ||
|
|
29785ba166 | ||
|
|
ffb2c93ba3 | ||
|
|
30a6b6bdac | ||
|
|
cc345f531a | ||
|
|
9ede048769 | ||
|
|
d23bf6e659 | ||
|
|
6b60f0ab03 | ||
|
|
aa9923bf07 | ||
|
|
9160cce6d8 | ||
|
|
885dc0a8e1 | ||
|
|
7324431b12 | ||
|
|
021f2bef4c | ||
|
|
6260fef2e8 | ||
|
|
c7472662a6 | ||
|
|
fecfe62fc6 | ||
|
|
21b0430e46 | ||
|
|
66595c2d2b | ||
|
|
4ac29fb525 | ||
|
|
04d50a271d | ||
|
|
cbbda1ddf0 | ||
|
|
928c6245c9 | ||
|
|
ac9be161f6 | ||
|
|
33378dcf6e | ||
|
|
e31a1f7ef1 | ||
|
|
fa574ae9fd | ||
|
|
b2ebf4b4b7 | ||
|
|
0f5615b618 | ||
|
|
f050f898bc | ||
|
|
ce1c3bab6d | ||
|
|
5cdabc5173 | ||
|
|
42775f959b | ||
|
|
7f55dcef3a | ||
|
|
ba8accf4bb | ||
|
|
e62db51b06 | ||
|
|
b81894d3d5 | ||
|
|
d86cf6801f | ||
|
|
c0d21d0bd3 | ||
|
|
b838f66dd7 | ||
|
|
db9cc270b3 | ||
|
|
4147e04319 | ||
|
|
a888f6ff93 | ||
|
|
bd04c49bc1 | ||
|
|
5872b81232 | ||
|
|
abd20d3ca6 | ||
|
|
95f83b90d2 | ||
|
|
7a16909219 | ||
|
|
ee4684e6a9 | ||
|
|
a2b1a1eb33 | ||
|
|
7bc0fc9611 | ||
|
|
e0e18e2b6f | ||
|
|
788ba6d985 | ||
|
|
b012e15245 | ||
|
|
ba31456278 | ||
|
|
b661c66c00 | ||
|
|
f0372736aa | ||
|
|
e286d3f23d | ||
|
|
6c8a7b0a1a | ||
|
|
3107dc208a | ||
|
|
bf4d75458c | ||
|
|
3604d0d913 | ||
|
|
dd06638dec | ||
|
|
73a0ec22a3 | ||
|
|
b0ef84caae | ||
|
|
64899ef54b | ||
|
|
1064a9264e | ||
|
|
acfa7bec9c | ||
|
|
62b94e838b | ||
|
|
5236e7a03e | ||
|
|
7e9412a044 | ||
|
|
e47c19beb9 | ||
|
|
2fe3c654fc | ||
|
|
5ec48c66cb | ||
|
|
4e7ec92d6f | ||
|
|
e115de47fc | ||
|
|
bb5ffd3904 | ||
|
|
887ae7fcab | ||
|
|
abaaf942cb | ||
|
|
ff47f6f65d | ||
|
|
ca680fc9fc | ||
|
|
b04463bb2d | ||
|
|
c66f701232 | ||
|
|
3b23144ae6 | ||
|
|
f7a9462337 | ||
|
|
17f24d0061 | ||
|
|
eb8bce22b8 | ||
|
|
6a31691121 | ||
|
|
25c4bf6ed4 | ||
|
|
ec5743bcc0 | ||
|
|
7cd330ee55 | ||
|
|
7d2b6879c8 | ||
|
|
a40684162a | ||
|
|
cd997ff058 | ||
|
|
5391bb6cf7 | ||
|
|
6b8ce1ee74 | ||
|
|
a37d46ec25 | ||
|
|
b5c8237118 | ||
|
|
eeffe2caf4 | ||
|
|
c5c7a6a453 | ||
|
|
b969392f40 | ||
|
|
40bc1752c2 | ||
|
|
851c3779b5 | ||
|
|
2a717da850 | ||
|
|
f8694da3c9 | ||
|
|
eeb2b1f998 | ||
|
|
1db8f7e353 | ||
|
|
6625e93be6 | ||
|
|
56053988bf | ||
|
|
d9325dc11a | ||
|
|
d3ca9dd3f7 | ||
|
|
e552f6bce5 | ||
|
|
cf23e10382 | ||
|
|
c84e7e72f1 | ||
|
|
f2ff351da4 | ||
|
|
c5c242d193 | ||
|
|
72193a1c23 | ||
|
|
248d6b413a | ||
|
|
d04e87fb80 | ||
|
|
cc61b74cde | ||
|
|
915d362b11 | ||
|
|
f8a5f2964f | ||
|
|
a8dfbcef44 | ||
|
|
caea14d035 | ||
|
|
c5fc12e04b | ||
|
|
731c620e31 | ||
|
|
0dad470eb9 | ||
|
|
6947ab3a65 | ||
|
|
b219374d36 | ||
|
|
576ee5aaab | ||
|
|
4c9cfe2532 | ||
|
|
7fb62ea904 | ||
|
|
fe250d3ee8 | ||
|
|
6f55c67d16 | ||
|
|
3aa6e6a365 | ||
|
|
b8ced5d96b | ||
|
|
9e21c6a862 | ||
|
|
fe8566928e | ||
|
|
3600709116 | ||
|
|
df115c73b2 | ||
|
|
dbe025fe40 | ||
|
|
2b11a47a2f | ||
|
|
fb63a7418e | ||
|
|
2029931b95 | ||
|
|
91219bb3dd | ||
|
|
ab4fe4d58a | ||
|
|
8ff1f16b7f | ||
|
|
cf4f62c82c | ||
|
|
1d2f4264a2 | ||
|
|
9d506a4afa | ||
|
|
7ac22e9227 | ||
|
|
47f2fe724f | ||
|
|
130571fb29 | ||
|
|
da7218350b | ||
|
|
b6078de6f8 | ||
|
|
07430b0194 | ||
|
|
fae02fab00 | ||
|
|
a68cdc40be | ||
|
|
76b307f42a | ||
|
|
6e4b7eb966 | ||
|
|
770754ae2c | ||
|
|
a932855f6f | ||
|
|
72ee1abc90 | ||
|
|
9e1909643c | ||
|
|
77a1329285 | ||
|
|
be6ecc388c | ||
|
|
13dba94307 | ||
|
|
d51440bb5d | ||
|
|
d730e179bf | ||
|
|
559fe513fa | ||
|
|
5b20fa7e38 | ||
|
|
d16e75de91 | ||
|
|
6fd9994590 | ||
|
|
b9729f3b66 | ||
|
|
d6ff7475f1 | ||
|
|
984979d9bf | ||
|
|
73c449b97b | ||
|
|
1529666232 | ||
|
|
3816b86a9e | ||
|
|
a4b30fc649 | ||
|
|
fc50eb8688 | ||
|
|
071db1fae7 | ||
|
|
a163ea63c5 | ||
|
|
e21a707166 | ||
|
|
1b484fa90d | ||
|
|
06aa0f0b76 | ||
|
|
fb8bb30144 | ||
|
|
7429a33818 | ||
|
|
5b9f61cff8 | ||
|
|
4ff0e20e1f | ||
|
|
a692bfa8f9 | ||
|
|
49dd927406 | ||
|
|
4b21cc1737 | ||
|
|
7ae16f7302 | ||
|
|
73566a9f15 | ||
|
|
fbdf205ab4 | ||
|
|
83b2b4970d | ||
|
|
f29dc7d7ac | ||
|
|
4d5db74c18 | ||
|
|
8c7d285e03 | ||
|
|
1347abb1e7 | ||
|
|
2cb85e48b4 | ||
|
|
5be084e0f5 | ||
|
|
2323923bec | ||
|
|
0f54d42863 | ||
|
|
8201c7f46c | ||
|
|
ed22d640f4 | ||
|
|
01b009ff24 | ||
|
|
665b90bf5a | ||
|
|
4e1f245331 | ||
|
|
f8e1d39208 | ||
|
|
955dae5d4b | ||
|
|
b78cd3f4c9 | ||
|
|
6a3eb7edf2 | ||
|
|
0a710c0762 | ||
|
|
9a204f6284 | ||
|
|
7837970303 | ||
|
|
8cd9550295 | ||
|
|
840c692d5b | ||
|
|
05e0d3e2d4 | ||
|
|
7429ff9dce | ||
|
|
29602fe0cf | ||
|
|
1b95ec5591 | ||
|
|
3efe0dc8dc | ||
|
|
241e4af1b0 | ||
|
|
cac8a8df18 | ||
|
|
1181ceb735 | ||
|
|
f376f45277 | ||
|
|
d364afdf3b | ||
|
|
7ecfcf7eaa | ||
|
|
709c9bbe88 | ||
|
|
db175f606e | ||
|
|
3a664dc676 | ||
|
|
5f8d5f10a6 | ||
|
|
f02d4d9677 | ||
|
|
1889643eca | ||
|
|
4fc5c2024b | ||
|
|
354487d7f4 | ||
|
|
6478058946 | ||
|
|
8b8dcea3de | ||
|
|
64ace51e02 | ||
|
|
4cb5c67a44 | ||
|
|
2edefd9e80 | ||
|
|
fa8b16e7e7 | ||
|
|
2a953700e2 | ||
|
|
c1dc835b5c | ||
|
|
214f92c428 | ||
|
|
95fc680af9 | ||
|
|
22d0c6b5e1 | ||
|
|
ff1be13d0e | ||
|
|
a3201be7e7 | ||
|
|
37f0b51dff | ||
|
|
95d2dd74ad | ||
|
|
a175a25e6c | ||
|
|
6c406124dd | ||
|
|
0f17529486 | ||
|
|
dd10c867db | ||
|
|
8335dd3aa5 | ||
|
|
cd73ac7038 | ||
|
|
7cc33a839c | ||
|
|
828da6a425 | ||
|
|
2e5bdb8794 | ||
|
|
f56bac350b | ||
|
|
d373f16c81 | ||
|
|
ebffa15c7c | ||
|
|
6e4ee160ee | ||
|
|
a5697c5279 | ||
|
|
5abec720d8 | ||
|
|
84403b47cb | ||
|
|
4342a539af | ||
|
|
f4e744ade5 | ||
|
|
155d4c5591 | ||
|
|
f5cbe0e6ba |
7
.codespellrc
Normal file
7
.codespellrc
Normal file
@@ -0,0 +1,7 @@
|
||||
# https://github.com/codespell-project/codespell
|
||||
|
||||
[codespell]
|
||||
skip = ./man/nominatim.1,data,./docs/styles.css,lib-php,module,munin,osm2pgsql,./test,./settings/*.lua,./settings/*.yaml,./settings/**/*.yaml,./settings/icu-rules,./nominatim/tokenizer/token_analysis/config_variants.py
|
||||
# Need to be lowercase in the list
|
||||
# Unter = Unter den Linden (an example address)
|
||||
ignore-words-list = inout,unter
|
||||
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
github: lonvia
|
||||
custom: "https://nominatim.org/funding/"
|
||||
7
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
7
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
contact_links:
|
||||
- name: Nominatim Discussions
|
||||
url: https://github.com/osm-search/Nominatim/discussions
|
||||
about: Ask questions, get support, share ideas and discuss with community members.
|
||||
- name: Discussions about OpenStreetMap data
|
||||
url: https://community.openstreetmap.org/
|
||||
about: Ask questions about the data used by Nominatim and discuss with the OSM community.
|
||||
22
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
22
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Before opening a new feature request, please search through the open issue to check that your request hasn't been reported already. -->
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||
|
||||
**Describe the solution you'd like**
|
||||
<!-- A clear and concise description of what you want to happen. -->
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context or screenshots about the feature request here. -->
|
||||
39
.github/ISSUE_TEMPLATE/report-issues-with-search-results.md
vendored
Normal file
39
.github/ISSUE_TEMPLATE/report-issues-with-search-results.md
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
name: Report issues with search results
|
||||
about: You have searched something with Nominatim and did not get the expected result.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Note: this template is for reporting problems with searching. If you have found an issue with the data, you need to report/fix the issue directly in OpenStreetMap. See https://www.openstreetmap.org/fixthemap for details. -->
|
||||
|
||||
## What did you search for?
|
||||
|
||||
<!-- Please try to provide a link to your search. You can go to https://nominatim.openstreetmap.org and repeat your search there. If you originally found the issue somewhere else, please tell us what software/website you were using. -->
|
||||
|
||||
## What result did you get?
|
||||
|
||||
## What result did you expect?
|
||||
|
||||
**When the result in the right place and just named wrongly:**
|
||||
|
||||
<!-- Please tell us the display name you expected. -->
|
||||
|
||||
**When the result missing completely:**
|
||||
|
||||
<!-- Make sure that the data you are looking for is in OpenStreetMap. Provide a link to the OpenStreetMap object or if you cannot get it, a link to the map on https://openstreetmap.org where you expect the result to be.
|
||||
|
||||
To get the link to the OSM object, you can try the following:
|
||||
|
||||
* Go to [https://openstreetmap.org](https://openstreetmap.org).
|
||||
* Move to the area of the map where you expect the result and then zoom in as much as possible.
|
||||
* Click on the question mark on the right side of the map. You get a question cursor. Use it to click on the map where your object is located.
|
||||
* Find the object of interest in the list that appears on the left side.
|
||||
* Click on the object and report back the URL that the browser shows.
|
||||
-->
|
||||
|
||||
## Further details
|
||||
|
||||
<!-- Anything else we should know about the search. Particularities with addresses in the area etc. -->
|
||||
42
.github/ISSUE_TEMPLATE/report-problems-with-the-software.md
vendored
Normal file
42
.github/ISSUE_TEMPLATE/report-problems-with-the-software.md
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
name: Report problems with the software
|
||||
about: You have your own installation of Nominatim and found a bug.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Note: if you are installing Nominatim through a docker image, you should report issues with the installation process with the docker repository first.
|
||||
|
||||
Do not send screen shots! Copy any console output directly into the issue.
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
<!-- A clear and concise description of what the bug is.-->
|
||||
|
||||
**To Reproduce**
|
||||
<!-- Please describe what you did to get to the issue. -->
|
||||
|
||||
**Software Environment (please complete the following information):**
|
||||
- Nominatim version:
|
||||
- Postgresql version:
|
||||
- Postgis version:
|
||||
- OS:
|
||||
|
||||
**Hardware Configuration (please complete the following information):**
|
||||
- RAM:
|
||||
- number of CPUs:
|
||||
- type and size of disks:
|
||||
|
||||
**Postgresql Configuration:**
|
||||
|
||||
<!-- List any configuration items you changed in your postgresql configuration. -->
|
||||
|
||||
**Nominatim Configuration:**
|
||||
|
||||
<!-- List the contents of your customized `.env` file. -->
|
||||
|
||||
**Additional context**
|
||||
|
||||
<!-- Add any other context about the problem here. -->
|
||||
52
.github/actions/build-nominatim/action.yml
vendored
Normal file
52
.github/actions/build-nominatim/action.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: 'Build Nominatim'
|
||||
|
||||
inputs:
|
||||
flavour:
|
||||
description: 'Version of Ubuntu to install on'
|
||||
required: false
|
||||
default: 'ubuntu-20'
|
||||
cmake-args:
|
||||
description: 'Additional options to hand to cmake'
|
||||
required: false
|
||||
default: ''
|
||||
lua:
|
||||
description: 'Version of Lua to use'
|
||||
required: false
|
||||
default: '5.3'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: Clean out the disk
|
||||
run: |
|
||||
sudo rm -rf /opt/hostedtoolcache/go /opt/hostedtoolcache/CodeQL /usr/lib/jvm /usr/local/share/chromium /usr/local/lib/android
|
||||
df -h
|
||||
shell: bash
|
||||
- name: Install${{ matrix.flavour }} prerequisites
|
||||
run: |
|
||||
sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev libicu-dev liblua${LUA_VERSION}-dev lua${LUA_VERSION} lua-dkjson nlohmann-json3-dev libspatialite7 libsqlite3-mod-spatialite
|
||||
if [ "$FLAVOUR" == "oldstuff" ]; then
|
||||
pip3 install MarkupSafe==2.0.1 python-dotenv jinja2==2.8 psutil==5.4.2 pyicu==2.9 osmium PyYAML==5.1 sqlalchemy==1.4.31 psycopg==3.1.7 datrie asyncpg aiosqlite
|
||||
else
|
||||
sudo apt-get install -y -qq python3-icu python3-datrie python3-pyosmium python3-jinja2 python3-psutil python3-dotenv python3-yaml
|
||||
pip3 install sqlalchemy psycopg aiosqlite
|
||||
fi
|
||||
shell: bash
|
||||
env:
|
||||
FLAVOUR: ${{ inputs.flavour }}
|
||||
CMAKE_ARGS: ${{ inputs.cmake-args }}
|
||||
LUA_VERSION: ${{ inputs.lua }}
|
||||
|
||||
- name: Configure
|
||||
run: mkdir build && cd build && cmake $CMAKE_ARGS ../Nominatim
|
||||
shell: bash
|
||||
env:
|
||||
CMAKE_ARGS: ${{ inputs.cmake-args }}
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
make -j2 all
|
||||
sudo make install
|
||||
shell: bash
|
||||
working-directory: build
|
||||
49
.github/actions/setup-postgresql/action.yml
vendored
Normal file
49
.github/actions/setup-postgresql/action.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: 'Setup Postgresql and Postgis'
|
||||
|
||||
inputs:
|
||||
postgresql-version:
|
||||
description: 'Version of PostgreSQL to install'
|
||||
required: true
|
||||
postgis-version:
|
||||
description: 'Version of Postgis to install'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: Remove existing PostgreSQL
|
||||
run: |
|
||||
sudo apt-get purge -yq postgresql*
|
||||
sudo apt install curl ca-certificates gnupg
|
||||
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
|
||||
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
|
||||
sudo apt-get update -qq
|
||||
|
||||
shell: bash
|
||||
|
||||
- name: Install PostgreSQL
|
||||
run: |
|
||||
sudo apt-get install -y -qq --no-install-suggests --no-install-recommends postgresql-client-${PGVER} postgresql-${PGVER}-postgis-${POSTGISVER} postgresql-${PGVER}-postgis-${POSTGISVER}-scripts postgresql-contrib-${PGVER} postgresql-${PGVER}
|
||||
shell: bash
|
||||
env:
|
||||
PGVER: ${{ inputs.postgresql-version }}
|
||||
POSTGISVER: ${{ inputs.postgis-version }}
|
||||
|
||||
- name: Adapt postgresql configuration
|
||||
run: |
|
||||
echo 'fsync = off' | sudo tee /etc/postgresql/${PGVER}/main/conf.d/local.conf
|
||||
echo 'synchronous_commit = off' | sudo tee -a /etc/postgresql/${PGVER}/main/conf.d/local.conf
|
||||
echo 'full_page_writes = off' | sudo tee -a /etc/postgresql/${PGVER}/main/conf.d/local.conf
|
||||
echo 'shared_buffers = 1GB' | sudo tee -a /etc/postgresql/${PGVER}/main/conf.d/local.conf
|
||||
echo 'port = 5432' | sudo tee -a /etc/postgresql/${PGVER}/main/conf.d/local.conf
|
||||
shell: bash
|
||||
env:
|
||||
PGVER: ${{ inputs.postgresql-version }}
|
||||
|
||||
- name: Setup database
|
||||
run: |
|
||||
sudo systemctl restart postgresql
|
||||
sudo -u postgres createuser -S www-data
|
||||
sudo -u postgres createuser -s runner
|
||||
shell: bash
|
||||
423
.github/workflows/ci-tests.yml
vendored
Normal file
423
.github/workflows/ci-tests.yml
vendored
Normal file
@@ -0,0 +1,423 @@
|
||||
name: CI Tests
|
||||
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
create-archive:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
data/country_osm_grid.sql.gz
|
||||
key: nominatim-country-data-1
|
||||
|
||||
- name: Package tarball
|
||||
run: |
|
||||
if [ ! -f data/country_osm_grid.sql.gz ]; then
|
||||
wget --no-verbose -O data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
|
||||
fi
|
||||
cd ..
|
||||
tar czf nominatim-src.tar.bz2 Nominatim
|
||||
mv nominatim-src.tar.bz2 Nominatim
|
||||
|
||||
- name: 'Upload Artifact'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: full-source
|
||||
path: nominatim-src.tar.bz2
|
||||
retention-days: 1
|
||||
|
||||
tests:
|
||||
needs: create-archive
|
||||
strategy:
|
||||
matrix:
|
||||
flavour: [oldstuff, "ubuntu-20", "ubuntu-22"]
|
||||
include:
|
||||
- flavour: oldstuff
|
||||
ubuntu: 20
|
||||
postgresql: '9.6'
|
||||
postgis: '2.5'
|
||||
lua: '5.1'
|
||||
- flavour: ubuntu-20
|
||||
ubuntu: 20
|
||||
postgresql: 13
|
||||
postgis: 3
|
||||
lua: '5.3'
|
||||
- flavour: ubuntu-22
|
||||
ubuntu: 22
|
||||
postgresql: 15
|
||||
postgis: 3
|
||||
lua: '5.3'
|
||||
|
||||
runs-on: ubuntu-${{ matrix.ubuntu }}.04
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: full-source
|
||||
|
||||
- name: Unpack Nominatim
|
||||
run: tar xf nominatim-src.tar.bz2
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.7
|
||||
if: matrix.flavour == 'oldstuff'
|
||||
|
||||
- uses: ./Nominatim/.github/actions/setup-postgresql
|
||||
with:
|
||||
postgresql-version: ${{ matrix.postgresql }}
|
||||
postgis-version: ${{ matrix.postgis }}
|
||||
|
||||
- uses: ./Nominatim/.github/actions/build-nominatim
|
||||
with:
|
||||
flavour: ${{ matrix.flavour }}
|
||||
lua: ${{ matrix.lua }}
|
||||
|
||||
- name: Install test prerequisites (behave from apt)
|
||||
run: sudo apt-get install -y -qq python3-behave
|
||||
if: matrix.flavour == 'ubuntu-20'
|
||||
|
||||
- name: Install test prerequisites (behave from pip)
|
||||
run: pip3 install behave==1.2.6
|
||||
if: (matrix.flavour == 'oldstuff') || (matrix.flavour == 'ubuntu-22')
|
||||
|
||||
- name: Install test prerequisites (from apt for Ununtu 2x)
|
||||
run: sudo apt-get install -y -qq python3-pytest python3-pytest-asyncio uvicorn
|
||||
if: matrix.flavour != 'oldstuff'
|
||||
|
||||
- name: Install newer pytest-asyncio
|
||||
run: pip3 install -U pytest-asyncio
|
||||
if: matrix.flavour == 'ubuntu-20'
|
||||
|
||||
- name: Install test prerequisites (from pip for Ubuntu 18)
|
||||
run: pip3 install pytest pytest-asyncio uvicorn
|
||||
if: matrix.flavour == 'oldstuff'
|
||||
|
||||
- name: Install Python webservers
|
||||
run: pip3 install falcon starlette asgi_lifespan
|
||||
|
||||
- name: Install latest pylint
|
||||
run: pip3 install -U pylint
|
||||
if: matrix.flavour == 'ubuntu-22'
|
||||
|
||||
- name: Python linting
|
||||
run: python3 -m pylint src
|
||||
working-directory: Nominatim
|
||||
if: matrix.flavour == 'ubuntu-22'
|
||||
|
||||
- name: Python unit tests
|
||||
run: python3 -m pytest test/python
|
||||
working-directory: Nominatim
|
||||
|
||||
- name: BDD tests
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/build/osm2pgsql:$PATH
|
||||
python3 -m behave -DREMOVE_TEMPLATE=1 --format=progress3
|
||||
working-directory: Nominatim/test/bdd
|
||||
|
||||
- name: Install mypy and typechecking info
|
||||
run: pip3 install -U mypy osmium uvicorn types-PyYAML types-jinja2 types-psycopg2 types-psutil types-requests types-ujson types-Pygments typing-extensions
|
||||
if: matrix.flavour != 'oldstuff'
|
||||
|
||||
- name: Python static typechecking
|
||||
run: python3 -m mypy --strict src
|
||||
working-directory: Nominatim
|
||||
if: matrix.flavour != 'oldstuff'
|
||||
|
||||
legacy-test:
|
||||
needs: create-archive
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
postgresql: ["13", "16"]
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: full-source
|
||||
|
||||
- name: Unpack Nominatim
|
||||
run: tar xf nominatim-src.tar.bz2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
|
||||
- uses: ./Nominatim/.github/actions/setup-postgresql
|
||||
with:
|
||||
postgresql-version: ${{ matrix.postgresql }}
|
||||
postgis-version: 3
|
||||
|
||||
- name: Install Postgresql server dev
|
||||
run: sudo apt-get install postgresql-server-dev-$PGVER
|
||||
env:
|
||||
PGVER: ${{ matrix.postgresql }}
|
||||
|
||||
- uses: ./Nominatim/.github/actions/build-nominatim
|
||||
with:
|
||||
cmake-args: -DBUILD_MODULE=on
|
||||
|
||||
- name: Install test prerequisites
|
||||
run: sudo apt-get install -y -qq python3-behave
|
||||
|
||||
- name: BDD tests (legacy tokenizer)
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/build/osm2pgsql:$PATH
|
||||
python3 -m behave -DREMOVE_TEMPLATE=1 -DSERVER_MODULE_PATH=$GITHUB_WORKSPACE/build/module -DAPI_ENGINE=php -DTOKENIZER=legacy --format=progress3
|
||||
working-directory: Nominatim/test/bdd
|
||||
|
||||
|
||||
php-test:
|
||||
needs: create-archive
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: full-source
|
||||
|
||||
- name: Unpack Nominatim
|
||||
run: tar xf nominatim-src.tar.bz2
|
||||
|
||||
- uses: ./Nominatim/.github/actions/setup-postgresql
|
||||
with:
|
||||
postgresql-version: 15
|
||||
postgis-version: 3
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.1
|
||||
tools: phpunit:9, phpcs, composer
|
||||
ini-values: opcache.jit=disable
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: PHP linting
|
||||
run: phpcs --report-width=120 .
|
||||
working-directory: Nominatim
|
||||
|
||||
- name: PHP unit tests
|
||||
run: phpunit ./
|
||||
working-directory: Nominatim/test/php
|
||||
|
||||
- uses: ./Nominatim/.github/actions/build-nominatim
|
||||
with:
|
||||
flavour: 'ubuntu-22'
|
||||
|
||||
- name: Install test prerequisites
|
||||
run: sudo apt-get install -y -qq python3-behave
|
||||
|
||||
- name: BDD tests (php)
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/build/osm2pgsql:$PATH
|
||||
python3 -m behave -DREMOVE_TEMPLATE=1 -DAPI_ENGINE=php --format=progress3
|
||||
working-directory: Nominatim/test/bdd
|
||||
|
||||
|
||||
install:
|
||||
runs-on: ubuntu-latest
|
||||
needs: create-archive
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
name: [Ubuntu-22, Ubuntu-24]
|
||||
include:
|
||||
- name: Ubuntu-22
|
||||
image: "ubuntu:22.04"
|
||||
ubuntu: 22
|
||||
install_mode: install-apache
|
||||
- name: Ubuntu-24
|
||||
image: "ubuntu:24.04"
|
||||
ubuntu: 24
|
||||
install_mode: install-apache
|
||||
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
env:
|
||||
LANG: en_US.UTF-8
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: sudo -Hu nominatim bash --noprofile --norc -eo pipefail {0}
|
||||
|
||||
steps:
|
||||
- name: Prepare container (Ubuntu)
|
||||
run: |
|
||||
export APT_LISTCHANGES_FRONTEND=none
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get install -y git sudo wget
|
||||
ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone
|
||||
shell: bash
|
||||
|
||||
- name: Setup import user
|
||||
run: |
|
||||
useradd -m nominatim
|
||||
echo 'nominatim ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/nominiatim
|
||||
echo "/home/nominatim/Nominatim/vagrant/Install-on-${OS}.sh no $INSTALL_MODE" > /home/nominatim/vagrant.sh
|
||||
shell: bash
|
||||
env:
|
||||
OS: ${{ matrix.name }}
|
||||
INSTALL_MODE: ${{ matrix.install_mode }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: full-source
|
||||
path: /home/nominatim
|
||||
|
||||
- name: Install Nominatim
|
||||
run: |
|
||||
export USERNAME=nominatim
|
||||
export USERHOME=/home/nominatim
|
||||
export NOSYSTEMD=yes
|
||||
export HAVE_SELINUX=no
|
||||
tar xf nominatim-src.tar.bz2
|
||||
. vagrant.sh
|
||||
working-directory: /home/nominatim
|
||||
|
||||
- name: Prepare import environment
|
||||
run: |
|
||||
mv Nominatim/test/testdb/apidb-test-data.pbf test.pbf
|
||||
mv Nominatim/settings/flex-base.lua flex-base.lua
|
||||
mv Nominatim/settings/import-extratags.lua import-extratags.lua
|
||||
mv Nominatim/settings/taginfo.lua taginfo.lua
|
||||
rm -rf Nominatim
|
||||
mkdir data-env-reverse
|
||||
working-directory: /home/nominatim
|
||||
|
||||
- name: Add nominatim to path
|
||||
run: |
|
||||
sudo ln -s /home/nominatim/nominatim-venv/bin/nominatim /usr/local/bin/nominatim
|
||||
if: matrix.ubuntu == 24
|
||||
|
||||
- name: Need lua binary
|
||||
run: |
|
||||
sudo apt-get install -y lua5.4 lua-dkjson
|
||||
if: matrix.ubuntu == 24
|
||||
|
||||
- name: Print version
|
||||
run: nominatim --version
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
- name: Print taginfo
|
||||
run: lua taginfo.lua
|
||||
working-directory: /home/nominatim
|
||||
|
||||
- name: Collect host OS information
|
||||
run: nominatim admin --collect-os-info
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
- name: Import
|
||||
run: nominatim import --osm-file ../test.pbf
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
- name: Import special phrases
|
||||
run: nominatim special-phrases --import-from-wiki
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
- name: Check full import
|
||||
run: nominatim admin --check-database
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
- name: Warm up database
|
||||
run: nominatim admin --warm
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
- name: Prepare update (Ubuntu)
|
||||
run: apt-get install -y python3-pip
|
||||
shell: bash
|
||||
|
||||
- name: Install osmium (Ubuntu 22)
|
||||
run: |
|
||||
pip3 install --user osmium
|
||||
if: matrix.ubuntu == 22
|
||||
|
||||
- name: Install osmium (Ubuntu 24)
|
||||
run: |
|
||||
/home/nominatim/nominatim-venv/bin/pip install osmium
|
||||
if: matrix.ubuntu == 24
|
||||
|
||||
- name: Run update
|
||||
run: |
|
||||
nominatim replication --init
|
||||
NOMINATIM_REPLICATION_MAX_DIFF=1 nominatim replication --once
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
- name: Clean up database
|
||||
run: nominatim refresh --postcodes --word-tokens
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
- name: Run reverse-only import
|
||||
run : |
|
||||
echo 'NOMINATIM_DATABASE_DSN="pgsql:dbname=reverse"' >> .env
|
||||
nominatim import --osm-file ../test.pbf --reverse-only --no-updates
|
||||
working-directory: /home/nominatim/data-env-reverse
|
||||
|
||||
- name: Check reverse-only import
|
||||
run: nominatim admin --check-database
|
||||
working-directory: /home/nominatim/data-env-reverse
|
||||
|
||||
- name: Clean up database (reverse-only import)
|
||||
run: nominatim refresh --postcodes --word-tokens
|
||||
working-directory: /home/nominatim/nominatim-project
|
||||
|
||||
install-no-superuser:
|
||||
runs-on: ubuntu-latest
|
||||
needs: create-archive
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: full-source
|
||||
|
||||
- name: Unpack Nominatim
|
||||
run: tar xf nominatim-src.tar.bz2
|
||||
|
||||
- uses: ./Nominatim/.github/actions/setup-postgresql
|
||||
with:
|
||||
postgresql-version: 16
|
||||
postgis-version: 3
|
||||
|
||||
- uses: ./Nominatim/.github/actions/build-nominatim
|
||||
with:
|
||||
flavour: ubuntu-22
|
||||
lua: 5.3
|
||||
|
||||
- name: Prepare import environment
|
||||
run: |
|
||||
mv Nominatim/test/testdb/apidb-test-data.pbf test.pbf
|
||||
rm -rf Nominatim
|
||||
|
||||
- name: Prepare Database
|
||||
run: |
|
||||
nominatim import --prepare-database
|
||||
|
||||
- name: Create import user
|
||||
run: |
|
||||
sudo -u postgres createuser osm-import
|
||||
psql -d nominatim -c "ALTER USER \"osm-import\" WITH PASSWORD 'osm-import'"
|
||||
psql -d nominatim -c 'GRANT CREATE ON SCHEMA public TO "osm-import"'
|
||||
|
||||
- name: Run import
|
||||
run: |
|
||||
NOMINATIM_DATABASE_DSN="pgsql:host=127.0.0.1;dbname=nominatim;user=osm-import;password=osm-import" nominatim import --continue import-from-file --osm-file test.pbf
|
||||
|
||||
- name: Check full import
|
||||
run: nominatim admin --check-database
|
||||
|
||||
codespell:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: codespell-project/actions-codespell@v2
|
||||
with:
|
||||
only_warn: 1
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,11 +1,13 @@
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
|
||||
docs/develop/*.png
|
||||
site-html
|
||||
|
||||
build
|
||||
settings/local.php
|
||||
|
||||
data/wiki_import.sql
|
||||
data/wiki_specialphrases.sql
|
||||
data/osmosischange.osc
|
||||
dist
|
||||
.coverage
|
||||
|
||||
.vagrant
|
||||
data/country_osm_grid.sql.gz
|
||||
|
||||
23
.mypy.ini
Normal file
23
.mypy.ini
Normal file
@@ -0,0 +1,23 @@
|
||||
[mypy]
|
||||
plugins = sqlalchemy.ext.mypy.plugin
|
||||
|
||||
[mypy-sanic_cors.*]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-icu.*]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-asyncpg.*]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-datrie.*]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-dotenv.*]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-falcon.*]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-geoalchemy2.*]
|
||||
ignore_missing_imports = True
|
||||
22
.pylintrc
Normal file
22
.pylintrc
Normal file
@@ -0,0 +1,22 @@
|
||||
[MASTER]
|
||||
|
||||
extension-pkg-whitelist=osmium,falcon
|
||||
ignored-modules=icu,datrie
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# closing added here because it sometimes triggers a false positive with
|
||||
# 'with' statements.
|
||||
ignored-classes=NominatimArgs,closing
|
||||
# 'too-many-ancestors' is triggered already by deriving from UserDict
|
||||
# 'not-context-manager' disabled because it causes false positives once
|
||||
# typed Python is enabled. See also https://github.com/PyCQA/pylint/issues/5273
|
||||
disable=too-few-public-methods,duplicate-code,too-many-ancestors,bad-option-value,no-self-use,not-context-manager,use-dict-literal,chained-comparison,attribute-defined-outside-init,too-many-boolean-expressions,contextmanager-generator-missing-cleanup
|
||||
|
||||
good-names=i,j,x,y,m,t,fd,db,cc,x1,x2,y1,y2,pt,k,v,nr
|
||||
|
||||
[DESIGN]
|
||||
|
||||
max-returns=7
|
||||
39
.travis.yml
39
.travis.yml
@@ -1,39 +0,0 @@
|
||||
---
|
||||
os: linux
|
||||
dist: bionic
|
||||
language: python
|
||||
python:
|
||||
- "3.6"
|
||||
addons:
|
||||
postgresql: "9.6"
|
||||
apt:
|
||||
packages:
|
||||
postgresql-server-dev-9.6
|
||||
postgresql-client-9.6
|
||||
git:
|
||||
depth: 3
|
||||
env:
|
||||
- TEST_SUITE=tests
|
||||
- TEST_SUITE=monaco
|
||||
before_install:
|
||||
- phpenv global 7.1
|
||||
install:
|
||||
- vagrant/install-on-travis-ci.sh
|
||||
before_script:
|
||||
- psql -U postgres -c "create extension postgis"
|
||||
script:
|
||||
- cd $TRAVIS_BUILD_DIR/
|
||||
- if [[ $TEST_SUITE == "tests" ]]; then phpcs --report-width=120 . ; fi
|
||||
- cd $TRAVIS_BUILD_DIR/test/php
|
||||
- if [[ $TEST_SUITE == "tests" ]]; then /usr/bin/phpunit ./ ; fi
|
||||
- cd $TRAVIS_BUILD_DIR/test/bdd
|
||||
- # behave --format=progress3 api
|
||||
- if [[ $TEST_SUITE == "tests" ]]; then behave -DREMOVE_TEMPLATE=1 --format=progress3 db ; fi
|
||||
- if [[ $TEST_SUITE == "tests" ]]; then behave --format=progress3 osm2pgsql ; fi
|
||||
- cd $TRAVIS_BUILD_DIR/build
|
||||
- if [[ $TEST_SUITE == "monaco" ]]; then wget --no-verbose --output-document=../data/monaco.osm.pbf http://download.geofabrik.de/europe/monaco-latest.osm.pbf; fi
|
||||
- if [[ $TEST_SUITE == "monaco" ]]; then /usr/bin/env php ./utils/setup.php --osm-file ../data/monaco.osm.pbf --osm2pgsql-cache 1000 --all 2>&1 | grep -v 'ETA (seconds)'; fi
|
||||
- if [[ $TEST_SUITE == "monaco" ]]; then /usr/bin/env php ./utils/specialphrases.php --wiki-import | psql -d test_api_nominatim >/dev/null; fi
|
||||
- if [[ $TEST_SUITE == "monaco" ]]; then /usr/bin/env php ./utils/check_import_finished.php; fi
|
||||
notifications:
|
||||
email: false
|
||||
16
AUTHORS
16
AUTHORS
@@ -1,15 +1,15 @@
|
||||
Nominatim was written by:
|
||||
|
||||
Brian Quinion
|
||||
Sarah Hoffmann
|
||||
Marc Tobias Metten
|
||||
* Brian Quinion
|
||||
* Sarah Hoffmann
|
||||
* Marc Tobias Metten
|
||||
|
||||
markigail
|
||||
gemo1011
|
||||
IrlJidel
|
||||
Frederik Ramm
|
||||
* markigail
|
||||
* AntoJvlt
|
||||
* gemo1011
|
||||
* darkshredder
|
||||
|
||||
and many more.
|
||||
|
||||
For a full list of contributors see
|
||||
For a full list of contributors see the Git logs or visit
|
||||
https://github.com/openstreetmap/Nominatim/graphs/contributors
|
||||
|
||||
270
CMakeLists.txt
270
CMakeLists.txt
@@ -6,7 +6,7 @@
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
project(nominatim)
|
||||
|
||||
set(NOMINATIM_VERSION_MAJOR 3)
|
||||
set(NOMINATIM_VERSION_MAJOR 4)
|
||||
set(NOMINATIM_VERSION_MINOR 5)
|
||||
set(NOMINATIM_VERSION_PATCH 0)
|
||||
|
||||
@@ -26,6 +26,17 @@ set(NOMINATIM_VERSION "${NOMINATIM_VERSION_MAJOR}.${NOMINATIM_VERSION_MINOR}.${N
|
||||
|
||||
add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
|
||||
|
||||
# Setting GIT_HASH
|
||||
find_package(Git)
|
||||
if (GIT_FOUND)
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||
OUTPUT_VARIABLE GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configuration
|
||||
@@ -33,10 +44,10 @@ add_definitions(-DNOMINATIM_VERSION="${NOMINATIM_VERSION}")
|
||||
|
||||
set(BUILD_IMPORTER on CACHE BOOL "Build everything for importing/updating the database")
|
||||
set(BUILD_API on CACHE BOOL "Build everything for the API server")
|
||||
set(BUILD_MODULE on CACHE BOOL "Build PostgreSQL module")
|
||||
set(BUILD_MODULE off CACHE BOOL "Build PostgreSQL module for legacy tokenizer")
|
||||
set(BUILD_TESTS on CACHE BOOL "Build test suite")
|
||||
set(BUILD_DOCS on CACHE BOOL "Build documentation")
|
||||
set(BUILD_OSM2PGSQL on CACHE BOOL "Build osm2pgsql (expert only)")
|
||||
set(INSTALL_MUNIN_PLUGINS on CACHE BOOL "Install Munin plugins for supervising Nominatim")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# osm2pgsql (imports/updates only)
|
||||
@@ -50,27 +61,17 @@ if (BUILD_IMPORTER AND BUILD_OSM2PGSQL)
|
||||
endif()
|
||||
set(BUILD_TESTS_SAVED "${BUILD_TESTS}")
|
||||
set(BUILD_TESTS off)
|
||||
set(WITH_LUA off CACHE BOOL "")
|
||||
add_subdirectory(osm2pgsql)
|
||||
set(BUILD_TESTS ${BUILD_TESTS_SAVED})
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# python and pyosmium (imports/updates only)
|
||||
# python (imports/updates only)
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if (BUILD_IMPORTER)
|
||||
find_package(PythonInterp 3)
|
||||
|
||||
find_program(PYOSMIUM pyosmium-get-changes)
|
||||
if (NOT EXISTS "${PYOSMIUM}")
|
||||
set(PYOSMIUM_PATH "")
|
||||
message(WARNING "pyosmium-get-changes not found (required for updates)")
|
||||
else()
|
||||
set(PYOSMIUM_PATH "${PYOSMIUM}")
|
||||
message(STATUS "Using pyosmium-get-changes at ${PYOSMIUM_PATH}")
|
||||
endif()
|
||||
if (BUILD_IMPORTER OR BUILD_API)
|
||||
find_package(PythonInterp 3.7 REQUIRED)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -79,75 +80,39 @@ endif()
|
||||
|
||||
# Setting PHP binary variable as to command line (prevailing) or auto detect
|
||||
|
||||
if (NOT PHP_BIN)
|
||||
find_program (PHP_BIN php)
|
||||
if (BUILD_API)
|
||||
if (NOT PHP_BIN)
|
||||
find_program (PHP_BIN php)
|
||||
endif()
|
||||
# sanity check if PHP binary exists
|
||||
if (NOT EXISTS ${PHP_BIN})
|
||||
message(WARNING "PHP binary not found. Only Python frontend can be used.")
|
||||
set(PHP_BIN "")
|
||||
else()
|
||||
message (STATUS "Using PHP binary " ${PHP_BIN})
|
||||
endif()
|
||||
endif()
|
||||
# sanity check if PHP binary exists
|
||||
if (NOT EXISTS ${PHP_BIN})
|
||||
message(FATAL_ERROR "PHP binary not found. Install php or provide location with -DPHP_BIN=/path/php ")
|
||||
endif()
|
||||
message (STATUS "Using PHP binary " ${PHP_BIN})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# import scripts and utilities (importer only)
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if (BUILD_IMPORTER)
|
||||
set(CUSTOMSCRIPTS
|
||||
utils/check_import_finished.php
|
||||
utils/country_languages.php
|
||||
utils/importWikipedia.php
|
||||
utils/export.php
|
||||
utils/query.php
|
||||
utils/setup.php
|
||||
utils/specialphrases.php
|
||||
utils/update.php
|
||||
utils/warm.php
|
||||
)
|
||||
find_file(COUNTRY_GRID_FILE country_osm_grid.sql.gz
|
||||
PATHS ${PROJECT_SOURCE_DIR}/data
|
||||
NO_DEFAULT_PATH
|
||||
DOC "Location of the country grid file."
|
||||
)
|
||||
|
||||
foreach (script_source ${CUSTOMSCRIPTS})
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/script.tmpl
|
||||
${PROJECT_BINARY_DIR}/${script_source})
|
||||
endforeach()
|
||||
if (NOT COUNTRY_GRID_FILE)
|
||||
message(FATAL_ERROR "\nYou need to download the country_osm_grid first:\n"
|
||||
" wget -O ${PROJECT_SOURCE_DIR}/data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz")
|
||||
endif()
|
||||
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/tool.tmpl
|
||||
${PROJECT_BINARY_DIR}/nominatim)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# webserver scripts (API only)
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if (BUILD_API)
|
||||
set(WEBSITESCRIPTS
|
||||
website/deletable.php
|
||||
website/details.php
|
||||
website/hierarchy.php
|
||||
website/lookup.php
|
||||
website/polygons.php
|
||||
website/reverse.php
|
||||
website/search.php
|
||||
website/status.php
|
||||
)
|
||||
|
||||
foreach (script_source ${WEBSITESCRIPTS})
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/website.tmpl
|
||||
${PROJECT_BINARY_DIR}/${script_source})
|
||||
endforeach()
|
||||
|
||||
set(WEBPATHS css images js)
|
||||
|
||||
foreach (wp ${WEBPATHS})
|
||||
execute_process(
|
||||
COMMAND ln -sf ${PROJECT_SOURCE_DIR}/website/${wp} ${PROJECT_BINARY_DIR}/website/
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# default settings
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
configure_file(${PROJECT_SOURCE_DIR}/settings/defaults.php
|
||||
${PROJECT_BINARY_DIR}/settings/settings.php)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Tests
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -157,21 +122,60 @@ if (BUILD_TESTS)
|
||||
|
||||
set(TEST_BDD db osm2pgsql api)
|
||||
|
||||
foreach (test ${TEST_BDD})
|
||||
add_test(NAME bdd_${test}
|
||||
COMMAND behave ${test}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test/bdd)
|
||||
set_tests_properties(bdd_${test}
|
||||
PROPERTIES ENVIRONMENT "NOMINATIM_DIR=${PROJECT_BINARY_DIR}")
|
||||
endforeach()
|
||||
find_program(PYTHON_BEHAVE behave)
|
||||
find_program(PYLINT NAMES pylint3 pylint)
|
||||
find_program(PYTEST NAMES pytest py.test-3 py.test)
|
||||
find_program(PHPCS phpcs)
|
||||
find_program(PHPUNIT phpunit)
|
||||
|
||||
add_test(NAME php
|
||||
COMMAND phpunit ./
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test/php)
|
||||
if (PYTHON_BEHAVE)
|
||||
message(STATUS "Using Python behave binary ${PYTHON_BEHAVE}")
|
||||
foreach (test ${TEST_BDD})
|
||||
add_test(NAME bdd_${test}
|
||||
COMMAND ${PYTHON_BEHAVE} ${test}
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test/bdd)
|
||||
set_tests_properties(bdd_${test}
|
||||
PROPERTIES ENVIRONMENT "NOMINATIM_DIR=${PROJECT_BINARY_DIR}")
|
||||
endforeach()
|
||||
else()
|
||||
message(WARNING "behave not found. BDD tests disabled." )
|
||||
endif()
|
||||
|
||||
add_test(NAME phpcs
|
||||
COMMAND phpcs --report-width=120 --colors lib website utils
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
if (PHPUNIT)
|
||||
message(STATUS "Using phpunit binary ${PHPUNIT}")
|
||||
add_test(NAME php
|
||||
COMMAND ${PHPUNIT} ./
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/test/php)
|
||||
else()
|
||||
message(WARNING "phpunit not found. PHP unit tests disabled." )
|
||||
endif()
|
||||
|
||||
if (PHPCS)
|
||||
message(STATUS "Using phpcs binary ${PHPCS}")
|
||||
add_test(NAME phpcs
|
||||
COMMAND ${PHPCS} --report-width=120 --colors lib-php
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
else()
|
||||
message(WARNING "phpcs not found. PHP linting tests disabled." )
|
||||
endif()
|
||||
|
||||
if (PYLINT)
|
||||
message(STATUS "Using pylint binary ${PYLINT}")
|
||||
add_test(NAME pylint
|
||||
COMMAND ${PYLINT} nominatim
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
else()
|
||||
message(WARNING "pylint not found. Python linting tests disabled.")
|
||||
endif()
|
||||
|
||||
if (PYTEST)
|
||||
message(STATUS "Using pytest binary ${PYTEST}")
|
||||
add_test(NAME pytest
|
||||
COMMAND ${PYTEST} test/python
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
else()
|
||||
message(WARNING "pytest not found. Python tests disabled." )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -183,9 +187,91 @@ if (BUILD_MODULE)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Documentation
|
||||
# Installation
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if (BUILD_DOCS)
|
||||
add_subdirectory(docs)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
set(NOMINATIM_DATADIR ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME})
|
||||
set(NOMINATIM_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
|
||||
set(NOMINATIM_CONFIGDIR ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${PROJECT_NAME})
|
||||
set(NOMINATIM_MUNINDIR ${CMAKE_INSTALL_FULL_DATADIR}/munin/plugins)
|
||||
|
||||
if (BUILD_IMPORTER)
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/tool-installed.tmpl installed.bin)
|
||||
install(PROGRAMS ${PROJECT_BINARY_DIR}/installed.bin
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
RENAME nominatim)
|
||||
|
||||
if (EXISTS ${PHP_BIN})
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/paths-py.tmpl paths-py.installed)
|
||||
else()
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/paths-py-no-php.tmpl paths-py.installed)
|
||||
endif()
|
||||
|
||||
foreach (submodule nominatim_db nominatim_api)
|
||||
install(DIRECTORY src/${submodule}
|
||||
DESTINATION ${NOMINATIM_LIBDIR}/lib-python
|
||||
FILES_MATCHING PATTERN "*.py"
|
||||
PATTERN "paths.py" EXCLUDE
|
||||
PATTERN __pycache__ EXCLUDE)
|
||||
install(FILES ${PROJECT_BINARY_DIR}/paths-py.installed
|
||||
DESTINATION ${NOMINATIM_LIBDIR}/lib-python/${submodule}
|
||||
RENAME paths.py)
|
||||
endforeach()
|
||||
|
||||
install(DIRECTORY lib-sql DESTINATION ${NOMINATIM_LIBDIR})
|
||||
|
||||
install(FILES ${COUNTRY_GRID_FILE}
|
||||
data/words.sql
|
||||
DESTINATION ${NOMINATIM_DATADIR})
|
||||
endif()
|
||||
|
||||
if (BUILD_OSM2PGSQL)
|
||||
if (${CMAKE_VERSION} VERSION_LESS 3.13)
|
||||
# Installation of subdirectory targets was only introduced in 3.13.
|
||||
# So just copy the osm2pgsql file for older versions.
|
||||
install(PROGRAMS ${PROJECT_BINARY_DIR}/osm2pgsql/osm2pgsql
|
||||
DESTINATION ${NOMINATIM_LIBDIR})
|
||||
else()
|
||||
install(TARGETS osm2pgsql RUNTIME DESTINATION ${NOMINATIM_LIBDIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_MODULE)
|
||||
install(PROGRAMS ${PROJECT_BINARY_DIR}/module/nominatim.so
|
||||
DESTINATION ${NOMINATIM_LIBDIR}/module)
|
||||
endif()
|
||||
|
||||
if (BUILD_API AND EXISTS ${PHP_BIN})
|
||||
install(DIRECTORY lib-php DESTINATION ${NOMINATIM_LIBDIR})
|
||||
endif()
|
||||
|
||||
install(FILES settings/env.defaults
|
||||
settings/address-levels.json
|
||||
settings/phrase-settings.json
|
||||
settings/import-admin.lua
|
||||
settings/import-street.lua
|
||||
settings/import-address.lua
|
||||
settings/import-full.lua
|
||||
settings/import-extratags.lua
|
||||
settings/flex-base.lua
|
||||
settings/icu_tokenizer.yaml
|
||||
settings/country_settings.yaml
|
||||
DESTINATION ${NOMINATIM_CONFIGDIR})
|
||||
|
||||
install(DIRECTORY settings/icu-rules
|
||||
DESTINATION ${NOMINATIM_CONFIGDIR})
|
||||
install(DIRECTORY settings/country-names
|
||||
DESTINATION ${NOMINATIM_CONFIGDIR})
|
||||
|
||||
if (INSTALL_MUNIN_PLUGINS)
|
||||
install(FILES munin/nominatim_importlag
|
||||
munin/nominatim_query_speed
|
||||
munin/nominatim_requests
|
||||
DESTINATION ${NOMINATIM_MUNINDIR})
|
||||
endif()
|
||||
|
||||
message(WARNING "Building with CMake is deprecated and will be removed in Nominatim 5.0."
|
||||
"Use Nominatim pip packages instead.\n"
|
||||
"See https://nominatim.org/release-docs/develop/admin/Installation/#downloading-and-building-nominatim")
|
||||
|
||||
@@ -7,41 +7,6 @@ Please always open a separate issue for each problem. In particular, do
|
||||
not add your bugs to closed issues. They may looks similar to you but
|
||||
often are completely different from the maintainer's point of view.
|
||||
|
||||
### When Reporting Bad Search Results...
|
||||
|
||||
Please make sure to add the following information:
|
||||
|
||||
* the URL of the query that produces the bad result
|
||||
* the result you are getting
|
||||
* the expected result, preferably a link to the OSM object you want to find,
|
||||
otherwise an address that is as precise as possible
|
||||
|
||||
To get the link to the OSM object, you can try the following:
|
||||
|
||||
* go to https://openstreetmap.org
|
||||
* zoom to the area of the map where you expect the result and
|
||||
zoom in as much as possible
|
||||
* click on the question mark on the right side of the map,
|
||||
then with the queston cursor on the map where your object is located
|
||||
* find the object of interest in the list that appears on the left side
|
||||
* click on the object and report the URL back that the browser shows
|
||||
|
||||
### When Reporting Bugs...
|
||||
|
||||
Please add the following information to your issue:
|
||||
|
||||
* hardware configuration: RAM size, CPUs, kind and size of disks
|
||||
* Operating system (also mention if you are running on a cloud service)
|
||||
* Postgres and Postgis version
|
||||
* list of settings you changed in your Postgres configuration
|
||||
* Nominatim version (release version or,
|
||||
if you run from the git repo, the output of `git rev-parse HEAD`)
|
||||
* (if applicable) exact command line of the command that was causing the issue
|
||||
|
||||
Bug reports that do not include extensive information about your system,
|
||||
about the problem and about what you have been trying to debug the problem
|
||||
will be closed.
|
||||
|
||||
## Workflow for Pull Requests
|
||||
|
||||
We love to get pull requests from you. We operate the "Fork & Pull" model
|
||||
@@ -71,7 +36,7 @@ Nominatim historically hasn't followed a particular coding style but we
|
||||
are in process of consolidating the style. The following rules apply:
|
||||
|
||||
* Python code uses the official Python style
|
||||
* indention
|
||||
* indentation
|
||||
* SQL use 2 spaces
|
||||
* all other file types use 4 spaces
|
||||
* [BSD style](https://en.wikipedia.org/wiki/Indent_style#Allman_style) for braces
|
||||
@@ -84,22 +49,58 @@ are in process of consolidating the style. The following rules apply:
|
||||
* for PHP variables use CamelCase with a prefixing letter indicating the type
|
||||
(i - integer, f - float, a - array, s - string, o - object)
|
||||
|
||||
The coding style is enforced with PHPCS and can be tested with:
|
||||
The coding style is enforced with PHPCS and pylint. It can be tested with:
|
||||
|
||||
```
|
||||
phpcs --report-width=120 --colors .
|
||||
phpcs --report-width=120 --colors .
|
||||
pylint3 --extension-pkg-whitelist=osmium nominatim
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Before submitting a pull request make sure that the following tests pass:
|
||||
Before submitting a pull request make sure that the tests pass:
|
||||
|
||||
```
|
||||
cd test/bdd
|
||||
behave -DBUILDDIR=<builddir> db osm2pgsql
|
||||
cd build
|
||||
make test
|
||||
```
|
||||
|
||||
```
|
||||
cd test/php
|
||||
phpunit ./
|
||||
```
|
||||
## Releases
|
||||
|
||||
Nominatim follows semantic versioning. Major releases are done for large changes
|
||||
that require (or at least strongly recommend) a reimport of the databases.
|
||||
Minor releases can usually be applied to existing databases. Patch releases
|
||||
contain bug fixes only and are released from a separate branch where the
|
||||
relevant changes are cherry-picked from the master branch.
|
||||
|
||||
Checklist for releases:
|
||||
|
||||
* [ ] increase versions in
|
||||
* `src/nominatim_api/version.py`
|
||||
* `src/nominatim_db/version.py`
|
||||
* CMakeLists.txt
|
||||
* [ ] update `ChangeLog` (copy information from patch releases from release branch)
|
||||
* [ ] complete `docs/admin/Migration.md`
|
||||
* [ ] update EOL dates in `SECURITY.md`
|
||||
* [ ] commit and make sure CI tests pass
|
||||
* [ ] test migration
|
||||
* download, build and import previous version
|
||||
* migrate using master version
|
||||
* run updates using master version
|
||||
* [ ] prepare tarball:
|
||||
* `git clone --recursive https://github.com/osm-search/Nominatim` (switch to right branch!)
|
||||
* `rm -r .git* osm2pgsql/.git*`
|
||||
* copy country data into `data/`
|
||||
* add version to base directory and package
|
||||
* [ ] upload tarball to https://nominatim.org
|
||||
* [ ] prepare documentation
|
||||
* check out new docs branch
|
||||
* change git checkout instructions to tarball download instructions or adapt version on existing ones
|
||||
* build documentation and copy to https://github.com/osm-search/nominatim-org-site
|
||||
* add new version to history
|
||||
* [ ] check release tarball
|
||||
* download tarball as per new documentation instructions
|
||||
* compile and import Nominatim
|
||||
* run `nominatim --version` to confirm correct version
|
||||
* [ ] tag new release and add a release on github.com
|
||||
* [ ] build pip packages and upload to pypi
|
||||
|
||||
457
COPYING
457
COPYING
@@ -1,339 +1,232 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
|
||||
Preamble
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
Preamble
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
The GNU General Public License is a free, copyleft license for software and other kinds of works.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
0. Definitions.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
“This License” refers to version 3 of the GNU General Public License.
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
A “covered work” means either the unmodified Program or a work based on the Program.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
1. Source Code.
|
||||
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
2. Basic Permissions.
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
4. Conveying Verbatim Copies.
|
||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
5. Conveying Modified Source Versions.
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
|
||||
|
||||
NO WARRANTY
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
6. Conveying Non-Source Forms.
|
||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
||||
|
||||
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
|
||||
|
||||
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
||||
|
||||
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
337
ChangeLog
337
ChangeLog
@@ -1,3 +1,330 @@
|
||||
4.5.0
|
||||
* allow building Nominatim as a pip package
|
||||
* make osm2pgsql building optional
|
||||
* switch importer to psycopg3
|
||||
* allow output format of web search to be customized in self-installations
|
||||
* look up potential postcode areas for postcode results
|
||||
* add word usage statistics for address terms
|
||||
* implement more light-weight CSV format for wiki importance tables
|
||||
* rewrite SQL for place search to use window functions
|
||||
* increase search radius when filtering by postcode
|
||||
* prefer POI points over POI areas
|
||||
* reintroduce full terms for address terms in search_name table
|
||||
* reindex postcodes when their parent is deleted
|
||||
* indexing: precompute counts of affected rows
|
||||
* ensure consistent country assignments for overlapping countries
|
||||
* make Nominatim[Async]API context manager to ensure proper calling of
|
||||
close()
|
||||
* make usage of project dir optional for library
|
||||
* drop interpolations when no parent can be found
|
||||
* style tweaks to reflect OSM usage (man_made, highway and others)
|
||||
* deprecation of: bundled osm2pgsql, legacy tokenizer, PHP frontend
|
||||
* make documentation buildable without CMake
|
||||
* various fixes and improvements to documentation
|
||||
|
||||
4.4.1
|
||||
* fix geocodejson output: admin level output should only print boundaries
|
||||
* updating: restrict invalidation of child objects on large street features
|
||||
* restrict valid interpolation house numbers to 0-999999
|
||||
* fix import error when SQLAlchemy 1.4 and psycopg3 are installed
|
||||
* various typo fixes in the documentation
|
||||
|
||||
4.4.0
|
||||
* add export to SQLite database and SQLite support for the frontend
|
||||
* switch to Python frontend as the default frontend
|
||||
* update to osm2pgsql 1.11.0
|
||||
* add support for new osm2pgsql middle table format
|
||||
* simplify geometry for large polygon objects not used in addresses
|
||||
* various performance tweaks for search in Python frontend
|
||||
* fix regression in search with categories where it was confused with near
|
||||
search
|
||||
* partially roll back use of SQLAlchemy lambda statements due to bugs
|
||||
in SQLAlchemy
|
||||
* fix handling of timezones for timestamps from the database
|
||||
* fix handling of full address searches in connection with a viewbox
|
||||
* fix postcode computation of highway areas
|
||||
* fix handling of timeout errors for Python <= 3.10
|
||||
* fix address computation for postcode areas
|
||||
* fix variable shadowing in osm2pgsql flex script, causing bugs with LuaJIT
|
||||
* make sure extratags are always null when empty
|
||||
* reduce importance of places without wikipedia reference
|
||||
* improve performance of word count computations
|
||||
* drop support for wikipedia tags with full URLs
|
||||
* replace get_addressdata() SQL implementation with a Python function
|
||||
* improve display name for non-address features
|
||||
* fix postcode validation for postcodes with country code
|
||||
(thanks @pawel-wroniszewski)
|
||||
* add possibility to run imports without superuser database rights
|
||||
(thanks @robbe-haesendonck)
|
||||
* new CLI command for cleaning deleted relations (thanks @lujoh)
|
||||
* add check for database version in the CLI check command
|
||||
* updates to import styles ignoring more unused objects
|
||||
* various typo fixes (thanks @kumarUjjawal)
|
||||
|
||||
4.3.2
|
||||
* fix potential SQL injection issue for 'nominatim admin --collect-os-info'
|
||||
* PHP frontend: fix on-the-fly lookup of postcode areas near boundaries
|
||||
* Python frontend: improve handling of viewbox
|
||||
* Python frontend: correct deployment instructions
|
||||
|
||||
4.3.1
|
||||
* reintroduce result rematching
|
||||
* improve search of multi-part names
|
||||
* fix accidentally switched meaning of --reverse-only and --search-only in
|
||||
warm command
|
||||
|
||||
4.3.0
|
||||
* fix failing importance recalculation command
|
||||
* fix merging of linked names into unnamed boundaries
|
||||
* fix a number of corner cases with interpolation splitting resulting in
|
||||
invalid geometries
|
||||
* fix failure in website generation when password contains curly brackets
|
||||
* fix broken use of ST_Project in PostGIS 3.4
|
||||
* new NOMINATIM_SEARCH_WITHIN_COUNTRIES setting to restrict reverse lookups
|
||||
to known countries (thanks @alfmarcua)
|
||||
* allow negative OSM IDs (thanks @alfmarcua)
|
||||
* disallow import of Tiger data in a frozen DB
|
||||
* avoid UPDATE to change settings to be compatible with r/o DBs (thanks @t-tomek)
|
||||
* update bundled osm2pgsql to 1.9.2
|
||||
* reorganise osm2pgsql flex style and make it the default
|
||||
* exclude names ending in :wikipedia from indexing
|
||||
* no longer accept comma as a list separator in name tags
|
||||
* process forward dependencies on update to catch updates in geometries
|
||||
of ways and relations
|
||||
* fix handling of isolated silent letters during transliteration
|
||||
* no longer assign postcodes to large linear features like rivers
|
||||
* introduce nominatim.paths module for finding data and libraries
|
||||
* documentation layout changed to material theme
|
||||
* new documentation section for library
|
||||
* various smaller fixes to existing documentation
|
||||
(thanks @woodpeck, @bloom256, @biswajit-k)
|
||||
* updates to vagrant install scripts, drop support for Ubuntu 18
|
||||
(thanks @n-timofeev)
|
||||
* removed obsolete configuration variables from env.defaults
|
||||
* add script for generating a taginfo description (thanks @biswajit-k)
|
||||
* modernize Python code around BDD test and add testing of Python frontend
|
||||
* lots of new BDD tests for API output
|
||||
|
||||
4.2.3
|
||||
|
||||
* fix deletion handling for 'nominatim add-data'
|
||||
* adapt place_force_delete() to new deletion handling
|
||||
* flex style: avoid dropping of postcode areas
|
||||
* fix update errors on address interpolation handling
|
||||
|
||||
4.2.2
|
||||
|
||||
* extend flex-style library to fully support all default styles
|
||||
* fix handling of Hebrew aleph
|
||||
* do not assign postcodes to rivers
|
||||
* fix string matching in PHP code
|
||||
* update osm2pgsql (various updates to flex)
|
||||
* fix slow query when deleting places on update
|
||||
* fix CLI details query
|
||||
* fix recalculation of importance values
|
||||
* fix polygon simplification in reverse results
|
||||
* add class/type information to reverse geocodejson result
|
||||
* minor improvements to default tokenizer configuration
|
||||
* various smaller fixes to documentation
|
||||
|
||||
4.2.1
|
||||
|
||||
* fix XSS vulnerability in debug view
|
||||
|
||||
4.2.0
|
||||
|
||||
* add experimental support for osm2pgsql flex style
|
||||
* introduce secondary importance value to be retrieved from a raster data file
|
||||
(currently still unused, to replace address importance, thanks to @tareqpi)
|
||||
* add new report tool `nominatim admin --collect-os-info`
|
||||
(thanks @micahcochran, @tareqpi)
|
||||
* reorganise index to improve lookup performance and size
|
||||
* run index creation after import in parallel
|
||||
* run ANALYZE more selectively to speed up continuation of indexing
|
||||
* fix crash on update when addr:interpolation receives an illegal value
|
||||
* fix minimum number of retrieved results to be at least 10
|
||||
* fix search for combinations of special term + name (e.g Hotel Bellevue)
|
||||
* do not return interpolations without a parent street on reverse search
|
||||
* improve invalidation of linked places on updates
|
||||
* fix address parsing for interpolation lines
|
||||
* make sure socket timeouts are respected during replication
|
||||
(working around a bug in some versions of pyosmium)
|
||||
* update bundled osm2pgsql to 1.7.1
|
||||
* add support for PostgreSQL 15
|
||||
* typing fixes to work with latest type annotations from typeshed
|
||||
* smaller improvements to documentation (thanks to @mausch)
|
||||
|
||||
4.1.1
|
||||
|
||||
* fix XSS vulnerability in debug view
|
||||
|
||||
4.1.0
|
||||
|
||||
* switch to ICU tokenizer as default
|
||||
* add housenumber normalization and support optional spaces during search
|
||||
* add postcode format checking and support optional spaces during search
|
||||
* add function for cleaning housenumbers in word table
|
||||
* add updates/deletion of country names imported from OSM
|
||||
* linked places no longer overwrite names from a place permanently
|
||||
* move default country name configuration into yaml file (thanks @tareqpi)
|
||||
* more compact layout for interpolation and TIGER tables
|
||||
* introduce mutations to ICU tokenizer (used for German umlauts)
|
||||
* support reinitializing a full project directory with refresh --website
|
||||
* fix various issues with linked places on updates
|
||||
* add support for external sanitizers and token analyzers
|
||||
* add CLI commands for forced indexing
|
||||
* add CLI command for version report
|
||||
* add offline import mode
|
||||
* change geocodejson to return a feature class in the 'type' field
|
||||
* add ISO3166-2 to address output (thanks @I70l0teN4ik)
|
||||
* improve parsing and matching of addr: tags
|
||||
* support relations as street members of associatedStreet
|
||||
* better ranking for address results from TIGER data
|
||||
* adapt rank classification to changed tag usage in OSM
|
||||
* update bundled osm2pgsql to 1.6.0
|
||||
* add typing information to Python code
|
||||
* improve unit test coverage
|
||||
* reorganise and speed up code for BDD tests, drop support for scenes
|
||||
* move PHP unit tests to PHP 9.5
|
||||
* extensive typo fixes in documentation (thanks @woodpeck,@StephanGeorg,
|
||||
@amandasaurus, @nslxndr, @stefkiourk, @Luflosi, @kianmeng)
|
||||
* drop official support for installation on CentOS
|
||||
* add installation instructions for Ubuntu 22.04
|
||||
* add support for PHP8
|
||||
* add setup instructions for updates and systemd
|
||||
* drop support for PostgreSQL 9.5
|
||||
|
||||
4.0.2
|
||||
|
||||
* fix XSS vulnerability in debug view
|
||||
|
||||
4.0.1
|
||||
|
||||
* fix initialisation error in replication script
|
||||
* ICU tokenizer: avoid any special characters in word tokens
|
||||
* better error message when API php script does not exist
|
||||
* fix quoting of house numbers in SQL queries
|
||||
* small fixes and improvements in search query parsing
|
||||
* add documentation for moving the database to a different machine
|
||||
|
||||
4.0.0
|
||||
|
||||
* refactor name token computation and introduce ICU tokenizer
|
||||
* name processing now happens in the indexer outside the DB
|
||||
* reorganizes abbreviation handling and moves it to the indexing phases
|
||||
* adds preprocessing of names
|
||||
* add country-specific ranking for Spain, Slovakia
|
||||
* partially switch to using SP-GIST indexes
|
||||
* better updating of dependent addresses for name changes in streets
|
||||
* remove unused/broken tables for external housenumbers
|
||||
* move external postcodes to CSV format and no longer save them in tables
|
||||
(adds support for postcodes for arbitrary countries)
|
||||
* remove postcode helper entries from placex (thanks @AntoJvlt)
|
||||
* change required format for TIGER data to CSV
|
||||
* move configuration of default languages from wiki into config file
|
||||
* expect customized configuration files in project directory by default
|
||||
* disable search API for reverse-only import (thanks @darkshredder)
|
||||
* port most of maintenance/import code to Python and remove PHP utils
|
||||
* add catch-up mode for replication
|
||||
* add updating of special phrases (thanks @AntoJvlt)
|
||||
* add support for special phrases in CSV files (thanks @AntoJvlt)
|
||||
* switch to case-independent matching between place and boundary names
|
||||
* remove disabling of reverse query parsing
|
||||
* minor tweaks to search algorithm to avoid more false positives
|
||||
* major overhaul of the administrator and developer documentation
|
||||
* add security disclosure policy
|
||||
* add testing of installation scripts via CI
|
||||
* drop support for Python < 3.6 and Postgresql < 9.5
|
||||
|
||||
3.7.3
|
||||
|
||||
* fix XSS vulnerability in debug view
|
||||
|
||||
3.7.2
|
||||
|
||||
* fix database check for reverse-only imports
|
||||
* do not error out in status API result when import date is missing
|
||||
* add array_key_last function for PHP < 7.3 (thanks to @woodpeck)
|
||||
* fix more url when server name is unknown (thanks to @mogita)
|
||||
* commit changes to replication log table
|
||||
|
||||
3.7.1
|
||||
|
||||
* fix smaller issues with special phrases import (thanks @AntoJvlt)
|
||||
* add index to speed up continued indexing during import
|
||||
* fix index on location_property_tiger(parent_place_id) (thanks @changpingc)
|
||||
* make sure Python code is backward-compatible with Python 3.5
|
||||
* various documentation fixes
|
||||
|
||||
3.7.0
|
||||
|
||||
* switch to dotenv for configuration file
|
||||
* introduce 'make install' (reorganising most of the code)
|
||||
* introduce nominatim tool as replacement for various php scripts
|
||||
* introduce project directories and allow multiple installations from same build
|
||||
* clean up BDD tests: drop nose, reorganise step code
|
||||
* simplify test database for API BDD tests and autoinstall database
|
||||
* port most of the code for command-line tools to Python
|
||||
(thanks to @darkshredder and @AntoJvlt)
|
||||
* add tests for all tooling
|
||||
* replace pyosmium-get-changes with custom internal implementation using
|
||||
pyosmium
|
||||
* improve search for queries with housenumber and partial terms
|
||||
* add database versioning
|
||||
* use jinja2 for preprocessing SQL files
|
||||
* introduce automatic migrations
|
||||
* reverse fix preference of interpolations over housenumbers
|
||||
* parallelize indexing of postcodes
|
||||
* add non-key indexes to speed up housenumber + street searches
|
||||
* switch housenumber field in placex to save transliterated names
|
||||
|
||||
3.6.0
|
||||
|
||||
* add full support for searching by and displaying of addr:* tags
|
||||
* improve address output for large-area objects
|
||||
* better use of country names from OSM data for search and display
|
||||
* better debug output for reverse call
|
||||
* add support for addr:place links without an place equivalent in OSM
|
||||
* improve finding postcodes with normalisation artefacts
|
||||
* batch object to index for rank 30, avoiding a wrap-around of transaction
|
||||
IDs in PostgreSQL
|
||||
* introduce dynamic address rank computation for administrative boundaries
|
||||
depending on linked objects and their place in the admin level hierarchy
|
||||
* add country-specific address ranking for Indonesia, Russia, Belgium and
|
||||
the Netherlands (thanks @hendrikmoree)
|
||||
* make sure wikidata/wikipedia tags are imported for all styles
|
||||
* make POIs searchable by name and housenumber (thanks @joy-yyd)
|
||||
* reverse geocoding now ignores places without an address rank (rivers etc.)
|
||||
* installation of a webserver is no longer mandatory, for development
|
||||
use the php internal webserver via 'make serve
|
||||
* reduce the influence of place nodes in addresses
|
||||
* drop support for the unspecific is_in tag
|
||||
* various minor tweaks to supplied styles
|
||||
* move HTML web frontend into its own project
|
||||
* move scripts for processing external data sources into separate directories
|
||||
* introduce separate configuration for website (thanks @krahulreddy)
|
||||
* update documentation, in particular, clean up development docs
|
||||
* update osm2pgsql to 1.4.0
|
||||
|
||||
3.5.2
|
||||
|
||||
* ensure that wikipedia tags are imported for all styles
|
||||
* reinstate verbosity for indexing during updates
|
||||
* make house number reappear in display name on named POIs
|
||||
* introduce batch processing in indexer to avoid transaction ID overrun
|
||||
* increase splitting for large geometries to improve indexing speed
|
||||
* remove deprecated get_magic_quotes_gpc() function
|
||||
* make sure that all postcodes have an entry in word and are thus searchable
|
||||
* remove use of ST_Covers in conjunction with ST_Intersects,
|
||||
causes bad query planning and slow updates in Postgis3
|
||||
* update osm2pgsql
|
||||
|
||||
3.5.1
|
||||
|
||||
* disable jit and parallel processing in PostgreSQL for osm2pgsql
|
||||
* update libosmium to 2.15.6 (fixes an issue with processing hanging
|
||||
on large multipolygons)
|
||||
|
||||
3.5.0
|
||||
|
||||
* structured select on HTML search page
|
||||
@@ -11,7 +338,7 @@
|
||||
* cleanup of partition function
|
||||
* improve parenting for large POIs
|
||||
* add support for Postgresql 12 and Postgis 3
|
||||
* add earlier cleanup when --drop is given, to reduce meory usage
|
||||
* add earlier cleanup when --drop is given, to reduce memory usage
|
||||
* remove use of place_id in URLs
|
||||
* replace C nominatim indexer with a simpler Python implementation
|
||||
* split up the huge sql/functions.sql file
|
||||
@@ -45,7 +372,7 @@
|
||||
* exclude postcode ranges separated by colon from centre point calculation
|
||||
* update osm2pgsql, better handling of imports without flatnode file
|
||||
* switch to more efficient algorithm for word set computation
|
||||
* use only boundries for country and state parts of addresses
|
||||
* use only boundaries for country and state parts of addresses
|
||||
* improve updates of addresses with housenumbers and interpolations
|
||||
* remove country from place_addressline table and use country_code instead
|
||||
* optimise indexes on search_name partition tables
|
||||
@@ -84,7 +411,7 @@
|
||||
|
||||
* complete rewrite of reverse search algorithm
|
||||
* add new geojson and geocodejson output formats
|
||||
* add simple export script to exprot addresses to CSV
|
||||
* add simple export script to export addresses to CSV
|
||||
* remove is_in terms from address computation
|
||||
* remove unused search_name_country tables
|
||||
* various smaller fixes to query parsing
|
||||
@@ -149,7 +476,7 @@
|
||||
* move installation documentation into this repo
|
||||
* add self-documenting vagrant scripts
|
||||
* remove --create-website, recommend to use website directory in build
|
||||
* add accessor functions for URL parameters and improve erro checking
|
||||
* add accessor functions for URL parameters and improve error checking
|
||||
* remove IP blocking and rate-limiting code
|
||||
* enable CI via travis
|
||||
* reformatting for more consistent coding style
|
||||
@@ -160,7 +487,7 @@
|
||||
* update to refactored osm2pgsql which use libosmium based types
|
||||
* switch from osmosis to pyosmium for updates
|
||||
* be more strict when matching against special search terms
|
||||
* handle postcode entries with mutliple values correctly
|
||||
* handle postcode entries with multiple values correctly
|
||||
|
||||
2.5
|
||||
|
||||
|
||||
202
LICENSES/Apache-2.0.txt
Normal file
202
LICENSES/Apache-2.0.txt
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
339
LICENSES/GPL-2.0-only.txt
Normal file
339
LICENSES/GPL-2.0-only.txt
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
44
Makefile
Normal file
44
Makefile
Normal file
@@ -0,0 +1,44 @@
|
||||
all:
|
||||
|
||||
# Building of wheels
|
||||
|
||||
build: clean-build build-db build-api
|
||||
|
||||
clean-build:
|
||||
rm -f dist/*
|
||||
|
||||
build-db:
|
||||
python3 -m build packaging/nominatim-db --outdir dist/
|
||||
|
||||
build-api:
|
||||
python3 -m build packaging/nominatim-api --outdir dist/
|
||||
|
||||
# Tests
|
||||
|
||||
tests: mypy lint pytest bdd
|
||||
|
||||
mypy:
|
||||
mypy --strict src
|
||||
|
||||
pytest:
|
||||
pytest test/python
|
||||
|
||||
lint:
|
||||
pylint src
|
||||
|
||||
bdd:
|
||||
cd test/bdd; behave -DREMOVE_TEMPLATE=1
|
||||
|
||||
# Documentation
|
||||
|
||||
doc:
|
||||
mkdocs build
|
||||
|
||||
serve-doc:
|
||||
mkdocs serve
|
||||
|
||||
manpage:
|
||||
argparse-manpage --pyfile man/create-manpage.py --function get_parser --project-name Nominatim --url https://nominatim.org > man/nominatim.1 --author 'the Nominatim developer community' --author-email info@nominatim.org
|
||||
|
||||
|
||||
.PHONY: tests mypy pytest lint bdd build clean-build build-db build-api doc serve-doc manpage
|
||||
50
README.md
50
README.md
@@ -1,4 +1,4 @@
|
||||
[](https://travis-ci.org/osm-search/Nominatim)
|
||||
[](https://github.com/osm-search/Nominatim/actions?query=workflow%3A%22CI+Tests%22)
|
||||
|
||||
Nominatim
|
||||
=========
|
||||
@@ -19,20 +19,11 @@ https://nominatim.org/release-docs/develop/ .
|
||||
Installation
|
||||
============
|
||||
|
||||
**Nominatim is a complex piece of software and runs in a complex environment.
|
||||
Installing and running Nominatim is something for experienced system
|
||||
administrators only who can do some trouble-shooting themselves. We are sorry,
|
||||
but we can not provide installation support. We are all doing this in our free
|
||||
time and there is just so much of that time to go around. Do not open issues in
|
||||
our bug tracker if you need help. You can ask questions on the mailing list
|
||||
(see below) or on [help.openstreetmap.org](https://help.openstreetmap.org/).**
|
||||
|
||||
The latest stable release can be downloaded from https://nominatim.org.
|
||||
There you can also find [installation instructions for the release](https://nominatim.org/release-docs/latest/admin/Installation), as well as an extensive [Troubleshooting/FAQ section](https://nominatim.org/release-docs/latest/admin/Faq/).
|
||||
|
||||
Detailed installation instructions for the development version can be
|
||||
found at [nominatim.org](https://nominatim.org/release-docs/develop/admin/Installation)
|
||||
as well.
|
||||
[Detailed installation instructions for current master](https://nominatim.org/release-docs/develop/admin/Installation)
|
||||
can be found at nominatim.org as well.
|
||||
|
||||
A quick summary of the necessary steps:
|
||||
|
||||
@@ -42,30 +33,45 @@ A quick summary of the necessary steps:
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
|
||||
2. Get OSM data and import:
|
||||
2. Create a project directory, get OSM data and import:
|
||||
|
||||
./build/utils/setup.php --osm-file <your planet file> --all
|
||||
mkdir nominatim-project
|
||||
cd nominatim-project
|
||||
nominatim import --osm-file <your planet file>
|
||||
|
||||
3. Point your webserver to the ./build/website directory.
|
||||
3. Point your webserver to the nominatim-project/website directory.
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
The source code is available under a GPLv2 license.
|
||||
The Python source code is available under a GPL license version 3 or later.
|
||||
The Lua configuration files for osm2pgsql are released under the
|
||||
Apache License, Version 2.0. All other files are under a GPLv2 license.
|
||||
|
||||
|
||||
Contributing
|
||||
============
|
||||
|
||||
Contributions are welcome. For details see [contribution guide](CONTRIBUTING.md).
|
||||
Contributions, bug reports and pull requests are welcome. When reporting a
|
||||
bug, please use one of the
|
||||
[issue templates](https://github.com/osm-search/Nominatim/issues/new/choose)
|
||||
and make sure to provide all the information requested. If you are not
|
||||
sure if you have really found a bug, please ask for help in the forums
|
||||
first (see 'Questions' below).
|
||||
|
||||
Both bug reports and pull requests are welcome.
|
||||
For details on contributing, have a look at the
|
||||
[contribution guide](CONTRIBUTING.md).
|
||||
|
||||
|
||||
Mailing list
|
||||
============
|
||||
Questions and help
|
||||
==================
|
||||
|
||||
For questions you can join the geocoding mailing list, see
|
||||
https://lists.openstreetmap.org/listinfo/geocoding
|
||||
If you have questions about search results and the OpenStreetMap data
|
||||
used in the search, use the [OSM Forum](https://community.openstreetmap.org/).
|
||||
|
||||
For questions, community help and discussions around the software and
|
||||
your own installation of Nominatim, use the
|
||||
[Github discussions forum](https://github.com/osm-search/Nominatim/discussions).
|
||||
|
||||
41
SECURITY.md
Normal file
41
SECURITY.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
All Nominatim releases receive security updates for two years.
|
||||
|
||||
The following table lists the end of support for all currently supported
|
||||
versions.
|
||||
|
||||
| Version | End of support for security updates |
|
||||
| ------- | ----------------------------------- |
|
||||
| 4.5.x | 2026-09-12 |
|
||||
| 4.4.x | 2026-03-07 |
|
||||
| 4.3.x | 2025-09-07 |
|
||||
| 4.2.x | 2024-11-24 |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you believe, you have found an issue in Nominatim that has implications on
|
||||
security, please send a description of the issue to **security@nominatim.org**.
|
||||
You will receive an acknowledgement of your mail within 3 work days where we
|
||||
also notify you of the next steps.
|
||||
|
||||
## How we Disclose Security Issues
|
||||
|
||||
** The following section only applies to security issues found in released
|
||||
versions. Issues that concern the master development branch only will be
|
||||
fixed immediately on the branch with the corresponding PR containing the
|
||||
description of the nature and severity of the issue. **
|
||||
|
||||
Patches for identified security issues are applied to all affected versions and
|
||||
new minor versions are released. At the same time we release a statement at
|
||||
the [Nominatim blog](https://nominatim.org/blog/) describing the nature of the
|
||||
incident. Announcements will also be published at the
|
||||
[geocoding mailinglist](https://lists.openstreetmap.org/listinfo/geocoding).
|
||||
|
||||
## List of Previous Incidents
|
||||
|
||||
* 2023-11-20 - [SQL injection vulnerability](https://nominatim.org/2023/11/20/release-432.html)
|
||||
* 2023-02-21 - [cross-site scripting vulnerability](https://nominatim.org/2023/02/21/release-421.html)
|
||||
* 2020-05-04 - [SQL injection issue on /details endpoint](https://lists.openstreetmap.org/pipermail/geocoding/2020-May/002012.html)
|
||||
42
VAGRANT.md
42
VAGRANT.md
@@ -1,6 +1,6 @@
|
||||
# Install Nominatim in a virtual machine for development and testing
|
||||
|
||||
This document describes how you can install Nominatim inside a Ubuntu 16
|
||||
This document describes how you can install Nominatim inside a Ubuntu 22
|
||||
virtual machine on your desktop/laptop (host machine). The goal is to give
|
||||
you a development environment to easily edit code and run the test suite
|
||||
without affecting the rest of your system.
|
||||
@@ -42,9 +42,9 @@ is.
|
||||
|
||||
```
|
||||
# inside the virtual machine:
|
||||
cd build
|
||||
wget --no-verbose --output-document=/tmp/monaco.osm.pbf http://download.geofabrik.de/europe/monaco-latest.osm.pbf
|
||||
./utils/setup.php --osm-file /tmp/monaco.osm.pbf --osm2pgsql-cache 1000 --all 2>&1 | tee monaco.$$.log
|
||||
cd nominatim-project
|
||||
wget --no-verbose --output-document=monaco.osm.pbf http://download.geofabrik.de/europe/monaco-latest.osm.pbf
|
||||
nominatim import --osm-file monaco.osm.pbf 2>&1 | tee monaco.$$.log
|
||||
```
|
||||
|
||||
To repeat an import you'd need to delete the database first
|
||||
@@ -56,7 +56,7 @@ is.
|
||||
## Development
|
||||
|
||||
Vagrant maps the virtual machine's port 8089 to your host machine. Thus you can
|
||||
see Nominatim in action on [locahost:8089](http://localhost:8089/nominatim/).
|
||||
see Nominatim in action on [localhost:8089](http://localhost:8089/nominatim/).
|
||||
|
||||
You edit code on your host machine in any editor you like. There is no need to
|
||||
restart any software: just refresh your browser window.
|
||||
@@ -69,8 +69,7 @@ installation.
|
||||
PHP errors are written to `/var/log/apache2/error.log`.
|
||||
|
||||
With `echo` and `var_dump()` you write into the output (HTML/XML/JSON) when
|
||||
you either add `&debug=1` to the URL (preferred) or set
|
||||
`@define('CONST_Debug', true);` in `settings/local.php`.
|
||||
you either add `&debug=1` to the URL.
|
||||
|
||||
In the Python BDD test you can use `logger.info()` for temporary debug
|
||||
statements.
|
||||
@@ -130,6 +129,10 @@ and then
|
||||
Yes, Vagrant and Virtualbox can be installed on MS Windows just fine. You need a 64bit
|
||||
version of Windows.
|
||||
|
||||
##### Will it run on Apple Silicon?
|
||||
|
||||
You might need to replace Virtualbox with [Parallels](https://www.parallels.com/products/desktop/).
|
||||
There is no free/open source version of Parallels.
|
||||
|
||||
##### Why Monaco, can I use another country?
|
||||
|
||||
@@ -141,11 +144,12 @@ No. Long running Nominatim installations will differ once new import features (o
|
||||
bug fixes) get added since those usually only get applied to new/changed data.
|
||||
|
||||
Also this document skips the optional Wikipedia data import which affects ranking
|
||||
of search results. See [Nominatim installation](https://nominatim.org/release-docs/latest/admin/Installation) for details.
|
||||
of search results. See [Nominatim installation](https://nominatim.org/release-docs/latest/admin/Installation)
|
||||
for details.
|
||||
|
||||
##### Why Ubuntu? Can I test CentOS/Fedora/CoreOS/FreeBSD?
|
||||
|
||||
There is a Vagrant script for CentOS available, but the Nominatim directory
|
||||
There used to be a Vagrant script for CentOS available, but the Nominatim directory
|
||||
isn't symlinked/mounted to the host which makes development trickier. We used
|
||||
it mainly for debugging installation with SELinux.
|
||||
|
||||
@@ -154,26 +158,30 @@ are slightly different, e.g. the name of the package manager, Apache2 package
|
||||
name, location of files. We chose Ubuntu because that is closest to the
|
||||
nominatim.openstreetmap.org production environment.
|
||||
|
||||
You can configure/download other Vagrant boxes from [https://app.vagrantup.com/boxes/search](https://app.vagrantup.com/boxes/search).
|
||||
You can configure/download other Vagrant boxes from
|
||||
[https://app.vagrantup.com/boxes/search](https://app.vagrantup.com/boxes/search).
|
||||
|
||||
##### How can I connect to an existing database?
|
||||
|
||||
Let's say you have a Postgres database named `nominatim_it` on server `your-server.com` and port `5432`. The Postgres username is `postgres`. You can edit `settings/local.php` and point Nominatim to it.
|
||||
Let's say you have a Postgres database named `nominatim_it` on server `your-server.com`
|
||||
and port `5432`. The Postgres username is `postgres`. You can edit the `.env` in your
|
||||
project directory and point Nominatim to it.
|
||||
|
||||
pgsql://postgres@your-server.com:5432/nominatim_it
|
||||
|
||||
No data import necessary or restarting necessary.
|
||||
NOMINATIM_DATABASE_DSN="pgsql:host=your-server.com;port=5432;user=postgres;dbname=nominatim_it
|
||||
|
||||
No data import or restarting necessary.
|
||||
|
||||
If the Postgres installation is behind a firewall, you can try
|
||||
|
||||
ssh -L 9999:localhost:5432 your-username@your-server.com
|
||||
|
||||
inside the virtual machine. It will map the port to `localhost:9999` and then
|
||||
you edit `settings/local.php` with
|
||||
you edit `.env` file with
|
||||
|
||||
@define('CONST_Database_DSN', 'pgsql:host=localhost;port=9999;user=postgres;dbname=nominatim_it');
|
||||
NOMINATIM_DATABASE_DSN="pgsql:host=localhost;port=9999;user=postgres;dbname=nominatim_it"
|
||||
|
||||
To access postgres directly remember to specify the hostname, e.g. `psql --host localhost --port 9999 nominatim_it`
|
||||
To access postgres directly remember to specify the hostname,
|
||||
e.g. `psql --host localhost --port 9999 nominatim_it`
|
||||
|
||||
|
||||
##### My computer is slow and the import takes too long. Can I start the virtual machine "in the cloud"?
|
||||
|
||||
157
Vagrantfile
vendored
157
Vagrantfile
vendored
@@ -4,88 +4,107 @@
|
||||
Vagrant.configure("2") do |config|
|
||||
# Apache webserver
|
||||
config.vm.network "forwarded_port", guest: 80, host: 8089
|
||||
config.vm.network "forwarded_port", guest: 8088, host: 8088
|
||||
|
||||
# If true, then any SSH connections made will enable agent forwarding.
|
||||
config.ssh.forward_agent = true
|
||||
|
||||
# Never sync the current directory to /vagrant.
|
||||
config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
|
||||
checkout = "yes"
|
||||
if ENV['CHECKOUT'] != 'y' then
|
||||
config.vm.synced_folder ".", "/home/vagrant/Nominatim"
|
||||
checkout = "no"
|
||||
checkout = "no"
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu", primary: true do |sub|
|
||||
sub.vm.box = "bento/ubuntu-20.04"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-20.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout]
|
||||
end
|
||||
config.vm.provider "hyperv" do |hv, override|
|
||||
hv.memory = 2048
|
||||
hv.linked_clone = true
|
||||
if ENV['CHECKOUT'] != 'y' then
|
||||
override.vm.synced_folder ".", "/home/vagrant/Nominatim", type: "smb", smb_host: ENV['SMB_HOST'] || ENV['COMPUTERNAME']
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu18", primary: true do |sub|
|
||||
sub.vm.box = "bento/ubuntu-18.04"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-18.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu18nginx" do |sub|
|
||||
sub.vm.box = "bento/ubuntu-18.04"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-18-nginx.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu16" do |sub|
|
||||
sub.vm.box = "bento/ubuntu-16.04"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-16.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "travis" do |sub|
|
||||
sub.vm.box = "bento/ubuntu-14.04"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/install-on-travis-ci.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "centos" do |sub|
|
||||
sub.vm.box = "centos/7"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Centos-7.sh"
|
||||
s.privileged = false
|
||||
s.args = "yes"
|
||||
end
|
||||
sub.vm.synced_folder ".", "/home/vagrant/Nominatim", disabled: true
|
||||
sub.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
end
|
||||
|
||||
config.vm.define "centos8" do |sub|
|
||||
sub.vm.box = "generic/centos8"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Centos-8.sh"
|
||||
s.privileged = false
|
||||
s.args = "yes"
|
||||
end
|
||||
sub.vm.synced_folder ".", "/home/vagrant/Nominatim", disabled: true
|
||||
sub.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
end
|
||||
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
config.vm.provider "virtualbox" do |vb, override|
|
||||
vb.gui = false
|
||||
vb.memory = 2048
|
||||
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant","0"]
|
||||
if ENV['CHECKOUT'] != 'y' then
|
||||
override.vm.synced_folder ".", "/home/vagrant/Nominatim"
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.provider "parallels" do |prl, override|
|
||||
prl.update_guest_tools = false
|
||||
prl.memory = 2048
|
||||
if ENV['CHECKOUT'] != 'y' then
|
||||
override.vm.synced_folder ".", "/home/vagrant/Nominatim"
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.provider "libvirt" do |lv, override|
|
||||
lv.memory = 2048
|
||||
lv.nested = true
|
||||
if ENV['CHECKOUT'] != 'y' then
|
||||
override.vm.synced_folder ".", "/home/vagrant/Nominatim", type: 'nfs', nfs_udp: false
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu22", primary: true do |sub|
|
||||
sub.vm.box = "generic/ubuntu2204"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-22.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu22-apache" do |sub|
|
||||
sub.vm.box = "generic/ubuntu2204"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-22.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout, "install-apache"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu22-nginx" do |sub|
|
||||
sub.vm.box = "generic/ubuntu2204"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-22.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout, "install-nginx"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu24" do |sub|
|
||||
sub.vm.box = "bento/ubuntu-24.04"
|
||||
if RUBY_PLATFORM.include?('darwin') && RUBY_PLATFORM.include?('arm64')
|
||||
# Apple M processor
|
||||
sub.vm.box = 'gutehall/ubuntu24-04'
|
||||
end
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-24.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu24-apache" do |sub|
|
||||
sub.vm.box = "bento/ubuntu-24.04"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-24.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout, "install-apache"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "ubuntu24-nginx" do |sub|
|
||||
sub.vm.box = "bento/ubuntu-24.04"
|
||||
sub.vm.provision :shell do |s|
|
||||
s.path = "vagrant/Install-on-Ubuntu-24.sh"
|
||||
s.privileged = false
|
||||
s.args = [checkout, "install-nginx"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
15
cmake/paths-py-no-php.tmpl
Normal file
15
cmake/paths-py-no-php.tmpl
Normal file
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# This file is part of Nominatim. (https://nominatim.org)
|
||||
#
|
||||
# Copyright (C) 2022 by the Nominatim developer community.
|
||||
# For a full list of authors see the git log.
|
||||
"""
|
||||
Path settings for extra data used by Nominatim (installed version).
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
PHPLIB_DIR = None
|
||||
SQLLIB_DIR = (Path('@NOMINATIM_LIBDIR@') / 'lib-sql').resolve()
|
||||
DATA_DIR = Path('@NOMINATIM_DATADIR@').resolve()
|
||||
CONFIG_DIR = Path('@NOMINATIM_CONFIGDIR@').resolve()
|
||||
15
cmake/paths-py.tmpl
Normal file
15
cmake/paths-py.tmpl
Normal file
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# This file is part of Nominatim. (https://nominatim.org)
|
||||
#
|
||||
# Copyright (C) 2022 by the Nominatim developer community.
|
||||
# For a full list of authors see the git log.
|
||||
"""
|
||||
Path settings for extra data used by Nominatim (installed version).
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
PHPLIB_DIR = (Path('@NOMINATIM_LIBDIR@') / 'lib-php').resolve()
|
||||
SQLLIB_DIR = (Path('@NOMINATIM_LIBDIR@') / 'lib-sql').resolve()
|
||||
DATA_DIR = Path('@NOMINATIM_DATADIR@').resolve()
|
||||
CONFIG_DIR = Path('@NOMINATIM_CONFIGDIR@').resolve()
|
||||
@@ -1,4 +0,0 @@
|
||||
#!@PHP_BIN@ -Cq
|
||||
<?php
|
||||
require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
|
||||
require_once(CONST_BasePath.'/@script_source@');
|
||||
13
cmake/tool-installed.tmpl
Normal file
13
cmake/tool-installed.tmpl
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.insert(1, '@NOMINATIM_LIBDIR@/lib-python')
|
||||
|
||||
from nominatim_db import cli
|
||||
from nominatim_db import version
|
||||
|
||||
version.GIT_COMMIT_HASH = '@GIT_HASH@'
|
||||
|
||||
exit(cli.nominatim(module_dir='@NOMINATIM_LIBDIR@/module',
|
||||
osm2pgsql_path='@NOMINATIM_LIBDIR@/osm2pgsql'))
|
||||
13
cmake/tool.tmpl
Executable file
13
cmake/tool.tmpl
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.insert(1, '@CMAKE_SOURCE_DIR@/src')
|
||||
|
||||
from nominatim_db import cli
|
||||
from nominatim_db import version
|
||||
|
||||
version.GIT_COMMIT_HASH = '@GIT_HASH@'
|
||||
|
||||
exit(cli.nominatim(module_dir='@CMAKE_BINARY_DIR@/module',
|
||||
osm2pgsql_path='@CMAKE_BINARY_DIR@/osm2pgsql/osm2pgsql'))
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
|
||||
require_once(CONST_BasePath.'/@script_source@');
|
||||
@@ -1,77 +0,0 @@
|
||||
# Fallback Country Boundaries
|
||||
|
||||
Each place is assigned a `country_code` and partition. Partitions derive from `country_code`.
|
||||
|
||||
Nominatim imports two pre-generated files
|
||||
|
||||
* `data/country_name.sql` (country code, name, default language, partition)
|
||||
* `data/country_osm_grid.sql` (country code, geometry)
|
||||
|
||||
before creating places in the database. This helps with fast lookups and missing data (e.g. if the data the user wants to import doesn't contain any country places).
|
||||
|
||||
The number of countries in the world can change (South Sudan created 2011, Germany reunification), so can their boundaries. This document explain how the pre-generated files can be updated.
|
||||
|
||||
|
||||
|
||||
## Country code
|
||||
|
||||
Each place is assigned a two letter country_code based on its location, e.g. `gb` for Great Britain. Or `NULL` if no suitable country is found (usually it's in open water then).
|
||||
|
||||
In `sql/functions.sql: get_country_code(geometry)` the place's center is checked against
|
||||
|
||||
1. country places already imported from the user's data file. Places are imported by rank low-to-high. Lowest rank 2 is countries so most places should be matched. Still the data file might be incomplete.
|
||||
2. if unmatched: OSM grid boundaries
|
||||
3. if still unmatched: OSM grid boundaries, but allow a small distance
|
||||
|
||||
|
||||
|
||||
## Partitions
|
||||
|
||||
Each place is assigned partition, which is a number 0..250. 0 is fallback/other.
|
||||
|
||||
During place indexing (`sql/functions.sql: placex_insert()`) a place is assigned the partition based on its country code (`sql/functions.sql: get_partition(country_code)`). It checks in the `country_name` table.
|
||||
|
||||
Most countries have their own partition, some share a partition. Thus partition counts vary greatly.
|
||||
|
||||
Several database tables are split by partition to allow queries to run against less indices and improve caching.
|
||||
|
||||
* `location_area_large_<partition>`
|
||||
* `search_name_<partition>`
|
||||
* `location_road_<partition>`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Data files
|
||||
|
||||
### data/country_name.sql
|
||||
|
||||
Export from existing database table plus manual changes. `country_default_language_code` most taken from [https://wiki.openstreetmap.org/wiki/Nominatim/Country_Codes](), see `utils/country_languages.php`.
|
||||
|
||||
|
||||
|
||||
### data/country_osm_grid.sql
|
||||
|
||||
`country_grid.sql` merges territories by country. Then uses `function.sql: quad_split_geometry` to split each country into multiple [Quadtree](https://en.wikipedia.org/wiki/Quadtree) polygons for faster point-in-polygon lookups.
|
||||
|
||||
To visualize one country as geojson feature collection, e.g. for loading into [geojson.io](http://geojson.io/):
|
||||
|
||||
```
|
||||
-- http://www.postgresonline.com/journal/archives/267-Creating-GeoJSON-Feature-Collections-with-JSON-and-PostGIS-functions.html
|
||||
|
||||
SELECT row_to_json(fc)
|
||||
FROM (
|
||||
SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features
|
||||
FROM (
|
||||
SELECT 'Feature' As type,
|
||||
ST_AsGeoJSON(lg.geometry)::json As geometry,
|
||||
row_to_json((country_code, area)) As properties
|
||||
FROM country_osm_grid As lg where country_code='mx'
|
||||
) As f
|
||||
) As fc;
|
||||
```
|
||||
|
||||
`cat /tmp/query.sql | psql -At nominatim > /tmp/mexico.quad.geojson`
|
||||
|
||||

|
||||
@@ -1,33 +0,0 @@
|
||||
-- Script to build a calculated country grid from existing tables
|
||||
DROP TABLE IF EXISTS tmp_country_osm_grid;
|
||||
CREATE TABLE tmp_country_osm_grid as select country_name.country_code,st_union(placex.geometry) as geometry from country_name,
|
||||
placex
|
||||
where (lower(placex.country_code) = country_name.country_code)
|
||||
and placex.rank_search < 16 and st_area(placex.geometry) > 0
|
||||
group by country_name.country_code;
|
||||
ALTER TABLE tmp_country_osm_grid add column area double precision;
|
||||
UPDATE tmp_country_osm_grid set area = st_area(geometry::geography);
|
||||
|
||||
-- compare old and new
|
||||
select country_code, round, round(log(area)) from (select distinct country_code,round(log(area)) from country_osm_grid order by country_code) as x
|
||||
left outer join tmp_country_osm_grid using (country_code) where area is null or round(log(area)) != round;
|
||||
|
||||
DROP TABLE IF EXISTS new_country_osm_grid;
|
||||
CREATE TABLE new_country_osm_grid as select country_code,area,quad_split_geometry(geometry,0.5,20) as geometry from tmp_country_osm_grid;
|
||||
CREATE INDEX new_idx_country_osm_grid_geometry ON new_country_osm_grid USING GIST (geometry);
|
||||
|
||||
-- Sometimes there are problems calculating area due to invalid data - optionally recalc
|
||||
UPDATE new_country_osm_grid set area = sum from (select country_code,sum(case when st_area(geometry::geography) = 'NaN' THEN 0 ELSE st_area(geometry::geography) END)
|
||||
from new_country_osm_grid group by country_code) as x where x.country_code = new_country_osm_grid.country_code;
|
||||
|
||||
-- compare old and new
|
||||
select country_code, x.round, y.round from (select distinct country_code,round(log(area)) from country_osm_grid order by country_code) as x
|
||||
left outer join (select distinct country_code,round(log(area)) from new_country_osm_grid order by country_code) as y
|
||||
using (country_code) where x.round != y.round;
|
||||
|
||||
-- Flip the new table in
|
||||
BEGIN;
|
||||
DROP TABLE IF EXISTS country_osm_grid;
|
||||
ALTER TABLE new_country_osm_grid rename to country_osm_grid;
|
||||
ALTER INDEX new_idx_country_osm_grid_geometry RENAME TO idx_country_osm_grid_geometry;
|
||||
COMMIT;
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 320 KiB |
@@ -1,56 +0,0 @@
|
||||
# GB Postcodes
|
||||
|
||||
|
||||
The server [importing instructions](https://www.nominatim.org/release-docs/latest/admin/Import-and-Update/) allow optionally download [`gb_postcode_data.sql.gz`](https://www.nominatim.org/data/gb_postcode_data.sql.gz). This document explains how the file got created.
|
||||
|
||||
## GB vs UK
|
||||
|
||||
GB (Great Britain) is more correct as the Ordnance Survey dataset doesn't contain postcodes from Northern Ireland.
|
||||
|
||||
## Importing separately after the initial import
|
||||
|
||||
If you forgot to download the file, or have a new version, you can import it separately:
|
||||
|
||||
1. Import the downloaded `gb_postcode_data.sql.gz` file.
|
||||
|
||||
2. Run the SQL query `SELECT count(getorcreate_postcode_id(postcode)) FROM gb_postcode;`. This will update the search index.
|
||||
|
||||
3. Run `utils/setup.php --calculate-postcodes` from the build directory. This will copy data form the `gb_postcode` table to the `location_postcodes` table.
|
||||
|
||||
|
||||
|
||||
## Converting Code-Point Open data
|
||||
|
||||
1. Download from [Code-Point® Open](https://www.ordnancesurvey.co.uk/business-and-government/products/code-point-open.html). It requires an email address where a download link will be send to.
|
||||
|
||||
2. `unzip codepo_gb.zip`
|
||||
|
||||
Unpacked you'll see a directory of CSV files.
|
||||
|
||||
$ more codepo_gb/Data/CSV/n.csv
|
||||
"N1 0AA",10,530626,183961,"E92000001","E19000003","E18000007","","E09000019","E05000368"
|
||||
"N1 0AB",10,530559,183978,"E92000001","E19000003","E18000007","","E09000019","E05000368"
|
||||
|
||||
The coordinates are "Northings" and "Eastings" in [OSGB 1936](http://epsg.io/1314) projection. They can be projected to WGS84 like this
|
||||
|
||||
SELECT ST_AsText(ST_Transform(ST_SetSRID('POINT(530626 183961)'::geometry,27700), 4326));
|
||||
POINT(-0.117872733220225 51.5394424719303)
|
||||
|
||||
[-0.117872733220225 51.5394424719303 on OSM map](https://www.openstreetmap.org/?mlon=-0.117872733220225&mlat=51.5394424719303&zoom=16)
|
||||
|
||||
|
||||
|
||||
3. Create database, import CSV files, add geometry column, dump into file
|
||||
|
||||
DBNAME=create_gb_postcode_file
|
||||
createdb $DBNAME
|
||||
echo 'CREATE EXTENSION postgis' | psql $DBNAME
|
||||
|
||||
cat data/gb_postcode_table.sql | psql $DBNAME
|
||||
cat codepo_gb/Data/CSV/*.csv | ./data-sources/gb-postcodes/convert_codepoint.php | psql $DBNAME
|
||||
cat codepo_gb/Doc/licence.txt | iconv -f iso-8859-1 -t utf-8 | dos2unix | sed 's/^/-- /g' > gb_postcode_data.sql
|
||||
pg_dump -a -t gb_postcode $DBNAME | grep -v '^--' >> gb_postcode_data.sql
|
||||
|
||||
gzip -9 -f gb_postcode_data.sql
|
||||
ls -lah gb_postcode_data.*
|
||||
# dropdb $DBNAME
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
echo <<< EOT
|
||||
|
||||
ALTER TABLE gb_postcode ADD COLUMN easting bigint;
|
||||
ALTER TABLE gb_postcode ADD COLUMN northing bigint;
|
||||
|
||||
TRUNCATE gb_postcode;
|
||||
|
||||
COPY gb_postcode (id, postcode, easting, northing) FROM stdin;
|
||||
|
||||
EOT;
|
||||
|
||||
$iCounter = 0;
|
||||
while ($sLine = fgets(STDIN)) {
|
||||
$aColumns = str_getcsv($sLine);
|
||||
|
||||
// insert space before the third last position
|
||||
// https://stackoverflow.com/a/9144834
|
||||
$postcode = $aColumns[0];
|
||||
$postcode = preg_replace('/\s*(...)$/', ' $1', $postcode);
|
||||
|
||||
echo join("\t", array($iCounter, $postcode, $aColumns[2], $aColumns[3]))."\n";
|
||||
|
||||
$iCounter = $iCounter + 1;
|
||||
}
|
||||
|
||||
echo <<< EOT
|
||||
\.
|
||||
|
||||
UPDATE gb_postcode SET geometry=ST_Transform(ST_SetSRID(CONCAT('POINT(', easting, ' ', northing, ')')::geometry, 27700), 4326);
|
||||
|
||||
ALTER TABLE gb_postcode DROP COLUMN easting;
|
||||
ALTER TABLE gb_postcode DROP COLUMN northing;
|
||||
|
||||
EOT;
|
||||
@@ -1,26 +0,0 @@
|
||||
# US TIGER address data
|
||||
|
||||
Convert [TIGER](https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html)/Line dataset of the US Census Bureau to SQL files which can be imported by Nominatim. The created tables in the Nominatim database are separate from OpenStreetMap tables and get queried at search time separately.
|
||||
|
||||
The dataset gets updated once per year. Downloading is prone to be slow (can take a full day) and converting them can take hours as well.
|
||||
|
||||
Replace '2019' with the current year throughout.
|
||||
|
||||
1. Install the GDAL library and python bindings and the unzip tool
|
||||
|
||||
# Ubuntu:
|
||||
sudo apt-get install python3-gdal unzip
|
||||
|
||||
2. Get the TIGER 2019 data. You will need the EDGES files
|
||||
(3,233 zip files, 11GB total).
|
||||
|
||||
wget -r ftp://ftp2.census.gov/geo/tiger/TIGER2019/EDGES/
|
||||
|
||||
3. Convert the data into SQL statements. Adjust the file paths in the scripts as needed
|
||||
|
||||
cd data-sources/us-tiger
|
||||
./convert.sh <input-path> <output-path>
|
||||
|
||||
4. Maybe: package the created files
|
||||
|
||||
tar -czf tiger2019-nominatim-preprocessed.tar.gz tiger
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
INPATH=$1
|
||||
OUTPATH=$2
|
||||
|
||||
if [[ ! -d "$INPATH" ]]; then
|
||||
echo "input path does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$OUTPATH" ]]; then
|
||||
echo "output path does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INREGEX='_([0-9]{5})_edges.zip'
|
||||
WORKPATH="$OUTPATH/tmp-workdir/"
|
||||
mkdir -p "$WORKPATH"
|
||||
|
||||
|
||||
|
||||
INFILES=($INPATH/*.zip)
|
||||
echo "Found ${#INFILES[*]} files."
|
||||
|
||||
for F in ${INFILES[*]}; do
|
||||
# echo $F
|
||||
|
||||
if [[ "$F" =~ $INREGEX ]]; then
|
||||
COUNTYID=${BASH_REMATCH[1]}
|
||||
SHAPEFILE="$WORKPATH/$(basename $F '.zip').shp"
|
||||
SQLFILE="$OUTPATH/$COUNTYID.sql"
|
||||
|
||||
unzip -o -q -d "$WORKPATH" "$F"
|
||||
if [[ ! -e "$SHAPEFILE" ]]; then
|
||||
echo "Unzip failed. $SHAPEFILE not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./tiger_address_convert.py "$SHAPEFILE" "$SQLFILE"
|
||||
|
||||
rm $WORKPATH/*
|
||||
fi
|
||||
done
|
||||
|
||||
OUTFILES=($OUTPATH/*.sql)
|
||||
echo "Wrote ${#OUTFILES[*]} files."
|
||||
|
||||
rmdir $WORKPATH
|
||||
@@ -1,620 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
# Tiger road data to OSM conversion script
|
||||
# Creates Karlsruhe-style address ways beside the main way
|
||||
# based on the Massachusetts GIS script by christopher schmidt
|
||||
|
||||
#BUGS:
|
||||
# On very tight curves, a loop may be generated in the address way.
|
||||
# It would be nice if the ends of the address ways were not pulled back from dead ends
|
||||
|
||||
|
||||
# Ways that include these mtfccs should not be uploaded
|
||||
# H1100 Connector
|
||||
# H3010 Stream/River
|
||||
# H3013 Braided Stream
|
||||
# H3020 Canal, Ditch or Aqueduct
|
||||
# L4130 Point-to-Point Line
|
||||
# L4140 Property/Parcel Line (Including PLSS)
|
||||
# P0001 Nonvisible Linear Legal/Statistical Boundary
|
||||
# P0002 Perennial Shoreline
|
||||
# P0003 Intermittent Shoreline
|
||||
# P0004 Other non-visible bounding Edge (e.g., Census water boundary, boundary of an areal feature)
|
||||
ignoremtfcc = [ "H1100", "H3010", "H3013", "H3020", "L4130", "L4140", "P0001", "P0002", "P0003", "P0004" ]
|
||||
|
||||
# Sets the distance that the address ways should be from the main way, in feet.
|
||||
address_distance = 30
|
||||
|
||||
# Sets the distance that the ends of the address ways should be pulled back from the ends of the main way, in feet
|
||||
address_pullback = 45
|
||||
|
||||
import sys, os.path, json
|
||||
try:
|
||||
from osgeo import ogr
|
||||
from osgeo import osr
|
||||
except:
|
||||
import ogr
|
||||
import osr
|
||||
|
||||
# https://www.census.gov/geo/reference/codes/cou.html
|
||||
# tiger_county_fips.json was generated from the following:
|
||||
# wget https://www2.census.gov/geo/docs/reference/codes/files/national_county.txt
|
||||
# cat national_county.txt | perl -F, -naE'($F[0] ne 'AS') && $F[3] =~ s/ ((city|City|County|District|Borough|City and Borough|Municipio|Municipality|Parish|Island|Census Area)(?:, |\Z))+//; say qq( "$F[1]$F[2]": "$F[3], $F[0]",)'
|
||||
json_fh = open(os.path.dirname(sys.argv[0]) + "/tiger_county_fips.json")
|
||||
county_fips_data = json.load(json_fh)
|
||||
|
||||
def parse_shp_for_geom_and_tags( filename ):
|
||||
#ogr.RegisterAll()
|
||||
|
||||
dr = ogr.GetDriverByName("ESRI Shapefile")
|
||||
poDS = dr.Open( filename )
|
||||
|
||||
if poDS == None:
|
||||
raise "Open failed."
|
||||
|
||||
poLayer = poDS.GetLayer( 0 )
|
||||
|
||||
fieldNameList = []
|
||||
layerDefinition = poLayer.GetLayerDefn()
|
||||
for i in range(layerDefinition.GetFieldCount()):
|
||||
fieldNameList.append(layerDefinition.GetFieldDefn(i).GetName())
|
||||
# sys.stderr.write(",".join(fieldNameList))
|
||||
|
||||
poLayer.ResetReading()
|
||||
|
||||
ret = []
|
||||
|
||||
poFeature = poLayer.GetNextFeature()
|
||||
while poFeature:
|
||||
tags = {}
|
||||
|
||||
# WAY ID
|
||||
tags["tiger:way_id"] = int( poFeature.GetField("TLID") )
|
||||
|
||||
# FEATURE IDENTIFICATION
|
||||
mtfcc = poFeature.GetField("MTFCC");
|
||||
if mtfcc != None:
|
||||
|
||||
if mtfcc == "L4010": #Pipeline
|
||||
tags["man_made"] = "pipeline"
|
||||
if mtfcc == "L4020": #Powerline
|
||||
tags["power"] = "line"
|
||||
if mtfcc == "L4031": #Aerial Tramway/Ski Lift
|
||||
tags["aerialway"] = "cable_car"
|
||||
if mtfcc == "L4110": #Fence Line
|
||||
tags["barrier"] = "fence"
|
||||
if mtfcc == "L4125": #Cliff/Escarpment
|
||||
tags["natural"] = "cliff"
|
||||
if mtfcc == "L4165": #Ferry Crossing
|
||||
tags["route"] = "ferry"
|
||||
if mtfcc == "R1011": #Railroad Feature (Main, Spur, or Yard)
|
||||
tags["railway"] = "rail"
|
||||
ttyp = poFeature.GetField("TTYP")
|
||||
if ttyp != None:
|
||||
if ttyp == "S":
|
||||
tags["service"] = "spur"
|
||||
if ttyp == "Y":
|
||||
tags["service"] = "yard"
|
||||
tags["tiger:ttyp"] = ttyp
|
||||
if mtfcc == "R1051": #Carline, Streetcar Track, Monorail, Other Mass Transit Rail)
|
||||
tags["railway"] = "light_rail"
|
||||
if mtfcc == "R1052": #Cog Rail Line, Incline Rail Line, Tram
|
||||
tags["railway"] = "incline"
|
||||
if mtfcc == "S1100":
|
||||
tags["highway"] = "primary"
|
||||
if mtfcc == "S1200":
|
||||
tags["highway"] = "secondary"
|
||||
if mtfcc == "S1400":
|
||||
tags["highway"] = "residential"
|
||||
if mtfcc == "S1500":
|
||||
tags["highway"] = "track"
|
||||
if mtfcc == "S1630": #Ramp
|
||||
tags["highway"] = "motorway_link"
|
||||
if mtfcc == "S1640": #Service Drive usually along a limited access highway
|
||||
tags["highway"] = "service"
|
||||
if mtfcc == "S1710": #Walkway/Pedestrian Trail
|
||||
tags["highway"] = "path"
|
||||
if mtfcc == "S1720":
|
||||
tags["highway"] = "steps"
|
||||
if mtfcc == "S1730": #Alley
|
||||
tags["highway"] = "service"
|
||||
tags["service"] = "alley"
|
||||
if mtfcc == "S1740": #Private Road for service vehicles (logging, oil, fields, ranches, etc.)
|
||||
tags["highway"] = "service"
|
||||
tags["access"] = "private"
|
||||
if mtfcc == "S1750": #Private Driveway
|
||||
tags["highway"] = "service"
|
||||
tags["access"] = "private"
|
||||
tags["service"] = "driveway"
|
||||
if mtfcc == "S1780": #Parking Lot Road
|
||||
tags["highway"] = "service"
|
||||
tags["service"] = "parking_aisle"
|
||||
if mtfcc == "S1820": #Bike Path or Trail
|
||||
tags["highway"] = "cycleway"
|
||||
if mtfcc == "S1830": #Bridle Path
|
||||
tags["highway"] = "bridleway"
|
||||
tags["tiger:mtfcc"] = mtfcc
|
||||
|
||||
# FEATURE NAME
|
||||
if poFeature.GetField("FULLNAME"):
|
||||
#capitalizes the first letter of each word
|
||||
name = poFeature.GetField( "FULLNAME" )
|
||||
tags["name"] = name
|
||||
|
||||
#Attempt to guess highway grade
|
||||
if name[0:2] == "I-":
|
||||
tags["highway"] = "motorway"
|
||||
if name[0:3] == "US ":
|
||||
tags["highway"] = "primary"
|
||||
if name[0:3] == "US-":
|
||||
tags["highway"] = "primary"
|
||||
if name[0:3] == "Hwy":
|
||||
if tags["highway"] != "primary":
|
||||
tags["highway"] = "secondary"
|
||||
|
||||
# TIGER 2017 no longer contains this field
|
||||
if 'DIVROAD' in fieldNameList:
|
||||
divroad = poFeature.GetField("DIVROAD")
|
||||
if divroad != None:
|
||||
if divroad == "Y" and "highway" in tags and tags["highway"] == "residential":
|
||||
tags["highway"] = "tertiary"
|
||||
tags["tiger:separated"] = divroad
|
||||
|
||||
statefp = poFeature.GetField("STATEFP")
|
||||
countyfp = poFeature.GetField("COUNTYFP")
|
||||
if (statefp != None) and (countyfp != None):
|
||||
county_name = county_fips_data.get(statefp + '' + countyfp)
|
||||
if county_name:
|
||||
tags["tiger:county"] = county_name
|
||||
|
||||
# tlid = poFeature.GetField("TLID")
|
||||
# if tlid != None:
|
||||
# tags["tiger:tlid"] = tlid
|
||||
|
||||
lfromadd = poFeature.GetField("LFROMADD")
|
||||
if lfromadd != None:
|
||||
tags["tiger:lfromadd"] = lfromadd
|
||||
|
||||
rfromadd = poFeature.GetField("RFROMADD")
|
||||
if rfromadd != None:
|
||||
tags["tiger:rfromadd"] = rfromadd
|
||||
|
||||
ltoadd = poFeature.GetField("LTOADD")
|
||||
if ltoadd != None:
|
||||
tags["tiger:ltoadd"] = ltoadd
|
||||
|
||||
rtoadd = poFeature.GetField("RTOADD")
|
||||
if rtoadd != None:
|
||||
tags["tiger:rtoadd"] = rtoadd
|
||||
|
||||
zipl = poFeature.GetField("ZIPL")
|
||||
if zipl != None:
|
||||
tags["tiger:zip_left"] = zipl
|
||||
|
||||
zipr = poFeature.GetField("ZIPR")
|
||||
if zipr != None:
|
||||
tags["tiger:zip_right"] = zipr
|
||||
|
||||
if mtfcc not in ignoremtfcc:
|
||||
# COPY DOWN THE GEOMETRY
|
||||
geom = []
|
||||
|
||||
rawgeom = poFeature.GetGeometryRef()
|
||||
for i in range( rawgeom.GetPointCount() ):
|
||||
geom.append( (rawgeom.GetX(i), rawgeom.GetY(i)) )
|
||||
|
||||
ret.append( (geom, tags) )
|
||||
poFeature = poLayer.GetNextFeature()
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
# ====================================
|
||||
# to do read .prj file for this data
|
||||
# Change the Projcs_wkt to match your datas prj file.
|
||||
# ====================================
|
||||
projcs_wkt = \
|
||||
"""GEOGCS["GCS_North_American_1983",
|
||||
DATUM["D_North_American_1983",
|
||||
SPHEROID["GRS_1980",6378137,298.257222101]],
|
||||
PRIMEM["Greenwich",0],
|
||||
UNIT["Degree",0.017453292519943295]]"""
|
||||
|
||||
from_proj = osr.SpatialReference()
|
||||
from_proj.ImportFromWkt( projcs_wkt )
|
||||
|
||||
# output to WGS84
|
||||
to_proj = osr.SpatialReference()
|
||||
to_proj.SetWellKnownGeogCS( "EPSG:4326" )
|
||||
|
||||
tr = osr.CoordinateTransformation( from_proj, to_proj )
|
||||
|
||||
import math
|
||||
def length(segment, nodelist):
|
||||
'''Returns the length (in feet) of a segment'''
|
||||
first = True
|
||||
distance = 0
|
||||
lat_feet = 364613 #The approximate number of feet in one degree of latitude
|
||||
for point in segment:
|
||||
pointid, (lat, lon) = nodelist[ round_point( point ) ]
|
||||
if first:
|
||||
first = False
|
||||
else:
|
||||
#The approximate number of feet in one degree of longitute
|
||||
lrad = math.radians(lat)
|
||||
lon_feet = 365527.822 * math.cos(lrad) - 306.75853 * math.cos(3 * lrad) + 0.3937 * math.cos(5 * lrad)
|
||||
distance += math.sqrt(((lat - previous[0])*lat_feet)**2 + ((lon - previous[1])*lon_feet)**2)
|
||||
previous = (lat, lon)
|
||||
return distance
|
||||
|
||||
def addressways(waylist, nodelist, first_id):
|
||||
id = first_id
|
||||
lat_feet = 364613 #The approximate number of feet in one degree of latitude
|
||||
distance = float(address_distance)
|
||||
ret = []
|
||||
|
||||
for waykey, segments in waylist.items():
|
||||
waykey = dict(waykey)
|
||||
rsegments = []
|
||||
lsegments = []
|
||||
for segment in segments:
|
||||
lsegment = []
|
||||
rsegment = []
|
||||
lastpoint = None
|
||||
|
||||
# Don't pull back the ends of very short ways too much
|
||||
seglength = length(segment, nodelist)
|
||||
if seglength < float(address_pullback) * 3.0:
|
||||
pullback = seglength / 3.0
|
||||
else:
|
||||
pullback = float(address_pullback)
|
||||
if "tiger:lfromadd" in waykey:
|
||||
lfromadd = waykey["tiger:lfromadd"]
|
||||
else:
|
||||
lfromadd = None
|
||||
if "tiger:ltoadd" in waykey:
|
||||
ltoadd = waykey["tiger:ltoadd"]
|
||||
else:
|
||||
ltoadd = None
|
||||
if "tiger:rfromadd" in waykey:
|
||||
rfromadd = waykey["tiger:rfromadd"]
|
||||
else:
|
||||
rfromadd = None
|
||||
if "tiger:rtoadd" in waykey:
|
||||
rtoadd = waykey["tiger:rtoadd"]
|
||||
else:
|
||||
rtoadd = None
|
||||
if rfromadd != None and rtoadd != None:
|
||||
right = True
|
||||
else:
|
||||
right = False
|
||||
if lfromadd != None and ltoadd != None:
|
||||
left = True
|
||||
else:
|
||||
left = False
|
||||
if left or right:
|
||||
first = True
|
||||
firstpointid, firstpoint = nodelist[ round_point( segment[0] ) ]
|
||||
|
||||
finalpointid, finalpoint = nodelist[ round_point( segment[len(segment) - 1] ) ]
|
||||
for point in segment:
|
||||
pointid, (lat, lon) = nodelist[ round_point( point ) ]
|
||||
|
||||
#The approximate number of feet in one degree of longitute
|
||||
lrad = math.radians(lat)
|
||||
lon_feet = 365527.822 * math.cos(lrad) - 306.75853 * math.cos(3 * lrad) + 0.3937 * math.cos(5 * lrad)
|
||||
|
||||
#Calculate the points of the offset ways
|
||||
if lastpoint != None:
|
||||
#Skip points too close to start
|
||||
if math.sqrt((lat * lat_feet - firstpoint[0] * lat_feet)**2 + (lon * lon_feet - firstpoint[1] * lon_feet)**2) < pullback:
|
||||
#Preserve very short ways (but will be rendered backwards)
|
||||
if pointid != finalpointid:
|
||||
continue
|
||||
#Skip points too close to end
|
||||
if math.sqrt((lat * lat_feet - finalpoint[0] * lat_feet)**2 + (lon * lon_feet - finalpoint[1] * lon_feet)**2) < pullback:
|
||||
#Preserve very short ways (but will be rendered backwards)
|
||||
if (pointid != firstpointid) and (pointid != finalpointid):
|
||||
continue
|
||||
|
||||
X = (lon - lastpoint[1]) * lon_feet
|
||||
Y = (lat - lastpoint[0]) * lat_feet
|
||||
if Y != 0:
|
||||
theta = math.pi/2 - math.atan( X / Y)
|
||||
Xp = math.sin(theta) * distance
|
||||
Yp = math.cos(theta) * distance
|
||||
else:
|
||||
Xp = 0
|
||||
if X > 0:
|
||||
Yp = -distance
|
||||
else:
|
||||
Yp = distance
|
||||
|
||||
if Y > 0:
|
||||
Xp = -Xp
|
||||
else:
|
||||
Yp = -Yp
|
||||
|
||||
if first:
|
||||
first = False
|
||||
dX = - (Yp * (pullback / distance)) / lon_feet #Pull back the first point
|
||||
dY = (Xp * (pullback / distance)) / lat_feet
|
||||
if left:
|
||||
lpoint = (lastpoint[0] + (Yp / lat_feet) - dY, lastpoint[1] + (Xp / lon_feet) - dX)
|
||||
lsegment.append( (id, lpoint) )
|
||||
id += 1
|
||||
if right:
|
||||
rpoint = (lastpoint[0] - (Yp / lat_feet) - dY, lastpoint[1] - (Xp / lon_feet) - dX)
|
||||
rsegment.append( (id, rpoint) )
|
||||
id += 1
|
||||
|
||||
else:
|
||||
#round the curves
|
||||
if delta[1] != 0:
|
||||
theta = abs(math.atan(delta[0] / delta[1]))
|
||||
else:
|
||||
theta = math.pi / 2
|
||||
if Xp != 0:
|
||||
theta = theta - abs(math.atan(Yp / Xp))
|
||||
else: theta = theta - math.pi / 2
|
||||
r = 1 + abs(math.tan(theta/2))
|
||||
if left:
|
||||
lpoint = (lastpoint[0] + (Yp + delta[0]) * r / (lat_feet * 2), lastpoint[1] + (Xp + delta[1]) * r / (lon_feet * 2))
|
||||
lsegment.append( (id, lpoint) )
|
||||
id += 1
|
||||
if right:
|
||||
rpoint = (lastpoint[0] - (Yp + delta[0]) * r / (lat_feet * 2), lastpoint[1] - (Xp + delta[1]) * r / (lon_feet * 2))
|
||||
|
||||
rsegment.append( (id, rpoint) )
|
||||
id += 1
|
||||
|
||||
delta = (Yp, Xp)
|
||||
|
||||
lastpoint = (lat, lon)
|
||||
|
||||
|
||||
#Add in the last node
|
||||
dX = - (Yp * (pullback / distance)) / lon_feet
|
||||
dY = (Xp * (pullback / distance)) / lat_feet
|
||||
if left:
|
||||
lpoint = (lastpoint[0] + (Yp + delta[0]) / (lat_feet * 2) + dY, lastpoint[1] + (Xp + delta[1]) / (lon_feet * 2) + dX )
|
||||
lsegment.append( (id, lpoint) )
|
||||
id += 1
|
||||
if right:
|
||||
rpoint = (lastpoint[0] - Yp / lat_feet + dY, lastpoint[1] - Xp / lon_feet + dX)
|
||||
rsegment.append( (id, rpoint) )
|
||||
id += 1
|
||||
|
||||
#Generate the tags for ways and nodes
|
||||
zipr = ''
|
||||
zipl = ''
|
||||
name = ''
|
||||
county = ''
|
||||
if "tiger:zip_right" in waykey:
|
||||
zipr = waykey["tiger:zip_right"]
|
||||
if "tiger:zip_left" in waykey:
|
||||
zipl = waykey["tiger:zip_left"]
|
||||
if "name" in waykey:
|
||||
name = waykey["name"]
|
||||
if "tiger:county" in waykey:
|
||||
county = waykey["tiger:county"]
|
||||
if "tiger:separated" in waykey: # No longer set in Tiger-2017
|
||||
separated = waykey["tiger:separated"]
|
||||
else:
|
||||
separated = "N"
|
||||
|
||||
#Write the nodes of the offset ways
|
||||
if right:
|
||||
rlinestring = [];
|
||||
for i, point in rsegment:
|
||||
rlinestring.append( "%f %f" % (point[1], point[0]) )
|
||||
if left:
|
||||
llinestring = [];
|
||||
for i, point in lsegment:
|
||||
llinestring.append( "%f %f" % (point[1], point[0]) )
|
||||
if right:
|
||||
rsegments.append( rsegment )
|
||||
if left:
|
||||
lsegments.append( lsegment )
|
||||
rtofromint = right #Do the addresses convert to integers?
|
||||
ltofromint = left #Do the addresses convert to integers?
|
||||
if right:
|
||||
try: rfromint = int(rfromadd)
|
||||
except:
|
||||
print("Non integer address: %s" % rfromadd)
|
||||
rtofromint = False
|
||||
try: rtoint = int(rtoadd)
|
||||
except:
|
||||
print("Non integer address: %s" % rtoadd)
|
||||
rtofromint = False
|
||||
if left:
|
||||
try: lfromint = int(lfromadd)
|
||||
except:
|
||||
print("Non integer address: %s" % lfromadd)
|
||||
ltofromint = False
|
||||
try: ltoint = int(ltoadd)
|
||||
except:
|
||||
print("Non integer address: %s" % ltoadd)
|
||||
ltofromint = False
|
||||
if right:
|
||||
id += 1
|
||||
|
||||
interpolationtype = "all";
|
||||
if rtofromint:
|
||||
if (rfromint % 2) == 0 and (rtoint % 2) == 0:
|
||||
if separated == "Y": #Doesn't matter if there is another side
|
||||
interpolationtype = "even";
|
||||
elif ltofromint and (lfromint % 2) == 1 and (ltoint % 2) == 1:
|
||||
interpolationtype = "even";
|
||||
elif (rfromint % 2) == 1 and (rtoint % 2) == 1:
|
||||
if separated == "Y": #Doesn't matter if there is another side
|
||||
interpolationtype = "odd";
|
||||
elif ltofromint and (lfromint % 2) == 0 and (ltoint % 2) == 0:
|
||||
interpolationtype = "odd";
|
||||
|
||||
ret.append( "SELECT tiger_line_import(ST_GeomFromText('LINESTRING(%s)',4326), %s, %s, %s, %s, %s, %s);" %
|
||||
( ",".join(rlinestring), sql_quote(rfromadd), sql_quote(rtoadd), sql_quote(interpolationtype), sql_quote(name), sql_quote(county), sql_quote(zipr) ) )
|
||||
|
||||
if left:
|
||||
id += 1
|
||||
|
||||
interpolationtype = "all";
|
||||
if ltofromint:
|
||||
if (lfromint % 2) == 0 and (ltoint % 2) == 0:
|
||||
if separated == "Y":
|
||||
interpolationtype = "even";
|
||||
elif rtofromint and (rfromint % 2) == 1 and (rtoint % 2) == 1:
|
||||
interpolationtype = "even";
|
||||
elif (lfromint % 2) == 1 and (ltoint % 2) == 1:
|
||||
if separated == "Y":
|
||||
interpolationtype = "odd";
|
||||
elif rtofromint and (rfromint %2 ) == 0 and (rtoint % 2) == 0:
|
||||
interpolationtype = "odd";
|
||||
|
||||
ret.append( "SELECT tiger_line_import(ST_GeomFromText('LINESTRING(%s)',4326), %s, %s, %s, %s, %s, %s);" %
|
||||
( ",".join(llinestring), sql_quote(lfromadd), sql_quote(ltoadd), sql_quote(interpolationtype), sql_quote(name), sql_quote(county), sql_quote(zipl) ) )
|
||||
|
||||
return ret
|
||||
|
||||
def sql_quote( string ):
|
||||
return "'" + string.replace("'", "''") + "'"
|
||||
|
||||
def unproject( point ):
|
||||
pt = tr.TransformPoint( point[0], point[1] )
|
||||
return (pt[1], pt[0])
|
||||
|
||||
def round_point( point, accuracy=8 ):
|
||||
return tuple( [ round(x,accuracy) for x in point ] )
|
||||
|
||||
def compile_nodelist( parsed_gisdata, first_id=1 ):
|
||||
nodelist = {}
|
||||
|
||||
i = first_id
|
||||
for geom, tags in parsed_gisdata:
|
||||
if len( geom )==0:
|
||||
continue
|
||||
|
||||
for point in geom:
|
||||
r_point = round_point( point )
|
||||
if r_point not in nodelist:
|
||||
nodelist[ r_point ] = (i, unproject( point ))
|
||||
i += 1
|
||||
|
||||
return (i, nodelist)
|
||||
|
||||
def adjacent( left, right ):
|
||||
left_left = round_point(left[0])
|
||||
left_right = round_point(left[-1])
|
||||
right_left = round_point(right[0])
|
||||
right_right = round_point(right[-1])
|
||||
|
||||
return ( left_left == right_left or
|
||||
left_left == right_right or
|
||||
left_right == right_left or
|
||||
left_right == right_right )
|
||||
|
||||
def glom( left, right ):
|
||||
left = list( left )
|
||||
right = list( right )
|
||||
|
||||
left_left = round_point(left[0])
|
||||
left_right = round_point(left[-1])
|
||||
right_left = round_point(right[0])
|
||||
right_right = round_point(right[-1])
|
||||
|
||||
if left_left == right_left:
|
||||
left.reverse()
|
||||
return left[0:-1] + right
|
||||
|
||||
if left_left == right_right:
|
||||
return right[0:-1] + left
|
||||
|
||||
if left_right == right_left:
|
||||
return left[0:-1] + right
|
||||
|
||||
if left_right == right_right:
|
||||
right.reverse()
|
||||
return left[0:-1] + right
|
||||
|
||||
raise 'segments are not adjacent'
|
||||
|
||||
def glom_once( segments ):
|
||||
if len(segments)==0:
|
||||
return segments
|
||||
|
||||
unsorted = list( segments )
|
||||
x = unsorted.pop(0)
|
||||
|
||||
while len( unsorted ) > 0:
|
||||
n = len( unsorted )
|
||||
|
||||
for i in range(0, n):
|
||||
y = unsorted[i]
|
||||
if adjacent( x, y ):
|
||||
y = unsorted.pop(i)
|
||||
x = glom( x, y )
|
||||
break
|
||||
|
||||
# Sorted and unsorted lists have no adjacent segments
|
||||
if len( unsorted ) == n:
|
||||
break
|
||||
|
||||
return x, unsorted
|
||||
|
||||
def glom_all( segments ):
|
||||
unsorted = segments
|
||||
chunks = []
|
||||
|
||||
while unsorted != []:
|
||||
chunk, unsorted = glom_once( unsorted )
|
||||
chunks.append( chunk )
|
||||
|
||||
return chunks
|
||||
|
||||
|
||||
|
||||
def compile_waylist( parsed_gisdata ):
|
||||
waylist = {}
|
||||
|
||||
#Group by tiger:way_id
|
||||
for geom, tags in parsed_gisdata:
|
||||
way_key = tags.copy()
|
||||
way_key = ( way_key['tiger:way_id'], tuple( [(k,v) for k,v in way_key.items()] ) )
|
||||
|
||||
if way_key not in waylist:
|
||||
waylist[way_key] = []
|
||||
|
||||
waylist[way_key].append( geom )
|
||||
|
||||
ret = {}
|
||||
for (way_id, way_key), segments in waylist.items():
|
||||
ret[way_key] = glom_all( segments )
|
||||
return ret
|
||||
|
||||
|
||||
def shape_to_sql( shp_filename, sql_filename ):
|
||||
|
||||
print("parsing shpfile %s" % shp_filename)
|
||||
parsed_features = parse_shp_for_geom_and_tags( shp_filename )
|
||||
|
||||
print("compiling nodelist")
|
||||
i, nodelist = compile_nodelist( parsed_features )
|
||||
|
||||
print("compiling waylist")
|
||||
waylist = compile_waylist( parsed_features )
|
||||
|
||||
print("preparing address ways")
|
||||
sql_lines = addressways(waylist, nodelist, i)
|
||||
|
||||
print("writing %s" % sql_filename)
|
||||
fp = open( sql_filename, "w" )
|
||||
fp.write( "\n".join( sql_lines ) )
|
||||
fp.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys, os.path
|
||||
if len(sys.argv) < 3:
|
||||
print("%s input.shp output.sql" % sys.argv[0])
|
||||
sys.exit()
|
||||
shp_filename = sys.argv[1]
|
||||
sql_filename = sys.argv[2]
|
||||
shape_to_sql(shp_filename, sql_filename)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,58 +0,0 @@
|
||||
## Add Wikipedia and Wikidata to Nominatim
|
||||
|
||||
OSM contributors frequently tag items with links to Wikipedia and Wikidata. Nominatim can use the page ranking of Wikipedia pages to help indicate the relative importance of osm features. This is done by calculating an importance score between 0 and 1 based on the number of inlinks to an article for a location. If two places have the same name and one is more important than the other, the wikipedia score often points to the correct place.
|
||||
|
||||
These scripts extract and prepare both Wikipedia page rank and Wikidata links for use in Nominatim.
|
||||
|
||||
#### Create a new postgres DB for Processing
|
||||
|
||||
Due to the size of initial and intermediate tables, processing can be done in an external database:
|
||||
```
|
||||
CREATE DATABASE wikiprocessingdb;
|
||||
```
|
||||
---
|
||||
Wikipedia
|
||||
---
|
||||
|
||||
Processing these data requires a large amount of disk space (~1TB) and considerable time (>24 hours).
|
||||
|
||||
#### Import & Process Wikipedia tables
|
||||
|
||||
This step downloads and converts [Wikipedia](https://dumps.wikimedia.org/) page data SQL dumps to postgreSQL files which can be imported and processed with pagelink information from Wikipedia language sites to calculate importance scores.
|
||||
|
||||
- The script will processes data from whatever set of Wikipedia languages are specified in the initial languages array
|
||||
|
||||
- Note that processing the top 40 Wikipedia languages can take over a day, and will add nearly 1TB to the processing database. The final output tables will be approximately 11GB and 2GB in size
|
||||
|
||||
To download, convert, and import the data, then process summary statistics and compute importance scores, run:
|
||||
```
|
||||
./import_wikipedia.sh
|
||||
```
|
||||
---
|
||||
Wikidata
|
||||
---
|
||||
|
||||
This script downloads and processes Wikidata to enrich the previously created Wikipedia tables for use in Nominatim.
|
||||
|
||||
#### Import & Process Wikidata
|
||||
|
||||
This step downloads and converts [Wikidata](https://dumps.wikimedia.org/wikidatawiki/) page data SQL dumps to postgreSQL files which can be processed and imported into Nominatim database. Also utilizes Wikidata Query Service API to discover and include place types.
|
||||
|
||||
- Script presumes that the user has already processed Wikipedia tables as specified above
|
||||
|
||||
- Script requires wikidata_place_types.txt and wikidata_place_type_levles.csv
|
||||
|
||||
- script requires the [jq json parser](https://stedolan.github.io/jq/)
|
||||
|
||||
- Script processes data from whatever set of Wikipedia languages are specified in the initial languages array
|
||||
|
||||
- Script queries Wikidata Query Service API and imports all instances of place types listed in wikidata_place_types.txt
|
||||
|
||||
- Script updates wikipedia_articles table with extracted wikidata
|
||||
|
||||
By including Wikidata in the wikipedia_articles table, new connections can be made on the fly from the Nominatim placex table to wikipedia_article importance scores.
|
||||
|
||||
To download, convert, and import the data, then process required items, run:
|
||||
```
|
||||
./import_wikidata.sh
|
||||
```
|
||||
@@ -1,274 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
psqlcmd() {
|
||||
psql --quiet wikiprocessingdb
|
||||
}
|
||||
|
||||
mysql2pgsqlcmd() {
|
||||
./mysql2pgsql.perl /dev/stdin /dev/stdout
|
||||
}
|
||||
|
||||
download() {
|
||||
echo "Downloading $1"
|
||||
wget --quiet --no-clobber --tries 3 "$1"
|
||||
}
|
||||
|
||||
# languages to process (refer to List of Wikipedias here: https://en.wikipedia.org/wiki/List_of_Wikipedias)
|
||||
# requires Bash 4.0
|
||||
readarray -t LANGUAGES < languages.txt
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Download wikidata dump tables"
|
||||
echo "====================================================================="
|
||||
|
||||
# 114M wikidatawiki-latest-geo_tags.sql.gz
|
||||
# 1.7G wikidatawiki-latest-page.sql.gz
|
||||
# 1.2G wikidatawiki-latest-wb_items_per_site.sql.gz
|
||||
download https://dumps.wikimedia.org/wikidatawiki/latest/wikidatawiki-latest-geo_tags.sql.gz
|
||||
download https://dumps.wikimedia.org/wikidatawiki/latest/wikidatawiki-latest-page.sql.gz
|
||||
download https://dumps.wikimedia.org/wikidatawiki/latest/wikidatawiki-latest-wb_items_per_site.sql.gz
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Import wikidata dump tables"
|
||||
echo "====================================================================="
|
||||
|
||||
echo "Importing wikidatawiki-latest-geo_tags"
|
||||
gzip -dc wikidatawiki-latest-geo_tags.sql.gz | mysql2pgsqlcmd | psqlcmd
|
||||
|
||||
echo "Importing wikidatawiki-latest-page"
|
||||
gzip -dc wikidatawiki-latest-page.sql.gz | mysql2pgsqlcmd | psqlcmd
|
||||
|
||||
echo "Importing wikidatawiki-latest-wb_items_per_site"
|
||||
gzip -dc wikidatawiki-latest-wb_items_per_site.sql.gz | mysql2pgsqlcmd | psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Get wikidata places from wikidata query API"
|
||||
echo "====================================================================="
|
||||
|
||||
echo "Number of place types:"
|
||||
wc -l wikidata_place_types.txt
|
||||
|
||||
while read F ; do
|
||||
echo "Querying for place type $F..."
|
||||
wget --quiet "https://query.wikidata.org/bigdata/namespace/wdq/sparql?format=json&query=SELECT ?item WHERE{?item wdt:P31*/wdt:P279*wd:$F;}" -O $F.json
|
||||
jq -r '.results | .[] | .[] | [.item.value] | @csv' $F.json >> $F.txt
|
||||
awk -v qid=$F '{print $0 ","qid}' $F.txt | sed -e 's!"http://www.wikidata.org/entity/!!' | sed 's/"//g' >> $F.csv
|
||||
cat $F.csv >> wikidata_place_dump.csv
|
||||
rm $F.json $F.txt $F.csv
|
||||
done < wikidata_place_types.txt
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Import wikidata places"
|
||||
echo "====================================================================="
|
||||
|
||||
echo "CREATE TABLE wikidata_place_dump (
|
||||
item text,
|
||||
instance_of text
|
||||
);" | psqlcmd
|
||||
|
||||
echo "COPY wikidata_place_dump (item, instance_of)
|
||||
FROM '/srv/nominatim/Nominatim/data-sources/wikipedia-wikidata/wikidata_place_dump.csv'
|
||||
DELIMITER ','
|
||||
CSV
|
||||
;" | psqlcmd
|
||||
|
||||
echo "CREATE TABLE wikidata_place_type_levels (
|
||||
place_type text,
|
||||
level integer
|
||||
);" | psqlcmd
|
||||
|
||||
echo "COPY wikidata_place_type_levels (place_type, level)
|
||||
FROM '/srv/nominatim/Nominatim/data-sources/wikipedia-wikidata/wikidata_place_type_levels.csv'
|
||||
DELIMITER ','
|
||||
CSV
|
||||
HEADER
|
||||
;" | psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Create derived tables"
|
||||
echo "====================================================================="
|
||||
|
||||
echo "CREATE TABLE geo_earth_primary AS
|
||||
SELECT gt_page_id,
|
||||
gt_lat,
|
||||
gt_lon
|
||||
FROM geo_tags
|
||||
WHERE gt_globe = 'earth'
|
||||
AND gt_primary = 1
|
||||
AND NOT( gt_lat < -90
|
||||
OR gt_lat > 90
|
||||
OR gt_lon < -180
|
||||
OR gt_lon > 180
|
||||
OR gt_lat=0
|
||||
OR gt_lon=0)
|
||||
;" | psqlcmd
|
||||
|
||||
echo "CREATE TABLE geo_earth_wikidata AS
|
||||
SELECT DISTINCT geo_earth_primary.gt_page_id,
|
||||
geo_earth_primary.gt_lat,
|
||||
geo_earth_primary.gt_lon,
|
||||
page.page_title,
|
||||
page.page_namespace
|
||||
FROM geo_earth_primary
|
||||
LEFT OUTER JOIN page
|
||||
ON (geo_earth_primary.gt_page_id = page.page_id)
|
||||
ORDER BY geo_earth_primary.gt_page_id
|
||||
;" | psqlcmd
|
||||
|
||||
echo "ALTER TABLE wikidata_place_dump
|
||||
ADD COLUMN ont_level integer,
|
||||
ADD COLUMN lat numeric(11,8),
|
||||
ADD COLUMN lon numeric(11,8)
|
||||
;" | psqlcmd
|
||||
|
||||
echo "UPDATE wikidata_place_dump
|
||||
SET ont_level = wikidata_place_type_levels.level
|
||||
FROM wikidata_place_type_levels
|
||||
WHERE wikidata_place_dump.instance_of = wikidata_place_type_levels.place_type
|
||||
;" | psqlcmd
|
||||
|
||||
echo "CREATE TABLE wikidata_places
|
||||
AS
|
||||
SELECT DISTINCT ON (item) item,
|
||||
instance_of,
|
||||
MAX(ont_level) AS ont_level,
|
||||
lat,
|
||||
lon
|
||||
FROM wikidata_place_dump
|
||||
GROUP BY item,
|
||||
instance_of,
|
||||
ont_level,
|
||||
lat,
|
||||
lon
|
||||
ORDER BY item
|
||||
;" | psqlcmd
|
||||
|
||||
echo "UPDATE wikidata_places
|
||||
SET lat = geo_earth_wikidata.gt_lat,
|
||||
lon = geo_earth_wikidata.gt_lon
|
||||
FROM geo_earth_wikidata
|
||||
WHERE wikidata_places.item = geo_earth_wikidata.page_title
|
||||
;" | psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Process language pages"
|
||||
echo "====================================================================="
|
||||
|
||||
|
||||
echo "CREATE TABLE wikidata_pages (
|
||||
item text,
|
||||
instance_of text,
|
||||
lat numeric(11,8),
|
||||
lon numeric(11,8),
|
||||
ips_site_page text,
|
||||
language text
|
||||
);" | psqlcmd
|
||||
|
||||
for i in "${LANGUAGES[@]}"
|
||||
do
|
||||
echo "CREATE TABLE wikidata_${i}_pages AS
|
||||
SELECT wikidata_places.item,
|
||||
wikidata_places.instance_of,
|
||||
wikidata_places.lat,
|
||||
wikidata_places.lon,
|
||||
wb_items_per_site.ips_site_page
|
||||
FROM wikidata_places
|
||||
LEFT JOIN wb_items_per_site
|
||||
ON (CAST (( LTRIM(wikidata_places.item, 'Q')) AS INTEGER) = wb_items_per_site.ips_item_id)
|
||||
WHERE ips_site_id = '${i}wiki'
|
||||
AND LEFT(wikidata_places.item,1) = 'Q'
|
||||
ORDER BY wikidata_places.item
|
||||
;" | psqlcmd
|
||||
|
||||
echo "ALTER TABLE wikidata_${i}_pages
|
||||
ADD COLUMN language text
|
||||
;" | psqlcmd
|
||||
|
||||
echo "UPDATE wikidata_${i}_pages
|
||||
SET language = '${i}'
|
||||
;" | psqlcmd
|
||||
|
||||
echo "INSERT INTO wikidata_pages
|
||||
SELECT item,
|
||||
instance_of,
|
||||
lat,
|
||||
lon,
|
||||
ips_site_page,
|
||||
language
|
||||
FROM wikidata_${i}_pages
|
||||
;" | psqlcmd
|
||||
done
|
||||
|
||||
echo "ALTER TABLE wikidata_pages
|
||||
ADD COLUMN wp_page_title text
|
||||
;" | psqlcmd
|
||||
echo "UPDATE wikidata_pages
|
||||
SET wp_page_title = REPLACE(ips_site_page, ' ', '_')
|
||||
;" | psqlcmd
|
||||
echo "ALTER TABLE wikidata_pages
|
||||
DROP COLUMN ips_site_page
|
||||
;" | psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Add wikidata to wikipedia_article table"
|
||||
echo "====================================================================="
|
||||
|
||||
echo "UPDATE wikipedia_article
|
||||
SET lat = wikidata_pages.lat,
|
||||
lon = wikidata_pages.lon,
|
||||
wd_page_title = wikidata_pages.item,
|
||||
instance_of = wikidata_pages.instance_of
|
||||
FROM wikidata_pages
|
||||
WHERE wikipedia_article.language = wikidata_pages.language
|
||||
AND wikipedia_article.title = wikidata_pages.wp_page_title
|
||||
;" | psqlcmd
|
||||
|
||||
echo "CREATE TABLE wikipedia_article_slim
|
||||
AS
|
||||
SELECT * FROM wikipedia_article
|
||||
WHERE wikidata_id IS NOT NULL
|
||||
;" | psqlcmd
|
||||
|
||||
echo "ALTER TABLE wikipedia_article
|
||||
RENAME TO wikipedia_article_full
|
||||
;" | psqlcmd
|
||||
|
||||
echo "ALTER TABLE wikipedia_article_slim
|
||||
RENAME TO wikipedia_article
|
||||
;" | psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Dropping intermediate tables"
|
||||
echo "====================================================================="
|
||||
|
||||
echo "DROP TABLE wikidata_place_dump;" | psqlcmd
|
||||
echo "DROP TABLE geo_earth_primary;" | psqlcmd
|
||||
for i in "${LANGUAGES[@]}"
|
||||
do
|
||||
echo "DROP TABLE wikidata_${i}_pages;" | psqlcmd
|
||||
done
|
||||
@@ -1,297 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
psqlcmd() {
|
||||
psql --quiet wikiprocessingdb |& \
|
||||
grep -v 'does not exist, skipping' |& \
|
||||
grep -v 'violates check constraint' |& \
|
||||
grep -vi 'Failing row contains'
|
||||
}
|
||||
|
||||
mysql2pgsqlcmd() {
|
||||
./mysql2pgsql.perl --nodrop /dev/stdin /dev/stdout
|
||||
}
|
||||
|
||||
download() {
|
||||
echo "Downloading $1"
|
||||
wget --quiet --no-clobber --tries=3 "$1"
|
||||
}
|
||||
|
||||
|
||||
# languages to process (refer to List of Wikipedias here: https://en.wikipedia.org/wiki/List_of_Wikipedias)
|
||||
# requires Bash 4.0
|
||||
readarray -t LANGUAGES < languages.txt
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Create wikipedia calculation tables"
|
||||
echo "====================================================================="
|
||||
|
||||
echo "CREATE TABLE linkcounts (
|
||||
language text,
|
||||
title text,
|
||||
count integer,
|
||||
sumcount integer,
|
||||
lat double precision,
|
||||
lon double precision
|
||||
);" | psqlcmd
|
||||
|
||||
echo "CREATE TABLE wikipedia_article (
|
||||
language text NOT NULL,
|
||||
title text NOT NULL,
|
||||
langcount integer,
|
||||
othercount integer,
|
||||
totalcount integer,
|
||||
lat double precision,
|
||||
lon double precision,
|
||||
importance double precision,
|
||||
title_en text,
|
||||
osm_type character(1),
|
||||
osm_id bigint
|
||||
);" | psqlcmd
|
||||
|
||||
echo "CREATE TABLE wikipedia_redirect (
|
||||
language text,
|
||||
from_title text,
|
||||
to_title text
|
||||
);" | psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Download individual wikipedia language tables"
|
||||
echo "====================================================================="
|
||||
|
||||
|
||||
for i in "${LANGUAGES[@]}"
|
||||
do
|
||||
echo "Language: $i"
|
||||
|
||||
# english is the largest
|
||||
# 1.7G enwiki-latest-page.sql.gz
|
||||
# 6.2G enwiki-latest-pagelinks.sql.gz
|
||||
# 355M enwiki-latest-langlinks.sql.gz
|
||||
# 128M enwiki-latest-redirect.sql.gz
|
||||
|
||||
# example of smaller languge turkish
|
||||
# 53M trwiki-latest-page.sql.gz
|
||||
# 176M trwiki-latest-pagelinks.sql.gz
|
||||
# 106M trwiki-latest-langlinks.sql.gz
|
||||
# 3.2M trwiki-latest-redirect.sql.gz
|
||||
|
||||
download https://dumps.wikimedia.org/${i}wiki/latest/${i}wiki-latest-page.sql.gz
|
||||
download https://dumps.wikimedia.org/${i}wiki/latest/${i}wiki-latest-pagelinks.sql.gz
|
||||
download https://dumps.wikimedia.org/${i}wiki/latest/${i}wiki-latest-langlinks.sql.gz
|
||||
download https://dumps.wikimedia.org/${i}wiki/latest/${i}wiki-latest-redirect.sql.gz
|
||||
done
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Import individual wikipedia language tables"
|
||||
echo "====================================================================="
|
||||
|
||||
for i in "${LANGUAGES[@]}"
|
||||
do
|
||||
echo "Language: $i"
|
||||
|
||||
# We pre-create the table schema. This allows us to
|
||||
# 1. Skip index creation. Most queries we do are full table scans
|
||||
# 2. Add constrain to only import namespace=0 (wikipedia articles)
|
||||
# Both cuts down data size considerably (50%+)
|
||||
|
||||
echo "Importing ${i}wiki-latest-pagelinks"
|
||||
|
||||
echo "DROP TABLE IF EXISTS ${i}pagelinks;" | psqlcmd
|
||||
echo "CREATE TABLE ${i}pagelinks (
|
||||
pl_from int NOT NULL DEFAULT '0',
|
||||
pl_namespace int NOT NULL DEFAULT '0',
|
||||
pl_title text NOT NULL DEFAULT '',
|
||||
pl_from_namespace int NOT NULL DEFAULT '0'
|
||||
);" | psqlcmd
|
||||
|
||||
time \
|
||||
gzip -dc ${i}wiki-latest-pagelinks.sql.gz | \
|
||||
sed "s/\`pagelinks\`/\`${i}pagelinks\`/g" | \
|
||||
mysql2pgsqlcmd | \
|
||||
grep -v '^CREATE INDEX ' | \
|
||||
psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
echo "Importing ${i}wiki-latest-page"
|
||||
|
||||
# autoincrement serial8 4byte
|
||||
echo "DROP TABLE IF EXISTS ${i}page;" | psqlcmd
|
||||
echo "CREATE TABLE ${i}page (
|
||||
page_id int NOT NULL,
|
||||
page_namespace int NOT NULL DEFAULT '0',
|
||||
page_title text NOT NULL DEFAULT '',
|
||||
page_restrictions text NOT NULL,
|
||||
page_is_redirect smallint NOT NULL DEFAULT '0',
|
||||
page_is_new smallint NOT NULL DEFAULT '0',
|
||||
page_random double precision NOT NULL DEFAULT '0',
|
||||
page_touched text NOT NULL DEFAULT '',
|
||||
page_links_updated text DEFAULT NULL,
|
||||
page_latest int NOT NULL DEFAULT '0',
|
||||
page_len int NOT NULL DEFAULT '0',
|
||||
page_content_model text DEFAULT NULL,
|
||||
page_lang text DEFAULT NULL
|
||||
);" | psqlcmd
|
||||
|
||||
time \
|
||||
gzip -dc ${i}wiki-latest-page.sql.gz | \
|
||||
sed "s/\`page\`/\`${i}page\`/g" | \
|
||||
mysql2pgsqlcmd | \
|
||||
grep -v '^CREATE INDEX ' | \
|
||||
psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
echo "Importing ${i}wiki-latest-langlinks"
|
||||
|
||||
echo "DROP TABLE IF EXISTS ${i}langlinks;" | psqlcmd
|
||||
echo "CREATE TABLE ${i}langlinks (
|
||||
ll_from int NOT NULL DEFAULT '0',
|
||||
ll_lang text NOT NULL DEFAULT '',
|
||||
ll_title text NOT NULL DEFAULT ''
|
||||
);" | psqlcmd
|
||||
|
||||
time \
|
||||
gzip -dc ${i}wiki-latest-langlinks.sql.gz | \
|
||||
sed "s/\`langlinks\`/\`${i}langlinks\`/g" | \
|
||||
mysql2pgsqlcmd | \
|
||||
grep -v '^CREATE INDEX ' | \
|
||||
psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "Importing ${i}wiki-latest-redirect"
|
||||
|
||||
echo "DROP TABLE IF EXISTS ${i}redirect;" | psqlcmd
|
||||
echo "CREATE TABLE ${i}redirect (
|
||||
rd_from int NOT NULL DEFAULT '0',
|
||||
rd_namespace int NOT NULL DEFAULT '0',
|
||||
rd_title text NOT NULL DEFAULT '',
|
||||
rd_interwiki text DEFAULT NULL,
|
||||
rd_fragment text DEFAULT NULL
|
||||
);" | psqlcmd
|
||||
|
||||
time \
|
||||
gzip -dc ${i}wiki-latest-redirect.sql.gz | \
|
||||
sed "s/\`redirect\`/\`${i}redirect\`/g" | \
|
||||
mysql2pgsqlcmd | \
|
||||
grep -v '^CREATE INDEX ' | \
|
||||
psqlcmd
|
||||
done
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Process language tables and associated pagelink counts"
|
||||
echo "====================================================================="
|
||||
|
||||
|
||||
for i in "${LANGUAGES[@]}"
|
||||
do
|
||||
echo "Language: $i"
|
||||
|
||||
echo "CREATE TABLE ${i}pagelinkcount
|
||||
AS
|
||||
SELECT pl_title AS title,
|
||||
COUNT(*) AS count,
|
||||
0::bigint as othercount
|
||||
FROM ${i}pagelinks
|
||||
WHERE pl_namespace = 0
|
||||
GROUP BY pl_title
|
||||
;" | psqlcmd
|
||||
|
||||
echo "INSERT INTO linkcounts
|
||||
SELECT '${i}',
|
||||
pl_title,
|
||||
COUNT(*)
|
||||
FROM ${i}pagelinks
|
||||
WHERE pl_namespace = 0
|
||||
GROUP BY pl_title
|
||||
;" | psqlcmd
|
||||
|
||||
echo "INSERT INTO wikipedia_redirect
|
||||
SELECT '${i}',
|
||||
page_title,
|
||||
rd_title
|
||||
FROM ${i}redirect
|
||||
JOIN ${i}page ON (rd_from = page_id)
|
||||
WHERE page_namespace = 0
|
||||
AND rd_namespace = 0
|
||||
;" | psqlcmd
|
||||
|
||||
done
|
||||
|
||||
|
||||
for i in "${LANGUAGES[@]}"
|
||||
do
|
||||
for j in "${LANGUAGES[@]}"
|
||||
do
|
||||
echo "UPDATE ${i}pagelinkcount
|
||||
SET othercount = ${i}pagelinkcount.othercount + x.count
|
||||
FROM (
|
||||
SELECT page_title AS title,
|
||||
count
|
||||
FROM ${i}langlinks
|
||||
JOIN ${i}page ON (ll_from = page_id)
|
||||
JOIN ${j}pagelinkcount ON (ll_lang = '${j}' AND ll_title = title)
|
||||
) AS x
|
||||
WHERE x.title = ${i}pagelinkcount.title
|
||||
;" | psqlcmd
|
||||
done
|
||||
|
||||
echo "INSERT INTO wikipedia_article
|
||||
SELECT '${i}',
|
||||
title,
|
||||
count,
|
||||
othercount,
|
||||
count + othercount
|
||||
FROM ${i}pagelinkcount
|
||||
;" | psqlcmd
|
||||
done
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Calculate importance score for each wikipedia page"
|
||||
echo "====================================================================="
|
||||
|
||||
echo "UPDATE wikipedia_article
|
||||
SET importance = LOG(totalcount)/LOG((SELECT MAX(totalcount) FROM wikipedia_article))
|
||||
;" | psqlcmd
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
echo "====================================================================="
|
||||
echo "Clean up intermediate tables to conserve space"
|
||||
echo "====================================================================="
|
||||
|
||||
for i in "${LANGUAGES[@]}"
|
||||
do
|
||||
echo "DROP TABLE ${i}pagelinks;" | psqlcmd
|
||||
echo "DROP TABLE ${i}page;" | psqlcmd
|
||||
echo "DROP TABLE ${i}langlinks;" | psqlcmd
|
||||
echo "DROP TABLE ${i}redirect;" | psqlcmd
|
||||
echo "DROP TABLE ${i}pagelinkcount;" | psqlcmd
|
||||
done
|
||||
|
||||
echo "all done."
|
||||
@@ -1,39 +0,0 @@
|
||||
ar
|
||||
bg
|
||||
ca
|
||||
cs
|
||||
da
|
||||
de
|
||||
en
|
||||
es
|
||||
eo
|
||||
eu
|
||||
fa
|
||||
fr
|
||||
ko
|
||||
hi
|
||||
hr
|
||||
id
|
||||
it
|
||||
he
|
||||
lt
|
||||
hu
|
||||
ms
|
||||
nl
|
||||
ja
|
||||
no
|
||||
pl
|
||||
pt
|
||||
kk
|
||||
ro
|
||||
ru
|
||||
sk
|
||||
sl
|
||||
sr
|
||||
fi
|
||||
sv
|
||||
tr
|
||||
uk
|
||||
vi
|
||||
war
|
||||
zh
|
||||
@@ -1,951 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
# mysql2pgsql
|
||||
# MySQL to PostgreSQL dump file converter
|
||||
#
|
||||
# For usage: perl mysql2pgsql.perl --help
|
||||
#
|
||||
# ddl statments are changed but none or only minimal real data
|
||||
# formatting are done.
|
||||
# data consistency is up to the DBA.
|
||||
#
|
||||
# (c) 2004-2007 Jose M Duarte and Joseph Speigle ... gborg
|
||||
#
|
||||
# (c) 2000-2004 Maxim Rudensky <fonin@omnistaronline.com>
|
||||
# (c) 2000 Valentine Danilchuk <valdan@ziet.zhitomir.ua>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the Max Rudensky
|
||||
# and its contributors.
|
||||
# 4. Neither the name of the author nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
use POSIX;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
# main sections
|
||||
# -------------
|
||||
# 1 variable declarations
|
||||
# 2 subroutines
|
||||
# 3 get commandline options and specify help statement
|
||||
# 4 loop through file and process
|
||||
# 5. print_plpgsql function prototype
|
||||
|
||||
#################################################################
|
||||
# 1. variable declarations
|
||||
#################################################################
|
||||
# command line options
|
||||
my( $ENC_IN, $ENC_OUT, $PRESERVE_CASE, $HELP, $DEBUG, $SCHEMA, $LOWERCASE, $CHAR2VARCHAR, $NODROP, $SEP_FILE, $opt_debug, $opt_help, $opt_schema, $opt_preserve_case, $opt_char2varchar, $opt_nodrop, $opt_sepfile, $opt_enc_in, $opt_enc_out );
|
||||
# variables for constructing pre-create-table entities
|
||||
my $pre_create_sql=''; # comments, 'enum' constraints preceding create table statement
|
||||
my $auto_increment_seq= ''; # so we can easily substitute it if we need a default value
|
||||
my $create_sql=''; # all the datatypes in the create table section
|
||||
my $post_create_sql=''; # create indexes, foreign keys, table comments
|
||||
my $function_create_sql = ''; # for the set (function,trigger) and CURRENT_TIMESTAMP ( function,trigger )
|
||||
# constraints
|
||||
my ($type, $column_valuesStr, @column_values, $value );
|
||||
my %constraints=(); # holds values constraints used to emulate mysql datatypes (e.g. year, set)
|
||||
# datatype conversion variables
|
||||
my ( $index,$seq);
|
||||
my ( $column_name, $col, $quoted_column);
|
||||
my ( @year_holder, $year, $constraint_table_name);
|
||||
my $table=""; # table_name for create sql statements
|
||||
my $table_no_quotes=""; # table_name for create sql statements
|
||||
my $sl = '^\s+\w+\s+'; # matches the column name
|
||||
my $tables_first_timestamp_column= 1; # decision to print warnings about default_timestamp not being in postgres
|
||||
my $mysql_numeric_datatypes = "TINYINT|SMALLINT|MEDIUMINT|INT|INTEGER|BIGINT|REAL|DOUBLE|FLOAT|DECIMAL|NUMERIC";
|
||||
my $mysql_datetime_datatypes = "|DATE|TIME|TIMESTAMP|DATETIME|YEAR";
|
||||
my $mysql_text_datatypes = "CHAR|VARCHAR|BINARY|VARBINARY|TINYBLOB|BLOB|MEDIUMBLOB|LONGBLOB|TINYTEXT|TEXT|MEDIUMTEXT|LONGTEXT|ENUM|SET";
|
||||
my $mysql_datatypesStr = $mysql_numeric_datatypes . "|". $mysql_datetime_datatypes . "|". $mysql_text_datatypes ;
|
||||
# handling INSERT INTO statements
|
||||
my $rowRe = qr{
|
||||
\( # opening parens
|
||||
( # (start capture)
|
||||
(?: # (start group)
|
||||
' # string start
|
||||
[^'\\]* # up to string-end or backslash (escape)
|
||||
(?: # (start group)
|
||||
\\. # gobble escaped character
|
||||
[^'\\]* # up to string-end of backslash
|
||||
)* # (end group, repeat zero or more)
|
||||
' # string end
|
||||
| # (OR)
|
||||
.*? # everything else (not strings)
|
||||
)* # (end group, repeat zero or more)
|
||||
) # (end capture)
|
||||
\) # closing parent
|
||||
}x;
|
||||
|
||||
my ($insert_table, $valueString);
|
||||
#
|
||||
########################################################
|
||||
# 2. subroutines
|
||||
#
|
||||
# get_identifier
|
||||
# print_post_create_sql()
|
||||
# quote_and_lc()
|
||||
# make_plpgsql($table,$column_name) -- at end of file
|
||||
########################################################
|
||||
|
||||
# returns an identifier with the given suffix doing controlled
|
||||
# truncation if necessary
|
||||
sub get_identifier($$$) {
|
||||
my ($table, $col, $suffix) = @_;
|
||||
my $name = '';
|
||||
$table=~s/\"//g; # make sure that $table doesn't have quotes so we don't end up with redundant quoting
|
||||
# in the case of multiple columns
|
||||
my @cols = split(/,/,$col);
|
||||
$col =~ s/,//g;
|
||||
# in case all columns together too long we have to truncate them
|
||||
if (length($col) > 55) {
|
||||
my $totaltocut = length($col)-55;
|
||||
my $tocut = ceil($totaltocut / @cols);
|
||||
@cols = map {substr($_,0,abs(length($_)-$tocut))} @cols;
|
||||
$col="";
|
||||
foreach (@cols){
|
||||
$col.=$_;
|
||||
}
|
||||
}
|
||||
|
||||
my $max_table_length = 63 - length("_${col}_$suffix");
|
||||
|
||||
if (length($table) > $max_table_length) {
|
||||
$table = substr($table, length($table) - $max_table_length, $max_table_length);
|
||||
}
|
||||
return quote_and_lc("${table}_${col}_${suffix}");
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
# called when we encounter next CREATE TABLE statement
|
||||
# also called at EOF to print out for last table
|
||||
# prints comments, indexes, foreign key constraints (the latter 2 possibly to a separate file)
|
||||
sub print_post_create_sql() {
|
||||
my ( @create_idx_comments_constraints_commandsArr, $stmts, $table_field_combination);
|
||||
my %stmts;
|
||||
# loop to check for duplicates in $post_create_sql
|
||||
# Needed because of duplicate key declarations ( PRIMARY KEY and KEY), auto_increment columns
|
||||
|
||||
@create_idx_comments_constraints_commandsArr = split(';\n?', $post_create_sql);
|
||||
if ($SEP_FILE) {
|
||||
open(SEP_FILE, ">>:encoding($ENC_OUT)", $SEP_FILE) or die "Unable to open $SEP_FILE for output: $!\n";
|
||||
}
|
||||
|
||||
foreach (@create_idx_comments_constraints_commandsArr) {
|
||||
if (m/CREATE INDEX "*(\S+)"*\s/i) { # CREATE INDEX korean_english_wordsize_idx ON korean_english USING btree (wordsize);
|
||||
$table_field_combination = $1;
|
||||
# if this particular table_field_combination was already used do not print the statement:
|
||||
if ($SEP_FILE) {
|
||||
print SEP_FILE "$_;\n" if !defined($stmts{$table_field_combination});
|
||||
} else {
|
||||
print OUT "$_;\n" if !defined($stmts{$table_field_combination});
|
||||
}
|
||||
$stmts{$table_field_combination} = 1;
|
||||
}
|
||||
elsif (m/COMMENT/i) { # COMMENT ON object IS 'text'; but comment may be part of table name so use 'elsif'
|
||||
print OUT "$_;\n"
|
||||
} else { # foreign key constraint or comments (those preceded by -- )
|
||||
if ($SEP_FILE) {
|
||||
print SEP_FILE "$_;\n";
|
||||
} else {
|
||||
print OUT "$_;\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($SEP_FILE) {
|
||||
close SEP_FILE;
|
||||
}
|
||||
$post_create_sql='';
|
||||
# empty %constraints for next " create table" statement
|
||||
}
|
||||
|
||||
# quotes a string or a multicolumn string (comma separated)
|
||||
# and optionally lowercase (if LOWERCASE is set)
|
||||
# lowercase .... if user wants default postgres behavior
|
||||
# quotes .... to preserve keywords and to preserve case when case-sensitive tables are to be used
|
||||
sub quote_and_lc($)
|
||||
{
|
||||
my $col = shift;
|
||||
if ($LOWERCASE) {
|
||||
$col = lc($col);
|
||||
}
|
||||
if ($col =~ m/,/) {
|
||||
my @cols = split(/,\s?/, $col);
|
||||
@cols = map {"\"$_\""} @cols;
|
||||
return join(', ', @cols);
|
||||
} else {
|
||||
return "\"$col\"";
|
||||
}
|
||||
}
|
||||
|
||||
########################################################
|
||||
# 3. get commandline options and maybe print help
|
||||
########################################################
|
||||
|
||||
GetOptions("help", "debug"=> \$opt_debug, "schema=s" => \$SCHEMA, "preserve_case" => \$opt_preserve_case, "char2varchar" => \$opt_char2varchar, "nodrop" => \$opt_nodrop, "sepfile=s" => \$opt_sepfile, "enc_in=s" => \$opt_enc_in, "enc_out=s" => \$opt_enc_out );
|
||||
|
||||
$HELP = $opt_help || 0;
|
||||
$DEBUG = $opt_debug || 0;
|
||||
$PRESERVE_CASE = $opt_preserve_case || 0;
|
||||
if ($PRESERVE_CASE == 1) { $LOWERCASE = 0; }
|
||||
else { $LOWERCASE = 1; }
|
||||
$CHAR2VARCHAR = $opt_char2varchar || 0;
|
||||
$NODROP = $opt_nodrop || 0;
|
||||
$SEP_FILE = $opt_sepfile || 0;
|
||||
$ENC_IN = $opt_enc_in || 'utf8';
|
||||
$ENC_OUT = $opt_enc_out || 'utf8';
|
||||
|
||||
if (($HELP) || ! defined($ARGV[0]) || ! defined($ARGV[1])) {
|
||||
print "\n\nUsage: perl $0 {--help --debug --preserve_case --char2varchar --nodrop --schema --sepfile --enc_in --enc_out } mysql.sql pg.sql\n";
|
||||
print "\t* OPTIONS WITHOUT ARGS\n";
|
||||
print "\t--help: prints this message \n";
|
||||
print "\t--debug: output the commented-out mysql line above the postgres line in pg.sql \n";
|
||||
print "\t--preserve_case: prevents automatic case-lowering of column and table names\n";
|
||||
print "\t\tIf you want to preserve case, you must set this flag. For example,\n";
|
||||
print "\t\tIf your client application quotes table and column-names and they have cases in them, set this flag\n";
|
||||
print "\t--char2varchar: converts all char fields to varchar\n";
|
||||
print "\t--nodrop: strips out DROP TABLE statements\n";
|
||||
print "\t\totherise harmless warnings are printed by psql when the dropped table does not exist\n";
|
||||
print "\n\t* OPTIONS WITH ARGS\n";
|
||||
print "\t--schema: outputs a line into the postgres sql file setting search_path \n";
|
||||
print "\t--sepfile: output foreign key constraints and indexes to a separate file so that it can be\n";
|
||||
print "\t\timported after large data set is inserted from another dump file\n";
|
||||
print "\t--enc_in: encoding of mysql in file (default utf8) \n";
|
||||
print "\t--enc_out: encoding of postgres out file (default utf8) \n";
|
||||
print "\n\t* REQUIRED ARGUMENTS\n";
|
||||
if (defined ($ARGV[0])) {
|
||||
print "\tmysql.sql ($ARGV[0])\n";
|
||||
} else {
|
||||
print "\tmysql.sql (undefined)\n";
|
||||
}
|
||||
if (defined ($ARGV[1])) {
|
||||
print "\tpg.sql ($ARGV[1])\n";
|
||||
} else {
|
||||
print "\tpg.sql (undefined)\n";
|
||||
}
|
||||
print "\n";
|
||||
exit 1;
|
||||
}
|
||||
########################################################
|
||||
# 4. process through mysql_dump.sql file
|
||||
# in a big loop
|
||||
########################################################
|
||||
|
||||
# open in and out files
|
||||
open(IN,"<:encoding($ENC_IN)", $ARGV[0]) || die "can't open mysql dump file $ARGV[0]";
|
||||
open(OUT,">:encoding($ENC_OUT)", $ARGV[1]) || die "can't open pg dump file $ARGV[1]";
|
||||
|
||||
# output header
|
||||
print OUT "--\n";
|
||||
print OUT "-- Generated from mysql2pgsql.perl\n";
|
||||
print OUT "-- http://gborg.postgresql.org/project/mysql2psql/\n";
|
||||
print OUT "-- (c) 2001 - 2007 Jose M. Duarte, Joseph Speigle\n";
|
||||
print OUT "--\n";
|
||||
print OUT "\n";
|
||||
print OUT "-- warnings are printed for drop tables if they do not exist\n";
|
||||
print OUT "-- please see http://archives.postgresql.org/pgsql-novice/2004-10/msg00158.php\n\n";
|
||||
print OUT "-- ##############################################################\n";
|
||||
|
||||
if ($SCHEMA ) {
|
||||
print OUT "set search_path='" . $SCHEMA . "'\\g\n" ;
|
||||
}
|
||||
|
||||
# loop through mysql file on a per-line basis
|
||||
while(<IN>) {
|
||||
|
||||
############## flow #########################
|
||||
# (the lines are directed to different string variables at different times)
|
||||
#
|
||||
# handle drop table , unlock, connect statements
|
||||
# if ( start of create table) {
|
||||
# print out post_create table (indexes, foreign key constraints, comments from previous table)
|
||||
# add drop table statement if !$NODROP to pre_create_sql
|
||||
# next;
|
||||
# }
|
||||
# else if ( inside create table) {
|
||||
# add comments in this portion to create_sql
|
||||
# if ( end of create table) {
|
||||
# delete mysql-unique CREATE TABLE commands
|
||||
# print pre_create_sql
|
||||
# print the constraint tables for set and year datatypes
|
||||
# print create_sql
|
||||
# print function_create_sql (this is for the enum columns only)
|
||||
# next;
|
||||
# }
|
||||
# do substitutions
|
||||
# -- NUMERIC DATATYPES
|
||||
# -- CHARACTER DATATYPES
|
||||
# -- DATE AND TIME DATATYPES
|
||||
# -- KEY AND UNIQUE CREATIONS
|
||||
# and append them to create_sql
|
||||
# } else {
|
||||
# print inserts on-the-spot (this script only changes default timestamp of 0000-00-00)
|
||||
# }
|
||||
# LOOP until EOF
|
||||
#
|
||||
########################################################
|
||||
|
||||
|
||||
if (!/^\s*insert into/i) { # not inside create table so don't worry about data corruption
|
||||
s/`//g; # '`pgsql uses no backticks to denote table name (CREATE TABLE `sd`) or around field
|
||||
# and table names like mysql
|
||||
# doh! we hope all dashes and special chars are caught by the regular expressions :)
|
||||
}
|
||||
if (/^\s*USE\s*([^;]*);/) {
|
||||
print OUT "\\c ". $1;
|
||||
next;
|
||||
}
|
||||
if (/^(UN)?LOCK TABLES/i || /drop\s+table/i ) {
|
||||
|
||||
# skip
|
||||
# DROP TABLE is added when we see the CREATE TABLE
|
||||
next;
|
||||
}
|
||||
if (/(create\s+table\s+)([-_\w]+)\s/i) { # example: CREATE TABLE `english_english`
|
||||
print_post_create_sql(); # for last table
|
||||
$tables_first_timestamp_column= 1; # decision to print warnings about default_timestamp not being in postgres
|
||||
$create_sql = '';
|
||||
$table_no_quotes = $2 ;
|
||||
$table=quote_and_lc($2);
|
||||
if ( !$NODROP ) { # always print drop table if user doesn't explicitly say not to
|
||||
# to drop a table that is referenced by a view or a foreign-key constraint of another table,
|
||||
# CASCADE must be specified. (CASCADE will remove a dependent view entirely, but in the
|
||||
# in the foreign-key case it will only remove the foreign-key constraint, not the other table entirely.)
|
||||
# (source: 8.1.3 docs, section "drop table")
|
||||
warn "table $table will be dropped CASCADE\n";
|
||||
$pre_create_sql .= "DROP TABLE $table CASCADE;\n"; # custom dumps may be missing the 'dump' commands
|
||||
}
|
||||
|
||||
s/(create\s+table\s+)([-_\w]+)\s/$1 $table /i;
|
||||
if ($DEBUG) {
|
||||
$create_sql .= '-- ' . $_;
|
||||
}
|
||||
$create_sql .= $_;
|
||||
next;
|
||||
}
|
||||
if ($create_sql ne "") { # we are inside create table statement so lets process datatypes
|
||||
# print out comments or empty lines in context
|
||||
if ($DEBUG) {
|
||||
$create_sql .= '-- ' . $_;
|
||||
}
|
||||
if (/^#/ || /^$/ || /^\s*--/) {
|
||||
s/^#/--/; # Two hyphens (--) is the SQL-92 standard indicator for comments
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
}
|
||||
|
||||
if (/\).*;/i) { # end of create table squence
|
||||
|
||||
s/INSERT METHOD[=\s+][^;\s]+//i;
|
||||
s/PASSWORD=[^;\s]+//i;
|
||||
s/ROW_FORMAT=(?:DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT)+//i;
|
||||
s/KEY_BLOCK_SIZE=8//i;
|
||||
s/DELAY KEY WRITE=[^;\s]+//i;
|
||||
s/INDEX DIRECTORY[=\s+][^;\s]+//i;
|
||||
s/DATA DIRECTORY=[^;\s]+//i;
|
||||
s/CONNECTION=[^;\s]+//i;
|
||||
s/CHECKSUM=[^;\s]+//i;
|
||||
s/Type=[^;\s]+//i; # ISAM , # older versions
|
||||
s/COLLATE=[^;\s]+//i; # table's collate
|
||||
s/COLLATE\s+[^;\s]+//i; # table's collate
|
||||
# possible AUTO_INCREMENT starting index, it is used in mysql 5.0.26, not sure since which version
|
||||
if (/AUTO_INCREMENT=(\d+)/i) {
|
||||
# should take < ---- ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
|
||||
# and should ouput ---> CREATE SEQUENCE "rhm_host_info_id_seq" START WITH 16;
|
||||
my $start_value = $1;
|
||||
print $auto_increment_seq . "--\n";
|
||||
# print $pre_create_sql . "--\n";
|
||||
$pre_create_sql =~ s/(CREATE SEQUENCE $auto_increment_seq )/$1 START WITH $start_value /;
|
||||
}
|
||||
s/AUTO_INCREMENT=\d+//i;
|
||||
s/PACK_KEYS=\d//i; # mysql 5.0.22
|
||||
s/DEFAULT CHARSET=[^;\s]+//i; # my mysql version is 4.1.11
|
||||
s/ENGINE\s*=\s*[^;\s]+//i; # my mysql version is 4.1.11
|
||||
s/ROW_FORMAT=[^;\s]+//i; # my mysql version is 5.0.22
|
||||
s/KEY_BLOCK_SIZE=8//i;
|
||||
s/MIN_ROWS=[^;\s]+//i;
|
||||
s/MAX_ROWS=[^;\s]+//i;
|
||||
s/AVG_ROW_LENGTH=[^;\s]+//i;
|
||||
if (/COMMENT='([^']*)'/) { # ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='must be country zones';
|
||||
$post_create_sql.="COMMENT ON TABLE $table IS '$1'\;"; # COMMENT ON table_name IS 'text';
|
||||
s/COMMENT='[^']*'//i;
|
||||
}
|
||||
$create_sql =~ s/,$//g; # strip last , inside create table
|
||||
# make sure we end in a comma, as KEY statments are turned
|
||||
# into post_create_sql indices
|
||||
# they often are the last line so leaving a 'hanging comma'
|
||||
my @array = split("\n", $create_sql);
|
||||
for (my $a = $#array; $a >= 0; $a--) { #loop backwards
|
||||
if ($a == $#array && $array[$a] =~ m/,\s*$/) { # for last line
|
||||
$array[$a] =~ s/,\s*$//;
|
||||
next;
|
||||
}
|
||||
if ($array[$a] !~ m/create table/i) { # i.e. if there was more than one column in table
|
||||
if ($a != $#array && $array[$a] !~ m/,\s*$/ ) { # for second to last
|
||||
$array[$a] =~ s/$/,/;
|
||||
last;
|
||||
}
|
||||
elsif ($a != $#array && $array[$a] =~ m/,\s*$/ ) { # for second to last
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
$create_sql = join("\n", @array) . "\n";
|
||||
$create_sql .= $_;
|
||||
|
||||
# put comments out first
|
||||
print OUT $pre_create_sql;
|
||||
|
||||
# create separate table to reference and to hold mysql's possible set data-type
|
||||
# values. do that table's creation before create table
|
||||
# definition
|
||||
foreach $column_name (keys %constraints) {
|
||||
$type=$constraints{$column_name}{'type'};
|
||||
$column_valuesStr = $constraints{$column_name}{'values'};
|
||||
$constraint_table_name = get_identifier(${table},${column_name} ,"constraint_table");
|
||||
if ($type eq 'set') {
|
||||
print OUT qq~DROP TABLE $constraint_table_name CASCADE\\g\n~ ;
|
||||
print OUT qq~create table $constraint_table_name ( set_values varchar UNIQUE)\\g\n~ ;
|
||||
$function_create_sql .= make_plpgsql($table,$column_name);
|
||||
} elsif ($type eq 'year') {
|
||||
print OUT qq~DROP TABLE $constraint_table_name CASCADE\\g\n~ ;
|
||||
print OUT qq~create table $constraint_table_name ( year_values varchar UNIQUE)\\g\n~ ;
|
||||
}
|
||||
@column_values = split /,/, $column_valuesStr;
|
||||
foreach $value (@column_values) {
|
||||
print OUT qq~insert into $constraint_table_name values ( $value )\\g\n~; # ad ' for ints and varchars
|
||||
}
|
||||
}
|
||||
|
||||
$create_sql =~ s/double double/double precision/g;
|
||||
|
||||
# print create table and reset create table vars
|
||||
# when moving from each "create table" to "insert" part of dump
|
||||
print OUT $create_sql;
|
||||
print OUT $function_create_sql;
|
||||
$pre_create_sql="";
|
||||
$auto_increment_seq="";
|
||||
$create_sql="";
|
||||
$function_create_sql='';
|
||||
%constraints=();
|
||||
# the post_create_sql for this table is output at the beginning of the next table def
|
||||
# in case we want to make indexes after doing inserting
|
||||
next;
|
||||
}
|
||||
if (/^\s*(\w+)\s+.*COMMENT\s*'([^']*)'/) { #`zone_country_id` int(11) COMMENT 'column comment here',
|
||||
$quoted_column=quote_and_lc($1);
|
||||
$post_create_sql.="COMMENT ON COLUMN $table"."."." $quoted_column IS '$2'\;"; # COMMENT ON table_name.column_name IS 'text';
|
||||
s/COMMENT\s*'[^']*'//i;
|
||||
}
|
||||
|
||||
|
||||
# NUMERIC DATATYPES
|
||||
#
|
||||
# auto_increment -> sequences
|
||||
# UNSIGNED conversions
|
||||
# TINYINT
|
||||
# SMALLINT
|
||||
# MEDIUMINT
|
||||
# INT, INTEGER
|
||||
# BIGINT
|
||||
#
|
||||
# DOUBLE [PRECISION], REAL
|
||||
# DECIMAL(M,D), NUMERIC(M,D)
|
||||
# FLOAT(p)
|
||||
# FLOAT
|
||||
|
||||
s/(\w*int)\(\d+\)/$1/g; # hack of the (n) stuff for e.g. mediumint(2) int(3)
|
||||
|
||||
if (/^(\s*)(\w+)\s*.*numeric.*auto_increment/i) { # int,auto_increment -> serial
|
||||
$seq = get_identifier($table, $2, 'seq');
|
||||
$quoted_column=quote_and_lc($2);
|
||||
# Smash datatype to int8 and autogenerate the sequence.
|
||||
s/^(\s*)(\w+)\s*.*NUMERIC(.*)auto_increment([^,]*)/$1 $quoted_column serial8 $4/ig;
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
}
|
||||
if (/^\s*(\w+)\s+.*int.*auto_increment/i) { # example: data_id mediumint(8) unsigned NOT NULL auto_increment,
|
||||
$seq = get_identifier($table, $1, 'seq');
|
||||
$quoted_column=quote_and_lc($1);
|
||||
s/(\s*)(\w+)\s+.*int.*auto_increment([^,]*)/$1 $quoted_column serial8 $3/ig;
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# convert UNSIGNED to CHECK constraints
|
||||
if (m/^(\s*)(\w+)\s+((float|double precision|double|real|decimal|numeric))(.*)unsigned/i) {
|
||||
$quoted_column = quote_and_lc($2);
|
||||
s/^(\s*)(\w+)\s+((float|double precision|double|real|decimal|numeric))(.*)unsigned/$1 $quoted_column $3 $4 CHECK ($quoted_column >= 0)/i;
|
||||
}
|
||||
# example: `wordsize` tinyint(3) unsigned default NULL,
|
||||
if (m/^(\s+)(\w+)\s+(\w+)\s+unsigned/i) {
|
||||
$quoted_column=quote_and_lc($2);
|
||||
s/^(\s+)(\w+)\s+(\w+)\s+unsigned/$1 $quoted_column $3 CHECK ($quoted_column >= 0)/i;
|
||||
}
|
||||
if (m/^(\s*)(\w+)\s+(bigint.*)unsigned/) {
|
||||
$quoted_column=quote_and_lc($2);
|
||||
# see http://archives.postgresql.org/pgsql-general/2005-07/msg01178.php
|
||||
# and see http://www.postgresql.org/docs/8.2/interactive/datatype-numeric.html
|
||||
# see http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html max size == 20 digits
|
||||
s/^(\s*)(\w+)\s+bigint(.*)unsigned/$1 $quoted_column NUMERIC (20,0) CHECK ($quoted_column >= 0)/i;
|
||||
|
||||
}
|
||||
|
||||
# int type conversion
|
||||
# TINYINT (signed) -128 to 127 (unsigned) 0 255
|
||||
# SMALLINT A small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535.
|
||||
# MEDIUMINT A medium-sized integer. The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.
|
||||
# INT A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295.
|
||||
# BIGINT The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range is 0 to 18446744073709551615
|
||||
# for postgres see http://www.postgresql.org/docs/8.2/static/datatype-numeric.html#DATATYPE-INT
|
||||
s/^(\s+"*\w+"*\s+)tinyint/$1 smallint/i;
|
||||
s/^(\s+"*\w+"*\s+)mediumint/$1 integer/i;
|
||||
|
||||
# the floating point types
|
||||
# double -> double precision
|
||||
# double(n,m) -> double precision
|
||||
# float - no need for conversion
|
||||
# float(n) - no need for conversion
|
||||
# float(n,m) -> double precision
|
||||
|
||||
s/(^\s*\w+\s+)double(\(\d+,\d+\))?/$1float/i;
|
||||
s/float(\(\d+,\d+\))/float/i;
|
||||
|
||||
#
|
||||
# CHARACTER TYPES
|
||||
#
|
||||
# set
|
||||
# enum
|
||||
# binary(M), VARBINARy(M), tinyblob, tinytext,
|
||||
# bit
|
||||
# char(M), varchar(M)
|
||||
# blob -> text
|
||||
# mediumblob
|
||||
# longblob, longtext
|
||||
# text -> text
|
||||
# mediumtext
|
||||
# longtext
|
||||
# mysql docs: A BLOB is a binary large object that can hold a variable amount of data.
|
||||
|
||||
# set
|
||||
# For example, a column specified as SET('one', 'two') NOT NULL can have any of these values:
|
||||
# ''
|
||||
# 'one'
|
||||
# 'two'
|
||||
# 'one,two'
|
||||
if (/(\w*)\s+set\(((?:['"]\w+['"]\s*,*)+(?:['"]\w+['"])*)\)(.*)$/i) { # example: `au_auth` set('r','w','d') NOT NULL default '',
|
||||
$column_name = $1;
|
||||
$constraints{$column_name}{'values'} = $2; # 'abc','def', ...
|
||||
$constraints{$column_name}{'type'} = "set"; # 'abc','def', ...
|
||||
$_ = qq~ $column_name varchar , ~;
|
||||
$column_name = quote_and_lc($1);
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
|
||||
}
|
||||
if (/(\S*)\s+enum\(((?:['"][^'"]+['"]\s*,)+['"][^'"]+['"])\)(.*)$/i) { # enum handling
|
||||
# example: `test` enum('?','+','-') NOT NULL default '?'
|
||||
# $2 is the values of the enum 'abc','def', ...
|
||||
$quoted_column=quote_and_lc($1);
|
||||
# "test" NOT NULL default '?' CONSTRAINT test_test_constraint CHECK ("test" IN ('?','+','-'))
|
||||
$_ = qq~ $quoted_column varchar CHECK ($quoted_column IN ( $2 ))$3\n~; # just assume varchar?
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
}
|
||||
# Take care of "binary" option for char and varchar
|
||||
# (pre-4.1.2, it indicated a byte array; from 4.1.2, indicates
|
||||
# a binary collation)
|
||||
s/(?:var)?char(?:\(\d+\))? (?:byte|binary)/text/i;
|
||||
if (m/(?:var)?binary\s*\(\d+\)/i) { # c varBINARY(3) in Mysql
|
||||
warn "WARNING in table '$table' '$_': binary type is converted to bytea (unsized) for Postgres\n";
|
||||
}
|
||||
s/(?:var)?binary(?:\(\d+\))?/text/i; # c varBINARY(3) in Mysql
|
||||
s/bit(?:\(\d+\))?/bytea/i; # bit datatype -> bytea
|
||||
|
||||
# large datatypes
|
||||
s/\w*blob/bytea/gi;
|
||||
s/tinytext/text/gi;
|
||||
s/mediumtext/text/gi;
|
||||
s/longtext/text/gi;
|
||||
|
||||
# char -> varchar -- if specified as a command line option
|
||||
# PostgreSQL would otherwise pad with spaces as opposed
|
||||
# to MySQL! Your user interface may depend on this!
|
||||
if ($CHAR2VARCHAR) {
|
||||
s/(^\s+\S+\s+)char/${1}varchar/gi;
|
||||
}
|
||||
|
||||
# nuke column's collate and character set
|
||||
s/(\S+)\s+character\s+set\s+\w+/$1/gi;
|
||||
s/(\S+)\s+collate\s+\w+/$1/gi;
|
||||
|
||||
#
|
||||
# DATE AND TIME TYPES
|
||||
#
|
||||
# date time
|
||||
# year
|
||||
# datetime
|
||||
# timestamp
|
||||
|
||||
# date time
|
||||
# these are the same types in postgres, just do the replacement of 0000-00-00 date
|
||||
|
||||
if (m/default '(\d+)-(\d+)-(\d+)([^']*)'/i) { # we grab the year, month and day
|
||||
# NOTE: times of 00:00:00 are possible and are okay
|
||||
my $time = '';
|
||||
my $year=$1;
|
||||
my $month= $2;
|
||||
my $day = $3;
|
||||
if ($4) {
|
||||
$time = $4;
|
||||
}
|
||||
if ($year eq "0000") { $year = '1970'; }
|
||||
if ($month eq "00") { $month = '01'; }
|
||||
if ($day eq "00") { $day = '01'; }
|
||||
s/default '[^']+'/default '$year-$month-$day$time'/i; # finally we replace with $datetime
|
||||
}
|
||||
|
||||
# convert mysql's year datatype to a constraint
|
||||
if (/(\w*)\s+year\(4\)(.*)$/i) { # can be integer OR string 1901-2155
|
||||
$constraint_table_name = get_identifier($table,$1 ,"constraint_table");
|
||||
$column_name=quote_and_lc($1);
|
||||
@year_holder = ();
|
||||
$year='';
|
||||
for (1901 .. 2155) {
|
||||
$year = "'$_'";
|
||||
unless ($year =~ /2155/) { $year .= ','; }
|
||||
push( @year_holder, $year);
|
||||
}
|
||||
$constraints{$column_name}{'values'} = join('','',@year_holder); # '1901','1902', ...
|
||||
$constraints{$column_name}{'type'} = "year";
|
||||
$_ = qq~ $column_name varchar CONSTRAINT ${table}_${column_name}_constraint REFERENCES $constraint_table_name ("year_values") $2\n~;
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
} elsif (/(\w*)\s+year\(2\)(.*)$/i) { # same for a 2-integer string
|
||||
$constraint_table_name = get_identifier($table,$1 ,"constraint_table");
|
||||
$column_name=quote_and_lc($1);
|
||||
@year_holder = ();
|
||||
$year='';
|
||||
for (1970 .. 2069) {
|
||||
$year = "'$_'";
|
||||
if ($year =~ /2069/) { next; }
|
||||
push( @year_holder, $year);
|
||||
}
|
||||
push( @year_holder, '0000');
|
||||
$constraints{$column_name}{'values'} = join(',',@year_holder); # '1971','1972', ...
|
||||
$constraints{$column_name}{'type'} = "year"; # 'abc','def', ...
|
||||
$_ = qq~ $1 varchar CONSTRAINT ${table}_${column_name}_constraint REFERENCES $constraint_table_name ("year_values") $2\n~;
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
}
|
||||
|
||||
# datetime
|
||||
# Default on a dump from MySQL 5.0.22 is in the same form as datetime so let it flow down
|
||||
# to the timestamp section and deal with it there
|
||||
s/(${sl})datetime /$1timestamp without time zone /i;
|
||||
|
||||
# change not null datetime field to null valid ones
|
||||
# (to support remapping of "zero time" to null
|
||||
# s/($sl)datetime not null/$1timestamp without time zone/i;
|
||||
|
||||
|
||||
# timestamps
|
||||
#
|
||||
# nuke datetime representation (not supported in PostgreSQL)
|
||||
# change default time of 0000-00-00 to 1970-01-01
|
||||
|
||||
# we may possibly need to create a trigger to provide
|
||||
# equal functionality with ON UPDATE CURRENT TIMESTAMP
|
||||
|
||||
|
||||
if (m/${sl}timestamp/i) {
|
||||
if ( m/ON UPDATE CURRENT_TIMESTAMP/i ) { # the ... default CURRENT_TIMESTAMP only applies for blank inserts, not updates
|
||||
s/ON UPDATE CURRENT_TIMESTAMP//i ;
|
||||
m/^\s*(\w+)\s+timestamp/i ;
|
||||
# automatic trigger creation
|
||||
$table_no_quotes =~ s/"//g;
|
||||
$function_create_sql .= " CREATE OR REPLACE FUNCTION update_". $table_no_quotes . "() RETURNS trigger AS '
|
||||
BEGIN
|
||||
NEW.$1 := CURRENT_TIMESTAMP;
|
||||
RETURN NEW;
|
||||
END;
|
||||
' LANGUAGE 'plpgsql';
|
||||
|
||||
-- before INSERT is handled by 'default CURRENT_TIMESTAMP'
|
||||
CREATE TRIGGER add_current_date_to_".$table_no_quotes." BEFORE UPDATE ON ". $table . " FOR EACH ROW EXECUTE PROCEDURE
|
||||
update_".$table_no_quotes."();\n";
|
||||
|
||||
}
|
||||
if ($tables_first_timestamp_column && m/DEFAULT NULL/i) {
|
||||
# DEFAULT NULL is the same as DEFAULT CURRENT_TIMESTAMP for the first TIMESTAMP column. (MYSQL manual)
|
||||
s/($sl)(timestamp\s+)default null/$1 $2 DEFAULT CURRENT_TIMESTAMP/i;
|
||||
}
|
||||
$tables_first_timestamp_column= 0;
|
||||
if (m/${sl}timestamp\s*\(\d+\)/i) { # fix for timestamps with width spec not handled (ID: 1628)
|
||||
warn "WARNING for in table '$table' '$_': your default timestamp width is being ignored for table $table \n";
|
||||
s/($sl)timestamp(?:\(\d+\))/$1datetime/i;
|
||||
}
|
||||
} # end timestamp section
|
||||
|
||||
# KEY AND UNIQUE CREATIONS
|
||||
#
|
||||
# unique
|
||||
if ( /^\s+unique\s+\(([^(]+)\)/i ) { # example UNIQUE `name` (`name`), same as UNIQUE KEY
|
||||
# POSTGRESQL: treat same as mysql unique
|
||||
$quoted_column = quote_and_lc($1);
|
||||
s/\s+unique\s+\(([^(]+)\)/ unique ($quoted_column) /i;
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
} elsif ( /^\s+unique\s+key\s*(\w+)\s*\(([^(]+)\)/i ) { # example UNIQUE KEY `name` (`name`)
|
||||
# MYSQL: unique key: allows null=YES, allows duplicates=NO (*)
|
||||
# ... new ... UNIQUE KEY `unique_fullname` (`fullname`) in my mysql v. Ver 14.12 Distrib 5.1.7-beta
|
||||
# POSTGRESQL: treat same as mysql unique
|
||||
# just quote columns
|
||||
$quoted_column = quote_and_lc($2);
|
||||
s/\s+unique\s+key\s*(\w+)\s*\(([^(]+)\)/ unique ($quoted_column) /i;
|
||||
$create_sql.=$_;
|
||||
# the index corresponding to the 'key' is automatically created
|
||||
next;
|
||||
}
|
||||
# keys
|
||||
if ( /^\s+fulltext key\s+/i) { # example: FULLTEXT KEY `commenttext` (`commenttext`)
|
||||
# that is key as a word in the first check for a match
|
||||
# the tsvector datatype is made for these types of things
|
||||
# example mysql file:
|
||||
# what is tsvector datatype?
|
||||
# http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intro.html
|
||||
warn "dba must do fulltext key transformation for $table\n";
|
||||
next;
|
||||
}
|
||||
if ( /^(\s+)constraint (\S+) foreign key \((\S+)\) references (\S+) \((\S+)\)(.*)/i ) {
|
||||
$quoted_column =quote_and_lc($3);
|
||||
$col=quote_and_lc($5);
|
||||
$post_create_sql .= "ALTER TABLE $table ADD FOREIGN KEY ($quoted_column) REFERENCES " . quote_and_lc($4) . " ($col);\n";
|
||||
next;
|
||||
}
|
||||
if ( /^\s*primary key\s*\(([^)]+)\)([,\s]+)/i ) { # example PRIMARY KEY (`name`)
|
||||
# MYSQL: primary key: allows null=NO , allows duplicates=NO
|
||||
# POSTGRESQL: When an index is declared unique, multiple table rows with equal indexed values will not be
|
||||
# allowed. Null values are not considered equal.
|
||||
# POSTGRESQL quote's source: 8.1.3 docs section 11.5 "unique indexes"
|
||||
# so, in postgres, we need to add a NOT NULL to the UNIQUE constraint
|
||||
# and, primary key (mysql) == primary key (postgres) so that we *really* don't need change anything
|
||||
$quoted_column = quote_and_lc($1);
|
||||
s/(\s*)primary key\s+\(([^)]+)\)([,\s]+)/$1 primary key ($quoted_column)$3/i;
|
||||
# indexes are automatically created for unique columns
|
||||
$create_sql.=$_;
|
||||
next;
|
||||
} elsif (m/^\s+key\s[-_\s\w]+\((.+)\)/i ) { # example: KEY `idx_mod_english_def_word` (`word`),
|
||||
# regular key: allows null=YES, allows duplicates=YES
|
||||
# MYSQL: KEY is normally a synonym for INDEX. http://dev.mysql.com/doc/refman/5.1/en/create-table.html
|
||||
#
|
||||
# * MySQL: ALTER TABLE {$table} ADD KEY $column ($column)
|
||||
# * PostgreSQL: CREATE INDEX {$table}_$column_idx ON {$table}($column) // Please note the _idx "extension"
|
||||
# PRIMARY KEY (`postid`),
|
||||
# KEY `ownerid` (`ownerid`)
|
||||
# create an index for everything which has a key listed for it.
|
||||
my $col = $1;
|
||||
# TODO we don't have a translation for the substring syntax in text columns in MySQL (e.g. "KEY my_idx (mytextcol(20))")
|
||||
# for now just getting rid of the brackets and numbers (the substring specifier):
|
||||
$col=~s/\(\d+\)//g;
|
||||
$quoted_column = quote_and_lc($col);
|
||||
if ($col =~ m/,/) {
|
||||
$col = s/,/_/;
|
||||
}
|
||||
$index = get_identifier($table, $col, 'idx');
|
||||
$post_create_sql.="CREATE INDEX $index ON $table USING btree ($quoted_column)\;";
|
||||
# just create index do not add to create table statement
|
||||
next;
|
||||
}
|
||||
|
||||
# handle 'key' declared at end of column
|
||||
if (/\w+.*primary key/i) { # mysql: key is normally just a synonym for index
|
||||
# just leave as is ( postgres has primary key type)
|
||||
|
||||
|
||||
} elsif (/(\w+\s+(?:$mysql_datatypesStr)\s+.*)key/i) { # mysql: key is normally just a synonym for index
|
||||
# I can't find a reference for 'key' in a postgres command without using the word 'primary key'
|
||||
s/$1key/$1/i ;
|
||||
$index = get_identifier($table, $1, 'idx');
|
||||
$quoted_column =quote_and_lc($1);
|
||||
$post_create_sql.="CREATE INDEX $index ON $table USING btree ($quoted_column) \;";
|
||||
$create_sql.=$_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# do we really need this anymore?
|
||||
# remap colums with names of existing system attribute
|
||||
if (/"oid"/i) {
|
||||
s/"oid"/"_oid"/g;
|
||||
print STDERR "WARNING: table $table uses column \"oid\" which is renamed to \"_oid\"\nYou should fix application manually! Press return to continue.";
|
||||
my $wait=<STDIN>;
|
||||
}
|
||||
|
||||
s/oid/_oid/i if (/key/i && /oid/i); # fix oid in key
|
||||
|
||||
# FINAL QUOTING OF ALL COLUMNS
|
||||
# quote column names which were not already quoted
|
||||
# perhaps they were not quoted because they were not explicitly handled
|
||||
if (!/^\s*"(\w+)"(\s+)/i) {
|
||||
/^(\s*)(\w+)(\s+)(.*)$/i ;
|
||||
$quoted_column= quote_and_lc($2);
|
||||
s/^(\s*)(\w+)(\s+)(.*)$/$1 $quoted_column $3 $4 /;
|
||||
}
|
||||
$create_sql.=$_;
|
||||
# END of if ($create_sql ne "") i.e. were inside create table statement so processed datatypes
|
||||
}
|
||||
# add "not in create table" comments or empty lines to pre_create_sql
|
||||
elsif (/^#/ || /^$/ || /^\s*--/) {
|
||||
s/^#/--/; # Two hyphens (--) is the SQL-92 standard indicator for comments
|
||||
$pre_create_sql .= $_ ; # printed above create table statement
|
||||
next;
|
||||
}
|
||||
elsif (/^\s*insert into/i) { # not inside create table and doing insert
|
||||
# fix mysql's zero/null value for timestamps
|
||||
s/'0000-00-00/'1970-01-01/gi;
|
||||
# commented out to fix bug "Field contents interpreted as a timestamp", what was the point of this line anyway?
|
||||
#s/([12]\d\d\d)([01]\d)([0-3]\d)([0-2]\d)([0-6]\d)([0-6]\d)/'$1-$2-$3 $4:$5:$6'/;
|
||||
|
||||
#---- fix data in inserted data: (from MS world)
|
||||
s!\x96!-!g; # --
|
||||
s!\x93!"!g; # ``
|
||||
s!\x94!"!g; # ''
|
||||
s!\x85!... !g; # \ldots
|
||||
s!\x92!`!g;
|
||||
|
||||
print OUT $pre_create_sql; # print comments preceding the insert section
|
||||
$pre_create_sql="";
|
||||
$auto_increment_seq = "";
|
||||
|
||||
s/'((?:[^'\\]++|\\.)*+)'(?=[),])/E'$1'/g;
|
||||
# for the E'' see http://www.postgresql.org/docs/8.2/interactive/release-8-1.html
|
||||
s!\\\\!\\\\\\\\!g; # replace \\ with ]\\\\
|
||||
|
||||
# split 'extended' INSERT INTO statements to something PostgreSQL can understand
|
||||
( $insert_table, $valueString) = $_ =~ m/^INSERT\s+INTO\s+['`"]*(.*?)['`"]*\s+VALUES\s*(.*)/i;
|
||||
$insert_table = quote_and_lc($insert_table);
|
||||
|
||||
s/^INSERT INTO.*?\);//i; # hose the statement which is to be replaced whether a run-on or not
|
||||
# guarantee table names are quoted
|
||||
print OUT qq(INSERT INTO $insert_table VALUES $valueString \n);
|
||||
|
||||
} else {
|
||||
print OUT $_ ; # example: /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
}
|
||||
# keep looping and get next line of IN file
|
||||
|
||||
} # END while(<IN>)
|
||||
|
||||
print_post_create_sql(); # in case there is extra from the last table
|
||||
|
||||
#################################################################
|
||||
# 5. print_plgsql function prototype
|
||||
# emulate the set datatype with the following plpgsql function
|
||||
# looks ugly so putting at end of file
|
||||
#################################################################
|
||||
#
|
||||
sub make_plpgsql {
|
||||
my ($table,$column_name) = ($_[0],$_[1]);
|
||||
$table=~s/\"//g; # make sure that $table doesn't have quotes so we don't end up with redundant quoting
|
||||
my $constraint_table = get_identifier($table,$column_name ,"constraint_table");
|
||||
return "
|
||||
-- this function is called by the insert/update trigger
|
||||
-- it checks if the INSERT/UPDATE for the 'set' column
|
||||
-- contains members which comprise a valid mysql set
|
||||
-- this TRIGGER function therefore acts like a constraint
|
||||
-- provided limited functionality for mysql's set datatype
|
||||
-- just verifies and matches for string representations of the set at this point
|
||||
-- though the set datatype uses bit comparisons, the only supported arguments to our
|
||||
-- set datatype are VARCHAR arguments
|
||||
-- to add a member to the set add it to the ".$table."_".$column_name." table
|
||||
CREATE OR REPLACE FUNCTION check_".$table."_".$column_name."_set( ) RETURNS TRIGGER AS \$\$\n
|
||||
DECLARE
|
||||
----
|
||||
arg_str VARCHAR ;
|
||||
argx VARCHAR := '';
|
||||
nobreak INT := 1;
|
||||
rec_count INT := 0;
|
||||
psn INT := 0;
|
||||
str_in VARCHAR := NEW.$column_name;
|
||||
----
|
||||
BEGIN
|
||||
----
|
||||
IF str_in IS NULL THEN RETURN NEW ; END IF;
|
||||
arg_str := REGEXP_REPLACE(str_in, '\\',\\'', ','); -- str_in is CONSTANT
|
||||
arg_str := REGEXP_REPLACE(arg_str, '^\\'', '');
|
||||
arg_str := REGEXP_REPLACE(arg_str, '\\'\$', '');
|
||||
-- RAISE NOTICE 'arg_str %',arg_str;
|
||||
psn := POSITION(',' in arg_str);
|
||||
IF psn > 0 THEN
|
||||
psn := psn - 1; -- minus-1 from comma position
|
||||
-- RAISE NOTICE 'psn %',psn;
|
||||
argx := SUBSTRING(arg_str FROM 1 FOR psn); -- get one set member
|
||||
psn := psn + 2; -- go to first starting letter
|
||||
arg_str := SUBSTRING(arg_str FROM psn); -- hack it off
|
||||
ELSE
|
||||
psn := 0; -- minus-1 from comma position
|
||||
argx := arg_str;
|
||||
END IF;
|
||||
-- RAISE NOTICE 'argx %',argx;
|
||||
-- RAISE NOTICE 'new arg_str: %',arg_str;
|
||||
WHILE nobreak LOOP
|
||||
EXECUTE 'SELECT count(*) FROM $constraint_table WHERE set_values = ' || quote_literal(argx) INTO rec_count;
|
||||
IF rec_count = 0 THEN RAISE EXCEPTION 'one of the set values was not found';
|
||||
END IF;
|
||||
IF psn > 0 THEN
|
||||
psn := psn - 1; -- minus-1 from comma position
|
||||
-- RAISE NOTICE 'psn %',psn;
|
||||
argx := SUBSTRING(arg_str FROM 1 FOR psn); -- get one set member
|
||||
psn := psn + 2; -- go to first starting letter
|
||||
arg_str := SUBSTRING(arg_str FROM psn); -- hack it off
|
||||
psn := POSITION(',' in arg_str);
|
||||
ELSE nobreak = 0;
|
||||
END IF;
|
||||
-- RAISE NOTICE 'next argx % and next arg_str %', argx, arg_str;
|
||||
END LOOP;
|
||||
RETURN NEW;
|
||||
----
|
||||
END;
|
||||
\$\$ LANGUAGE 'plpgsql' VOLATILE;
|
||||
|
||||
drop trigger set_test ON $table;
|
||||
-- make a trigger for each set field
|
||||
-- make trigger and hard-code in column names
|
||||
-- see http://archives.postgresql.org/pgsql-interfaces/2005-02/msg00020.php
|
||||
CREATE TRIGGER set_test
|
||||
BEFORE INSERT OR UPDATE ON $table FOR EACH ROW
|
||||
EXECUTE PROCEDURE check_".$table."_".$column_name."_set();\n";
|
||||
} # end sub make_plpgsql();
|
||||
|
||||
@@ -1,199 +0,0 @@
|
||||
place_type,level
|
||||
Q9842,4
|
||||
Q9430,3
|
||||
Q928830,4
|
||||
Q9259,1
|
||||
Q91028,5
|
||||
Q8514,2
|
||||
Q8502,2
|
||||
Q83405,3
|
||||
Q82794,2
|
||||
Q820477,1
|
||||
Q811979,1
|
||||
Q8072,2
|
||||
Q79007,2
|
||||
Q786014,3
|
||||
Q75848,2
|
||||
Q75520,2
|
||||
Q728937,4
|
||||
Q7275,2
|
||||
Q719456,3
|
||||
Q7075,3
|
||||
Q697295,4
|
||||
Q6852233,2
|
||||
Q682943,3
|
||||
Q665487,5
|
||||
Q655686,3
|
||||
Q643589,5
|
||||
Q641226,2
|
||||
Q631305,2
|
||||
Q6256,2
|
||||
Q6023295,2
|
||||
Q5773747,5
|
||||
Q56061,1
|
||||
Q55659167,4
|
||||
Q55488,4
|
||||
Q55465477,3
|
||||
Q54050,2
|
||||
Q532,3
|
||||
Q53060,2
|
||||
Q52177058,4
|
||||
Q515716,5
|
||||
Q5153984,4
|
||||
Q515,3
|
||||
Q5144960,5
|
||||
Q5119,4
|
||||
Q5119,4
|
||||
Q5107,2
|
||||
Q5084,4
|
||||
Q5031071,4
|
||||
Q5003624,2
|
||||
Q4989906,1
|
||||
Q4976993,3
|
||||
Q486972,1
|
||||
Q486972,2
|
||||
Q483110,3
|
||||
Q4830453,4
|
||||
Q47521,3
|
||||
Q473972,1
|
||||
Q46831,2
|
||||
Q46614560,5
|
||||
Q44782,3
|
||||
Q44613,4
|
||||
Q44539,4
|
||||
Q44494,2
|
||||
Q44377,2
|
||||
Q4421,2
|
||||
Q43501,2
|
||||
Q4286337,3
|
||||
Q42523,3
|
||||
Q41176,2
|
||||
Q40357,3
|
||||
Q4022,4
|
||||
Q40080,2
|
||||
Q39816,2
|
||||
Q39715,3
|
||||
Q39614,1
|
||||
Q3957,3
|
||||
Q3947,4
|
||||
Q3914,3
|
||||
Q38723,2
|
||||
Q38720,3
|
||||
Q3623867,5
|
||||
Q35666,2
|
||||
Q355304,3
|
||||
Q35509,2
|
||||
Q35112127,3
|
||||
Q34985575,4
|
||||
Q34876,5
|
||||
Q34763,2
|
||||
Q34627,4
|
||||
Q3455524,3
|
||||
Q34442,4
|
||||
Q33837,2
|
||||
Q33506,3
|
||||
Q32815,4
|
||||
Q3257686,2
|
||||
Q3240715,2
|
||||
Q3191695,5
|
||||
Q3153117,2
|
||||
Q30198,2
|
||||
Q30139652,3
|
||||
Q294422,3
|
||||
Q2870166,3
|
||||
Q27686,3
|
||||
Q274153,3
|
||||
Q271669,1
|
||||
Q2659904,2
|
||||
Q24529780,2
|
||||
Q24354,3
|
||||
Q2354973,4
|
||||
Q23442,2
|
||||
Q23413,3
|
||||
Q23397,3
|
||||
Q2327515,4
|
||||
Q2311958,5
|
||||
Q22927291,6
|
||||
Q22698,1
|
||||
Q2175765,4
|
||||
Q205495,4
|
||||
Q204832,3
|
||||
Q2042028,2
|
||||
Q202216,6
|
||||
Q1970725,3
|
||||
Q194203,5
|
||||
Q194195,2
|
||||
Q190429,2
|
||||
Q185187,3
|
||||
Q185113,2
|
||||
Q183366,2
|
||||
Q1799794,1
|
||||
Q1788454,4
|
||||
Q1785071,3
|
||||
Q1777138,3
|
||||
Q177634,2
|
||||
Q177380,2
|
||||
Q174814,4
|
||||
Q174782,2
|
||||
Q17350442,2
|
||||
Q17343829,3
|
||||
Q17334923,0
|
||||
Q17018380,3
|
||||
Q16970,4
|
||||
Q16917,3
|
||||
Q16831714,4
|
||||
Q165,3
|
||||
Q160742,4
|
||||
Q159719,3
|
||||
Q159334,4
|
||||
Q15640612,5
|
||||
Q15324,2
|
||||
Q15284,5
|
||||
Q15243209,6
|
||||
Q152081,1
|
||||
Q15195406,4
|
||||
Q1500350,5
|
||||
Q149621,5
|
||||
Q14757767,4
|
||||
Q14350,3
|
||||
Q1410668,3
|
||||
Q1394476,3
|
||||
Q1377575,2
|
||||
Q1353183,3
|
||||
Q134447,4
|
||||
Q133215,3
|
||||
Q133056,2
|
||||
Q13221722,3
|
||||
Q13220204,2
|
||||
Q1311958,4
|
||||
Q1303167,3
|
||||
Q130003,3
|
||||
Q12518,2
|
||||
Q12516,3
|
||||
Q1248784,3
|
||||
Q123705,3
|
||||
Q12323,3
|
||||
Q12284,4
|
||||
Q12280,4
|
||||
Q121359,2
|
||||
Q1210950,2
|
||||
Q11755880,3
|
||||
Q11707,3
|
||||
Q11315,3
|
||||
Q11303,3
|
||||
Q1115575,4
|
||||
Q1107656,1
|
||||
Q10864048,1
|
||||
Q1076486,2
|
||||
Q105731,3
|
||||
Q105190,3
|
||||
Q1048525,3
|
||||
Q102496,5
|
||||
Q28872924,1
|
||||
Q15617994,1
|
||||
Q159313,2
|
||||
Q24398318,3
|
||||
Q327333,2
|
||||
Q43229,1
|
||||
Q860861,1
|
||||
Q4989906,1
|
||||
|
@@ -1,195 +0,0 @@
|
||||
Q9842
|
||||
Q9430
|
||||
Q928830
|
||||
Q9259
|
||||
Q91028
|
||||
Q8514
|
||||
Q8502
|
||||
Q83405
|
||||
Q82794
|
||||
Q820477
|
||||
Q811979
|
||||
Q8072
|
||||
Q79007
|
||||
Q786014
|
||||
Q75848
|
||||
Q75520
|
||||
Q728937
|
||||
Q7275
|
||||
Q719456
|
||||
Q7075
|
||||
Q697295
|
||||
Q6852233
|
||||
Q682943
|
||||
Q665487
|
||||
Q655686
|
||||
Q643589
|
||||
Q641226
|
||||
Q631305
|
||||
Q6256
|
||||
Q6023295
|
||||
Q5773747
|
||||
Q56061
|
||||
Q55659167
|
||||
Q55488
|
||||
Q55465477
|
||||
Q54050
|
||||
Q532
|
||||
Q53060
|
||||
Q52177058
|
||||
Q515716
|
||||
Q5153984
|
||||
Q515
|
||||
Q5144960
|
||||
Q5119
|
||||
Q5107
|
||||
Q5084
|
||||
Q5031071
|
||||
Q5003624
|
||||
Q4989906
|
||||
Q4976993
|
||||
Q486972
|
||||
Q483110
|
||||
Q4830453
|
||||
Q47521
|
||||
Q473972
|
||||
Q46831
|
||||
Q46614560
|
||||
Q44782
|
||||
Q44613
|
||||
Q44539
|
||||
Q44494
|
||||
Q44377
|
||||
Q4421
|
||||
Q43501
|
||||
Q4286337
|
||||
Q42523
|
||||
Q41176
|
||||
Q40357
|
||||
Q4022
|
||||
Q40080
|
||||
Q39816
|
||||
Q39715
|
||||
Q39614
|
||||
Q3957
|
||||
Q3947
|
||||
Q3914
|
||||
Q38723
|
||||
Q38720
|
||||
Q3623867
|
||||
Q35666
|
||||
Q355304
|
||||
Q35509
|
||||
Q35112127
|
||||
Q34985575
|
||||
Q34876
|
||||
Q34763
|
||||
Q34627
|
||||
Q3455524
|
||||
Q34442
|
||||
Q33837
|
||||
Q33506
|
||||
Q32815
|
||||
Q3257686
|
||||
Q3240715
|
||||
Q3191695
|
||||
Q3153117
|
||||
Q30198
|
||||
Q30139652
|
||||
Q294422
|
||||
Q2870166
|
||||
Q27686
|
||||
Q274153
|
||||
Q271669
|
||||
Q2659904
|
||||
Q24529780
|
||||
Q24354
|
||||
Q2354973
|
||||
Q23442
|
||||
Q23413
|
||||
Q23397
|
||||
Q2327515
|
||||
Q2311958
|
||||
Q22927291
|
||||
Q22698
|
||||
Q2175765
|
||||
Q205495
|
||||
Q204832
|
||||
Q2042028
|
||||
Q202216
|
||||
Q1970725
|
||||
Q194203
|
||||
Q194195
|
||||
Q190429
|
||||
Q185187
|
||||
Q185113
|
||||
Q183366
|
||||
Q1799794
|
||||
Q1788454
|
||||
Q1785071
|
||||
Q1777138
|
||||
Q177634
|
||||
Q177380
|
||||
Q174814
|
||||
Q174782
|
||||
Q17350442
|
||||
Q17343829
|
||||
Q17334923
|
||||
Q17018380
|
||||
Q16970
|
||||
Q16917
|
||||
Q16831714
|
||||
Q165
|
||||
Q160742
|
||||
Q159719
|
||||
Q159334
|
||||
Q15640612
|
||||
Q15324
|
||||
Q15284
|
||||
Q15243209
|
||||
Q152081
|
||||
Q15195406
|
||||
Q1500350
|
||||
Q149621
|
||||
Q14757767
|
||||
Q14350
|
||||
Q1410668
|
||||
Q1394476
|
||||
Q1377575
|
||||
Q1353183
|
||||
Q134447
|
||||
Q133215
|
||||
Q133056
|
||||
Q13221722
|
||||
Q13220204
|
||||
Q1311958
|
||||
Q1303167
|
||||
Q130003
|
||||
Q12518
|
||||
Q12516
|
||||
Q1248784
|
||||
Q123705
|
||||
Q12323
|
||||
Q12284
|
||||
Q12280
|
||||
Q121359
|
||||
Q1210950
|
||||
Q11755880
|
||||
Q11707
|
||||
Q11315
|
||||
Q11303
|
||||
Q1115575
|
||||
Q1107656
|
||||
Q10864048
|
||||
Q1076486
|
||||
Q105731
|
||||
Q105190
|
||||
Q1048525
|
||||
Q102496
|
||||
Q28872924
|
||||
Q15617994
|
||||
Q159313
|
||||
Q24398318
|
||||
Q327333
|
||||
Q43229
|
||||
Q860861
|
||||
@@ -1,200 +0,0 @@
|
||||
|
||||
## Wikidata place types and related OSM Tags
|
||||
|
||||
Wikidata does not have any official ontologies, however the [DBpedia project](https://wiki.dbpedia.org/) has created an [ontology](https://wiki.dbpedia.org/services-resources/ontology) that covered [place types](http://mappings.dbpedia.org/server/ontology/classes/#Place). The table below used the DBpedia place ontology as a starting point, and is provided as a cross-reference to the relevant OSM tags.
|
||||
|
||||
The Wikidata place types listed in the table below can be used in conjunction with the [Wikidata Query Service](https://query.wikidata.org/) to retrieve instances of those place types from the Wikidata knowledgebase.
|
||||
|
||||
```
|
||||
SELECT ?item ?lat ?lon
|
||||
WHERE {
|
||||
?item wdt:P31*/wdt:P279*wd:Q9430; wdt:P625 ?pt.
|
||||
?item p:P625?loc.
|
||||
?loc psv:P625?cnode.
|
||||
?cnode wikibase:geoLatitude?lat.
|
||||
?cnode wikibase:geoLongitude?lon.
|
||||
}
|
||||
```
|
||||
|
||||
An example json return for all instances of the Wikidata item "Q9430" (Ocean) can be seen at [json](https://query.wikidata.org/bigdata/namespace/wdq/sparql?format=json&query=SELECT?item?lat?lon%20WHERE{?item%20wdt:P31*/wdt:P279*wd:Q9430;wdt:P625?pt.?item%20p:P625?loc.?loc%20psv:P625?cnode.?cnode%20wikibase:geoLatitude?lat.?cnode%20wikibase:geoLongitude?lon.})
|
||||
|
||||
**NOTE** the OSM tags listed are those listed in the wikidata entries, and not all the possible matches for tags within OSM.
|
||||
|
||||
|
||||
title | concept | OSM Tag |
|
||||
-----------|---------------------------------------|------------------|
|
||||
[Q17334923](https://www.wikidata.org/entity/Q17334923) | Location | |
|
||||
[Q811979](https://www.wikidata.org/entity/Q811979) | Architectural Structure | |
|
||||
[Q194195](https://www.wikidata.org/entity/Q194195) | Amusement park |
|
||||
[Q204832](https://www.wikidata.org/entity/Q204832) | Roller coaster | [attraction=roller_coaster](https://wiki.openstreetmap.org/wiki/Tag:attraction=roller_coaster) |
|
||||
[Q2870166](https://www.wikidata.org/entity/Q2870166) | Water ride | |
|
||||
[Q641226](https://www.wikidata.org/entity/Q641226) | Arena | [amenity=events_centre](https://wiki.openstreetmap.org/wiki/Tag:amenity=events_centre) |
|
||||
[Q41176](https://www.wikidata.org/entity/Q41176) | Building | [building=yes](https://wiki.openstreetmap.org/wiki/Key:building) |
|
||||
[Q1303167](https://www.wikidata.org/entity/Q1303167) | Barn | [building=barn](https://wiki.openstreetmap.org/wiki/Tag:building=barn) |
|
||||
[Q655686](https://www.wikidata.org/entity/Q655686) | Commercial building | [building=commercial](https://wiki.openstreetmap.org/wiki/Tag:building=commercial) |
|
||||
[Q4830453](https://www.wikidata.org/entity/Q4830453) | Business | |
|
||||
[Q7075](https://www.wikidata.org/entity/Q7075) | Library | [amenity=library](https://wiki.openstreetmap.org/wiki/Tag:amenity=library) |
|
||||
[Q133215](https://www.wikidata.org/entity/Q133215) | Casino | [amenity=casino](https://wiki.openstreetmap.org/wiki/Tag:amenity=casino) |
|
||||
[Q23413](https://www.wikidata.org/entity/Q23413) | Castle | [historic=castle](https://wiki.openstreetmap.org/wiki/Tag:historic=castle) |
|
||||
[Q83405](https://www.wikidata.org/entity/Q83405) | Factory | |
|
||||
[Q53060](https://www.wikidata.org/entity/Q53060) | Gate | [barrier=gate](https://wiki.openstreetmap.org/wiki/Tag:barrier=gate) |cnode%20wikibase:geoLatitude?lat.?cnode%20wikibase:geoLongitude?lon.})
|
||||
[Q11755880](https://www.wikidata.org/entity/Q11755880) | Residential Building | [building=residential](https://wiki.openstreetmap.org/wiki/Tag:building=residential) |
|
||||
[Q3947](https://www.wikidata.org/entity/Q3947) | House | [building=house](https://wiki.openstreetmap.org/wiki/Tag:building=house) |
|
||||
[Q35112127](https://www.wikidata.org/entity/Q35112127) | Historic Building | |
|
||||
[Q5773747](https://www.wikidata.org/entity/Q5773747) | Historic house | |
|
||||
[Q38723](https://www.wikidata.org/entity/Q38723) | Higher Education Institution |
|
||||
[Q3914](https://www.wikidata.org/entity/Q3914) | School | [amenity=school](https://wiki.openstreetmap.org/wiki/Tag:amenity=school) |
|
||||
[Q9842](https://www.wikidata.org/entity/Q9842) | Primary school | |
|
||||
[Q159334](https://www.wikidata.org/entity/Q159334) | Secondary school | |
|
||||
[Q16917](https://www.wikidata.org/entity/Q16917) | Hospital | [amenity=hospital](https://wiki.openstreetmap.org/wiki/Tag:amenity=hospital), [healthcare=hospital](https://wiki.openstreetmap.org/wiki/Tag:healthcare=hospital), [building=hospital](https://wiki.openstreetmap.org/wiki/Tag:building=hospital) |
|
||||
[Q27686](https://www.wikidata.org/entity/Q27686) | Hotel | [tourism=hotel](https://wiki.openstreetmap.org/wiki/Tag:tourism=hotel), [building=hotel](https://wiki.openstreetmap.org/wiki/Tag:building=hotel) |
|
||||
[Q33506](https://www.wikidata.org/entity/Q33506) | Museum | [tourism=museum](https://wiki.openstreetmap.org/wiki/Tag:tourism=museum) |
|
||||
[Q40357](https://www.wikidata.org/entity/Q40357) | Prison | [amenity=prison](https://wiki.openstreetmap.org/wiki/Tag:amenity=prison) |
|
||||
[Q24398318](https://www.wikidata.org/entity/Q24398318) | Religious Building | |
|
||||
[Q160742](https://www.wikidata.org/entity/Q160742) | Abbey | |
|
||||
[Q16970](https://www.wikidata.org/entity/Q16970) | Church (building) | [building=church](https://wiki.openstreetmap.org/wiki/Tag:building=church) |
|
||||
[Q44613](https://www.wikidata.org/entity/Q44613) | Monastery | [amenity=monastery](https://wiki.openstreetmap.org/wiki/Tag:amenity=monastery) |
|
||||
[Q32815](https://www.wikidata.org/entity/Q32815) | Mosque | [building=mosque](https://wiki.openstreetmap.org/wiki/Tag:building=mosque) |
|
||||
[Q697295](https://www.wikidata.org/entity/Q697295) | Shrine | [building=shrine](https://wiki.openstreetmap.org/wiki/Tag:building=shrine) |
|
||||
[Q34627](https://www.wikidata.org/entity/Q34627) | Synagogue | [building=synagogue](https://wiki.openstreetmap.org/wiki/Tag:building=synagogue) |
|
||||
[Q44539](https://www.wikidata.org/entity/Q44539) | Temple | [building=temple](https://wiki.openstreetmap.org/wiki/Tag:building=temple) |
|
||||
[Q11707](https://www.wikidata.org/entity/Q11707) | Restaurant | [amenity=restaurant](https://wiki.openstreetmap.org/wiki/Tag:amenity=restaurant) |
|
||||
[Q11315](https://www.wikidata.org/entity/Q11315) | Shopping mall | [shop=mall](https://wiki.openstreetmap.org/wiki/Tag:shop=mall), [shop=shopping_centre](https://wiki.openstreetmap.org/wiki/Tag:shop=shopping_centre) |
|
||||
[Q11303](https://www.wikidata.org/entity/Q11303) | Skyscraper | |
|
||||
[Q17350442](https://www.wikidata.org/entity/Q17350442) | Venue | |
|
||||
[Q41253](https://www.wikidata.org/entity/Q41253) | Movie Theater | [amenity=cinema](https://wiki.openstreetmap.org/wiki/Tag:amenity=cinema) |
|
||||
[Q483110](https://www.wikidata.org/entity/Q483110) | Stadium | [leisure=stadium](https://wiki.openstreetmap.org/wiki/Tag:leisure=stadium), [building=stadium](https://wiki.openstreetmap.org/wiki/Tag:building=stadium) |
|
||||
[Q24354](https://www.wikidata.org/entity/Q24354) | Theater (structure) | [amenity=theatre](https://wiki.openstreetmap.org/wiki/Tag:amenity=theatre) |
|
||||
[Q121359](https://www.wikidata.org/entity/Q121359) | Infrastructure | |
|
||||
[Q1248784](https://www.wikidata.org/entity/Q1248784) | Airport | |
|
||||
[Q12323](https://www.wikidata.org/entity/Q12323) | Dam | [waterway=dam](https://wiki.openstreetmap.org/wiki/Tag:waterway=dam) |
|
||||
[Q1353183](https://www.wikidata.org/entity/Q1353183) | Launch pad | |
|
||||
[Q105190](https://www.wikidata.org/entity/Q105190) | Levee | [man_made=dyke](https://wiki.openstreetmap.org/wiki/Tag:man_made=dyke) |
|
||||
[Q105731](https://www.wikidata.org/entity/Q105731) | Lock (water navigation) | [lock=yes](https://wiki.openstreetmap.org/wiki/Key:lock) |
|
||||
[Q44782](https://www.wikidata.org/entity/Q44782) | Port | |
|
||||
[Q159719](https://www.wikidata.org/entity/Q159719) | Power station | [power=plant](https://wiki.openstreetmap.org/wiki/Tag:power=plant) |
|
||||
[Q174814](https://www.wikidata.org/entity/Q174814) | Electrical substation | |
|
||||
[Q134447](https://www.wikidata.org/entity/Q134447) | Nuclear power plant | [plant:source=nuclear](https://wiki.openstreetmap.org/wiki/Tag:plant:source=nuclear) |
|
||||
[Q786014](https://www.wikidata.org/entity/Q786014) | Rest area | [highway=rest_area](https://wiki.openstreetmap.org/wiki/Tag:highway=rest_area), [highway=services](https://wiki.openstreetmap.org/wiki/Tag:highway=services) |
|
||||
[Q12280](https://www.wikidata.org/entity/Q12280) | Bridge | [bridge=* ](https://wiki.openstreetmap.org/wiki/Key:bridge), [man_made=bridge](https://wiki.openstreetmap.org/wiki/Tag:man_made=bridge) |
|
||||
[Q728937](https://www.wikidata.org/entity/Q728937) | Railroad Line | [railway=rail](https://wiki.openstreetmap.org/wiki/Tag:railway=rail) |
|
||||
[Q1311958](https://www.wikidata.org/entity/Q1311958) | Railway Tunnel | |
|
||||
[Q34442](https://www.wikidata.org/entity/Q34442) | Road | [highway=* ](https://wiki.openstreetmap.org/wiki/Key:highway), [route=road](https://wiki.openstreetmap.org/wiki/Tag:route=road) |
|
||||
[Q1788454](https://www.wikidata.org/entity/Q1788454) | Road junction | |
|
||||
[Q44377](https://www.wikidata.org/entity/Q44377) | Tunnel | [tunnel=* ](https://wiki.openstreetmap.org/wiki/Key:tunnel) |
|
||||
[Q5031071](https://www.wikidata.org/entity/Q5031071) | Canal tunnel | |
|
||||
[Q719456](https://www.wikidata.org/entity/Q719456) | Station | [public_transport=station](https://wiki.openstreetmap.org/wiki/Tag:public_transport=station) |
|
||||
[Q205495](https://www.wikidata.org/entity/Q205495) | Filling station | [amenity=fuel](https://wiki.openstreetmap.org/wiki/Tag:amenity=fuel) |
|
||||
[Q928830](https://www.wikidata.org/entity/Q928830) | Metro station | [station=subway](https://wiki.openstreetmap.org/wiki/Tag:station=subway) |
|
||||
[Q55488](https://www.wikidata.org/entity/Q55488) | Train station | [railway=station](https://wiki.openstreetmap.org/wiki/Tag:railway=station) |
|
||||
[Q2175765](https://www.wikidata.org/entity/Q2175765) | Tram stop | [railway=tram_stop](https://wiki.openstreetmap.org/wiki/Tag:railway=tram_stop), [public_transport=stop_position](https://wiki.openstreetmap.org/wiki/Tag:public_transport=stop_position) |
|
||||
[Q6852233](https://www.wikidata.org/entity/Q6852233) | Military building | |
|
||||
[Q44494](https://www.wikidata.org/entity/Q44494) | Mill (grinding) | |
|
||||
[Q185187](https://www.wikidata.org/entity/Q185187) | Watermill | [man_made=watermill](https://wiki.openstreetmap.org/wiki/Tag:man_made=watermill) |
|
||||
[Q38720](https://www.wikidata.org/entity/Q38720) | Windmill | [man_made=windmill](https://wiki.openstreetmap.org/wiki/Tag:man_made=windmill) |
|
||||
[Q4989906](https://www.wikidata.org/entity/Q4989906) | Monument | [historic=monument](https://wiki.openstreetmap.org/wiki/Tag:historic=monument) |
|
||||
[Q5003624](https://www.wikidata.org/entity/Q5003624) | Memorial | [historic=memorial](https://wiki.openstreetmap.org/wiki/Tag:historic=memorial) |
|
||||
[Q271669](https://www.wikidata.org/entity/Q271669) | Landform | |
|
||||
[Q190429](https://www.wikidata.org/entity/Q190429) | Depression (geology) | |
|
||||
[Q17018380](https://www.wikidata.org/entity/Q17018380) | Bight (geography) | |
|
||||
[Q54050](https://www.wikidata.org/entity/Q54050) | Hill | |
|
||||
[Q1210950](https://www.wikidata.org/entity/Q1210950) | Channel (geography) | |
|
||||
[Q23442](https://www.wikidata.org/entity/Q23442) | Island | [place=island](https://wiki.openstreetmap.org/wiki/Tag:place=island) |
|
||||
[Q42523](https://www.wikidata.org/entity/Q42523) | Atoll | |
|
||||
[Q34763](https://www.wikidata.org/entity/Q34763) | Peninsula | |
|
||||
[Q355304](https://www.wikidata.org/entity/Q355304) | Watercourse | |
|
||||
[Q30198](https://www.wikidata.org/entity/Q30198) | Marsh | [wetland=marsh](https://wiki.openstreetmap.org/wiki/Tag:wetland=marsh) |
|
||||
[Q75520](https://www.wikidata.org/entity/Q75520) | Plateau | |
|
||||
[Q2042028](https://www.wikidata.org/entity/Q2042028) | Ravine | |
|
||||
[Q631305](https://www.wikidata.org/entity/Q631305) | Rock formation | |
|
||||
[Q12516](https://www.wikidata.org/entity/Q12516) | Pyramid | |
|
||||
[Q1076486](https://www.wikidata.org/entity/Q1076486) | Sports venue | |
|
||||
[Q682943](https://www.wikidata.org/entity/Q682943) | Cricket field | [sport=cricket](https://wiki.openstreetmap.org/wiki/Tag:sport=cricket) |
|
||||
[Q1048525](https://www.wikidata.org/entity/Q1048525) | Golf course | [leisure=golf_course](https://wiki.openstreetmap.org/wiki/Tag:leisure=golf_course) |
|
||||
[Q1777138](https://www.wikidata.org/entity/Q1777138) | Race track | [highway=raceway](https://wiki.openstreetmap.org/wiki/Tag:highway=raceway) |
|
||||
[Q130003](https://www.wikidata.org/entity/Q130003) | Ski resort | |
|
||||
[Q174782](https://www.wikidata.org/entity/Q174782) | Town square | [place=square](https://wiki.openstreetmap.org/wiki/Tag:place=square) |
|
||||
[Q12518](https://www.wikidata.org/entity/Q12518) | Tower | [building=tower](https://wiki.openstreetmap.org/wiki/Tag:building=tower), [man_made=tower](https://wiki.openstreetmap.org/wiki/Tag:man_made=tower) |
|
||||
[Q39715](https://www.wikidata.org/entity/Q39715) | Lighthouse | [man_made=lighthouse](https://wiki.openstreetmap.org/wiki/Tag:man_made=lighthouse) |
|
||||
[Q274153](https://www.wikidata.org/entity/Q274153) | Water tower | [building=water_tower](https://wiki.openstreetmap.org/wiki/Tag:building=water_tower), [man_made=water_tower](https://wiki.openstreetmap.org/wiki/Tag:man_made=water_tower) |
|
||||
[Q43501](https://www.wikidata.org/entity/Q43501) | Zoo | [tourism=zoo](https://wiki.openstreetmap.org/wiki/Tag:tourism=zoo) |
|
||||
[Q39614](https://www.wikidata.org/entity/Q39614) | Cemetery | [amenity=grave_yard](https://wiki.openstreetmap.org/wiki/Tag:amenity=grave_yard), [landuse=cemetery](https://wiki.openstreetmap.org/wiki/Tag:landuse=cemetery) |
|
||||
[Q152081](https://www.wikidata.org/entity/Q152081) | Concentration camp | |
|
||||
[Q1107656](https://www.wikidata.org/entity/Q1107656) | Garden | [leisure=garden](https://wiki.openstreetmap.org/wiki/Tag:leisure=garden) |
|
||||
[Q820477](https://www.wikidata.org/entity/Q820477) | Mine | |
|
||||
[Q33837](https://www.wikidata.org/entity/Q33837) | Archipelago | [place=archipelago](https://wiki.openstreetmap.org/wiki/Tag:place=archipelago) |
|
||||
[Q40080](https://www.wikidata.org/entity/Q40080) | Beach | [natural=beach](https://wiki.openstreetmap.org/wiki/Tag:natural=beach) |
|
||||
[Q15324](https://www.wikidata.org/entity/Q15324) | Body of water | [natural=water](https://wiki.openstreetmap.org/wiki/Tag:natural=water) |
|
||||
[Q23397](https://www.wikidata.org/entity/Q23397) | Lake | [water=lake](https://wiki.openstreetmap.org/wiki/Tag:water=lake) |
|
||||
[Q9430](https://www.wikidata.org/entity/Q9430) | Ocean | |
|
||||
[Q165](https://www.wikidata.org/entity/Q165) | Sea | |
|
||||
[Q47521](https://www.wikidata.org/entity/Q47521) | Stream | |
|
||||
[Q12284](https://www.wikidata.org/entity/Q12284) | Canal | [waterway=canal](https://wiki.openstreetmap.org/wiki/Tag:waterway=canal) |
|
||||
[Q4022](https://www.wikidata.org/entity/Q4022) | River | [waterway=river](https://wiki.openstreetmap.org/wiki/Tag:waterway=river), [type=waterway](https://wiki.openstreetmap.org/wiki/Relation:waterway) |
|
||||
[Q185113](https://www.wikidata.org/entity/Q185113) | Cape | [natural=cape](https://wiki.openstreetmap.org/wiki/Tag:natural=cape) |
|
||||
[Q35509](https://www.wikidata.org/entity/Q35509) | Cave | [natural=cave_entrance](https://wiki.openstreetmap.org/wiki/Tag:natural=cave_entrance) |
|
||||
[Q8514](https://www.wikidata.org/entity/Q8514) | Desert | |
|
||||
[Q4421](https://www.wikidata.org/entity/Q4421) | Forest | [natural=wood](https://wiki.openstreetmap.org/wiki/Tag:natural=wood) |
|
||||
[Q35666](https://www.wikidata.org/entity/Q35666) | Glacier | [natural=glacier](https://wiki.openstreetmap.org/wiki/Tag:natural=glacier) |
|
||||
[Q177380](https://www.wikidata.org/entity/Q177380) | Hot spring | |
|
||||
[Q8502](https://www.wikidata.org/entity/Q8502) | Mountain | [natural=peak](https://wiki.openstreetmap.org/wiki/Tag:natural=peak) |
|
||||
[Q133056](https://www.wikidata.org/entity/Q133056) | Mountain pass | |
|
||||
[Q46831](https://www.wikidata.org/entity/Q46831) | Mountain range | |
|
||||
[Q39816](https://www.wikidata.org/entity/Q39816) | Valley | [natural=valley](https://wiki.openstreetmap.org/wiki/Tag:natural=valley) |
|
||||
[Q8072](https://www.wikidata.org/entity/Q8072) | Volcano | [natural=volcano](https://wiki.openstreetmap.org/wiki/Tag:natural=volcano) |
|
||||
[Q43229](https://www.wikidata.org/entity/Q43229) | Organization | |
|
||||
[Q327333](https://www.wikidata.org/entity/Q327333) | Government agency | [office=government](https://wiki.openstreetmap.org/wiki/Tag:office=government)|
|
||||
[Q22698](https://www.wikidata.org/entity/Q22698) | Park | [leisure=park](https://wiki.openstreetmap.org/wiki/Tag:leisure=park) |
|
||||
[Q159313](https://www.wikidata.org/entity/Q159313) | Urban agglomeration | |
|
||||
[Q177634](https://www.wikidata.org/entity/Q177634) | Community | |
|
||||
[Q5107](https://www.wikidata.org/entity/Q5107) | Continent | [place=continent](https://wiki.openstreetmap.org/wiki/Tag:place=continent) |
|
||||
[Q6256](https://www.wikidata.org/entity/Q6256) | Country | [place=country](https://wiki.openstreetmap.org/wiki/Tag:place=country) |
|
||||
[Q75848](https://www.wikidata.org/entity/Q75848) | Gated community | |
|
||||
[Q3153117](https://www.wikidata.org/entity/Q3153117) | Intercommunality | |
|
||||
[Q82794](https://www.wikidata.org/entity/Q82794) | Region | |
|
||||
[Q56061](https://www.wikidata.org/entity/Q56061) | Administrative division | [boundary=administrative](https://wiki.openstreetmap.org/wiki/Tag:boundary=administrative) |
|
||||
[Q665487](https://www.wikidata.org/entity/Q665487) | Diocese | |
|
||||
[Q4976993](https://www.wikidata.org/entity/Q4976993) | Parish | [boundary=civil_parish](https://wiki.openstreetmap.org/wiki/Tag:boundary=civil_parish) |
|
||||
[Q194203](https://www.wikidata.org/entity/Q194203) | Arrondissements of France | |
|
||||
[Q91028](https://www.wikidata.org/entity/Q91028) | Arrondissements of Belgium | |
|
||||
[Q3623867](https://www.wikidata.org/entity/Q3623867) | Arrondissements of Benin | |
|
||||
[Q2311958](https://www.wikidata.org/entity/Q2311958) | Canton (country subdivision) | [political_division=canton](https://wiki.openstreetmap.org/wiki/FR:Cantons_in_France) |
|
||||
[Q643589](https://www.wikidata.org/entity/Q643589) | Department | |
|
||||
[Q202216](https://www.wikidata.org/entity/Q202216) | Overseas department and region | |
|
||||
[Q149621](https://www.wikidata.org/entity/Q149621) | District | [place=district](https://wiki.openstreetmap.org/wiki/Tag:place=district) |
|
||||
[Q15243209](https://www.wikidata.org/wiki/Q15243209) | Historic district | |
|
||||
[Q5144960](https://www.wikidata.org/entity/Q5144960) | Microregion | |
|
||||
[Q15284](https://www.wikidata.org/entity/Q15284) | Municipality | |
|
||||
[Q515716](https://www.wikidata.org/entity/Q515716) | Prefecture | |
|
||||
[Q34876](https://www.wikidata.org/entity/Q34876) | Province | |
|
||||
[Q3191695](https://www.wikidata.org/entity/Q3191695) | Regency (Indonesia) | |
|
||||
[Q1970725](https://www.wikidata.org/entity/Q1970725) | Natural region | |
|
||||
[Q486972](https://www.wikidata.org/entity/Q486972) | Human settlement | |
|
||||
[Q515](https://www.wikidata.org/entity/Q515) | City | [place=city](https://wiki.openstreetmap.org/wiki/Tag:place=city) |
|
||||
[Q5119](https://www.wikidata.org/entity/Q5119) | Capital city | [capital=yes](https://wiki.openstreetmap.org/wiki/Key:capital) |
|
||||
[Q4286337](https://www.wikidata.org/entity/Q4286337) | City district | |
|
||||
[Q1394476](https://www.wikidata.org/entity/Q1394476) | Civil township | |
|
||||
[Q1115575](https://www.wikidata.org/entity/Q1115575) | Civil parish | [designation=civil_parish](https://wiki.openstreetmap.org/wiki/Tag:designation=civil_parish) |
|
||||
[Q5153984](https://www.wikidata.org/entity/Q5153984) | Commune-level subdivisions | |
|
||||
[Q123705](https://www.wikidata.org/entity/Q123705) | Neighbourhood | [place=neighbourhood](https://wiki.openstreetmap.org/wiki/Tag:place=neighbourhood) |
|
||||
[Q1500350](https://www.wikidata.org/entity/Q1500350) | Townships of China | |
|
||||
[Q17343829](https://www.wikidata.org/entity/Q17343829) | Unincorporated Community | |
|
||||
[Q3957](https://www.wikidata.org/entity/Q3957) | Town | [place=town](https://wiki.openstreetmap.org/wiki/Tag:place=town) |
|
||||
[Q532](https://www.wikidata.org/entity/Q532) | Village | [place=village](https://wiki.openstreetmap.org/wiki/Tag:place=village) |
|
||||
[Q5084](https://www.wikidata.org/entity/Q5084) | Hamlet | [place=hamlet](https://wiki.openstreetmap.org/wiki/Tag:place=hamlet) |
|
||||
[Q7275](https://www.wikidata.org/entity/Q7275) | State | |
|
||||
[Q79007](https://www.wikidata.org/entity/Q79007) | Street | |
|
||||
[Q473972](https://www.wikidata.org/entity/Q473972) | Protected area | [boundary=protected_area](https://wiki.openstreetmap.org/wiki/Tag:boundary=protected_area) |
|
||||
[Q1377575](https://www.wikidata.org/entity/Q1377575) | Wildlife refuge | |
|
||||
[Q1410668](https://www.wikidata.org/entity/Q1410668) | National Wildlife Refuge | [protection_title=National Wildlife Refuge](ownership=national), [ownership=national](https://wiki.openstreetmap.org/wiki/Tag:ownership=national)|
|
||||
[Q9259](https://www.wikidata.org/entity/Q9259) | World Heritage Site | |
|
||||
|
||||
---
|
||||
|
||||
### Future Work
|
||||
|
||||
The Wikidata improvements to Nominatim can be further enhanced by:
|
||||
|
||||
- continuing to add new Wikidata links to OSM objects
|
||||
- increasing the number of place types accounted for in the wikipedia_articles table
|
||||
- working to use place types in the wikipedia_article matching process
|
||||
File diff suppressed because one or more lines are too long
@@ -1,26 +0,0 @@
|
||||
-- This data contains Ordnance Survey data © Crown copyright and database right 2010.
|
||||
-- Code-Point Open contains Royal Mail data © Royal Mail copyright and database right 2010.
|
||||
-- OS data may be used under the terms of the OS OpenData licence:
|
||||
-- http://www.ordnancesurvey.co.uk/oswebsite/opendata/licence/docs/licence.pdf
|
||||
|
||||
SET statement_timeout = 0;
|
||||
SET client_encoding = 'UTF8';
|
||||
SET standard_conforming_strings = off;
|
||||
SET check_function_bodies = false;
|
||||
SET client_min_messages = warning;
|
||||
SET escape_string_warning = off;
|
||||
|
||||
SET search_path = public, pg_catalog;
|
||||
|
||||
SET default_tablespace = '';
|
||||
|
||||
SET default_with_oids = false;
|
||||
|
||||
CREATE TABLE gb_postcode (
|
||||
id integer,
|
||||
postcode character varying(9),
|
||||
geometry geometry,
|
||||
CONSTRAINT enforce_dims_geometry CHECK ((st_ndims(geometry) = 2)),
|
||||
CONSTRAINT enforce_srid_geometry CHECK ((st_srid(geometry) = 4326))
|
||||
);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
SET statement_timeout = 0;
|
||||
SET client_encoding = 'UTF8';
|
||||
SET check_function_bodies = false;
|
||||
SET client_min_messages = warning;
|
||||
|
||||
SET search_path = public, pg_catalog;
|
||||
|
||||
SET default_tablespace = '';
|
||||
|
||||
SET default_with_oids = false;
|
||||
|
||||
CREATE TABLE us_postcode (
|
||||
postcode text,
|
||||
x double precision,
|
||||
y double precision
|
||||
);
|
||||
@@ -29787,7 +29787,7 @@ st 5557484
|
||||
|
||||
-- prefill word table
|
||||
|
||||
select count(make_keywords(v)) from (select distinct svals(name) as v from place) as w where v is not null;
|
||||
select count(precompute_words(v)) from (select distinct svals(name) as v from place) as w where v is not null;
|
||||
select count(getorcreate_housenumber_id(make_standard_name(v))) from (select distinct address->'housenumber' as v from place where address ? 'housenumber') as w;
|
||||
|
||||
-- copy the word frequencies
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# Auto-generated vagrant install documentation
|
||||
|
||||
|
||||
# build the actual documentation
|
||||
|
||||
configure_file(mkdocs.yml ../mkdocs.yml)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/appendix)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data-sources)
|
||||
|
||||
set (DOC_SOURCES
|
||||
admin
|
||||
develop
|
||||
api
|
||||
index.md
|
||||
extra.css
|
||||
styles.css
|
||||
data-sources/overview.md
|
||||
)
|
||||
|
||||
foreach (src ${DOC_SOURCES})
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${CMAKE_CURRENT_BINARY_DIR}/${src}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/data-sources/us-tiger/README.md ${CMAKE_CURRENT_BINARY_DIR}/data-sources/US-Tiger.md
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/data-sources/gb-postcodes/README.md ${CMAKE_CURRENT_BINARY_DIR}/data-sources/GB-Postcodes.md
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/data-sources/country-grid/README.md ${CMAKE_CURRENT_BINARY_DIR}/data-sources/Country-Grid.md
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/data-sources/country-grid/mexico.quad.png ${CMAKE_CURRENT_BINARY_DIR}/data-sources/mexico.quad.png
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_SOURCE_DIR}/data-sources/wikipedia-wikidata/README.md ${CMAKE_CURRENT_BINARY_DIR}/data-sources/Wikipedia-Wikidata.md
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(doc
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bash2md.sh ${PROJECT_SOURCE_DIR}/vagrant/Install-on-Centos-7.sh ${CMAKE_CURRENT_BINARY_DIR}/appendix/Install-on-Centos-7.md
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bash2md.sh ${PROJECT_SOURCE_DIR}/vagrant/Install-on-Centos-8.sh ${CMAKE_CURRENT_BINARY_DIR}/appendix/Install-on-Centos-8.md
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bash2md.sh ${PROJECT_SOURCE_DIR}/vagrant/Install-on-Ubuntu-18.sh ${CMAKE_CURRENT_BINARY_DIR}/appendix/Install-on-Ubuntu-18.md
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bash2md.sh ${PROJECT_SOURCE_DIR}/vagrant/Install-on-Ubuntu-20.sh ${CMAKE_CURRENT_BINARY_DIR}/appendix/Install-on-Ubuntu-20.md
|
||||
COMMAND mkdocs build -d ${CMAKE_CURRENT_BINARY_DIR}/../site-html -f ${CMAKE_CURRENT_BINARY_DIR}/../mkdocs.yml
|
||||
)
|
||||
|
||||
|
||||
@@ -5,105 +5,240 @@ your Nominatim database. It is assumed that you have already successfully
|
||||
installed the Nominatim software itself, if not return to the
|
||||
[installation page](Installation.md).
|
||||
|
||||
## Importing multiple regions
|
||||
## Importing with a database user without superuser rights
|
||||
|
||||
To import multiple regions in your database, you need to configure and run `utils/import_multiple_regions.sh` file. This script will set up the update directory which has the following structure:
|
||||
Nominatim usually creates its own PostgreSQL database at the beginning of the
|
||||
import process. This makes usage easier for the user but means that the
|
||||
database user doing the import needs the appropriate rights.
|
||||
|
||||
If you prefer to run the import with a database user with limited rights,
|
||||
you can do so by changing the import process as follows:
|
||||
|
||||
1. Run the command for database preparation with a database user with
|
||||
superuser rights. For example, to use a db user 'dbadmin' for a
|
||||
database 'nominatim', execute:
|
||||
|
||||
```
|
||||
NOMINATIM_DATABASE_DSN="pgsql:dbname=nominatim;user=dbadmin" nominatim import --prepare-database
|
||||
```
|
||||
|
||||
2. Grant the import user the right to create tables. For example, foe user 'import-user':
|
||||
|
||||
```
|
||||
psql -d nominatim -c 'GRANT CREATE ON SCHEMA public TO "import-user"'
|
||||
```
|
||||
|
||||
3. Now run the reminder of the import with the import user:
|
||||
|
||||
```
|
||||
NOMINATIM_DATABASE_DSN="pgsql:dbname=nominatim;user=import-user" nominatim import --continue import-from-file --osm-file file.pbf
|
||||
```
|
||||
|
||||
## Importing multiple regions (without updates)
|
||||
|
||||
To import multiple regions in your database you can simply give multiple
|
||||
OSM files to the import command:
|
||||
|
||||
```
|
||||
nominatim import --osm-file file1.pbf --osm-file file2.pbf
|
||||
```
|
||||
|
||||
If you already have imported a file and want to add another one, you can
|
||||
use the add-data function to import the additional data as follows:
|
||||
|
||||
```
|
||||
nominatim add-data --file <FILE>
|
||||
nominatim refresh --postcodes
|
||||
nominatim index -j <NUMBER OF THREADS>
|
||||
```
|
||||
|
||||
Please note that adding additional data is always significantly slower than
|
||||
the original import.
|
||||
|
||||
## Importing multiple regions (with updates)
|
||||
|
||||
If you want to import multiple regions _and_ be able to keep them up-to-date
|
||||
with updates, then you can use the scripts provided in the `utils` directory.
|
||||
|
||||
These scripts will set up an `update` directory in your project directory,
|
||||
which has the following structure:
|
||||
|
||||
```bash
|
||||
update
|
||||
├── europe
|
||||
│ ├── andorra
|
||||
│ │ └── sequence.state
|
||||
│ └── monaco
|
||||
│ └── sequence.state
|
||||
└── tmp
|
||||
├── combined.osm.pbf
|
||||
└── europe
|
||||
├── andorra-latest.osm.pbf
|
||||
└── monaco-latest.osm.pbf
|
||||
|
||||
├── europe
|
||||
│ ├── andorra
|
||||
│ │ └── sequence.state
|
||||
│ └── monaco
|
||||
│ └── sequence.state
|
||||
└── tmp
|
||||
└── europe
|
||||
├── andorra-latest.osm.pbf
|
||||
└── monaco-latest.osm.pbf
|
||||
|
||||
```
|
||||
|
||||
The `sequence.state` files will contain the sequence ID, which will be used by pyosmium to get updates. The tmp folder is used for import dump.
|
||||
The `sequence.state` files contain the sequence ID for each region. They will
|
||||
be used by pyosmium to get updates. The `tmp` folder is used for import dump and
|
||||
can be deleted once the import is complete.
|
||||
|
||||
### Configuring multiple regions
|
||||
|
||||
The file `import_multiple_regions.sh` needs to be edited as per your requirement:
|
||||
|
||||
1. List of countries. eg:
|
||||
|
||||
COUNTRIES="europe/monaco europe/andorra"
|
||||
|
||||
2. Path to Build directory. eg:
|
||||
|
||||
NOMINATIMBUILD="/srv/nominatim/build"
|
||||
|
||||
3. Path to Update directory. eg:
|
||||
|
||||
UPDATEDIR="/srv/nominatim/update"
|
||||
|
||||
4. Replication URL. eg:
|
||||
|
||||
BASEURL="https://download.geofabrik.de"
|
||||
DOWNCOUNTRYPOSTFIX="-latest.osm.pbf"
|
||||
|
||||
!!! tip
|
||||
If your database already exists and you want to add more countries, replace the setting up part
|
||||
`${SETUPFILE} --osm-file ${UPDATEDIR}/tmp/combined.osm.pbf --all 2>&1`
|
||||
with `${UPDATEFILE} --import-file ${UPDATEDIR}/tmp/combined.osm.pbf 2>&1`.
|
||||
|
||||
### Setting up multiple regions
|
||||
|
||||
Run the following command from your Nominatim directory after configuring the file.
|
||||
Create a project directory as described for the
|
||||
[simple import](Import.md#creating-the-project-directory). If necessary,
|
||||
you can also add an `.env` configuration with customized options. In particular,
|
||||
you need to make sure that `NOMINATIM_REPLICATION_UPDATE_INTERVAL` and
|
||||
`NOMINATIM_REPLICATION_RECHECK_INTERVAL` are set according to the update
|
||||
interval of the extract server you use.
|
||||
|
||||
bash ./utils/import_multiple_regions.sh
|
||||
Copy the scripts `utils/import_multiple_regions.sh` and `utils/update_database.sh`
|
||||
into the project directory.
|
||||
|
||||
!!! danger "Important"
|
||||
This file uses osmium-tool. It must be installed before executing the import script.
|
||||
Installation instructions can be found [here](https://osmcode.org/osmium-tool/manual.html#installation).
|
||||
Now customize both files as per your requirements
|
||||
|
||||
## Updating multiple regions
|
||||
|
||||
To import multiple regions in your database, you need to configure and run ```utils/update_database.sh```.
|
||||
This uses the update directory set up while setting up the DB.
|
||||
|
||||
### Configuring multiple regions
|
||||
|
||||
The file `update_database.sh` needs to be edited as per your requirement:
|
||||
|
||||
1. List of countries. eg:
|
||||
1. List of countries. e.g.
|
||||
|
||||
COUNTRIES="europe/monaco europe/andorra"
|
||||
|
||||
2. Path to Build directory. eg:
|
||||
2. URL to the service providing the extracts and updates. eg:
|
||||
|
||||
NOMINATIMBUILD="/srv/nominatim/build"
|
||||
|
||||
3. Path to Update directory. eg:
|
||||
|
||||
UPDATEDIR="/srv/nominatim/update"
|
||||
|
||||
4. Replication URL. eg:
|
||||
|
||||
BASEURL="https://download.geofabrik.de"
|
||||
DOWNCOUNTRYPOSTFIX="-updates"
|
||||
DOWNCOUNTRYPOSTFIX="-latest.osm.pbf"
|
||||
|
||||
5. Followup can be set according to your installation. eg: For Photon,
|
||||
5. Followup in the update script can be set according to your installation.
|
||||
E.g. for Photon,
|
||||
|
||||
FOLLOWUP="curl http://localhost:2322/nominatim-update"
|
||||
|
||||
will handle the indexing.
|
||||
|
||||
|
||||
To start the initial import, change into the project directory and run
|
||||
|
||||
```
|
||||
bash import_multiple_regions.sh
|
||||
```
|
||||
|
||||
### Updating the database
|
||||
|
||||
Run the following command from your Nominatim directory after configuring the file.
|
||||
Change into the project directory and run the following command:
|
||||
|
||||
bash ./utils/update_database.sh
|
||||
bash update_database.sh
|
||||
|
||||
This will get diffs from the replication server, import diffs and index the database. The default replication server in the script([Geofabrik](https://download.geofabrik.de)) provides daily updates.
|
||||
This will get diffs from the replication server, import diffs and index
|
||||
the database. The default replication server in the
|
||||
script ([Geofabrik](https://download.geofabrik.de)) provides daily updates.
|
||||
|
||||
## Verification and further setup
|
||||
## Using an external PostgreSQL database
|
||||
|
||||
Instructions for import verification and other details like importing Wikidata can be found in [import and update page](Import-and-Update.md)
|
||||
You can install Nominatim using a database that runs on a different server when
|
||||
you have physical access to the file system on the other server. Nominatim
|
||||
uses a custom normalization library that needs to be made accessible to the
|
||||
PostgreSQL server. This section explains how to set up the normalization
|
||||
library.
|
||||
|
||||
!!! note
|
||||
The external module is only needed when using the legacy tokenizer.
|
||||
If you have chosen the ICU tokenizer, then you can ignore this section
|
||||
and follow the standard import documentation.
|
||||
|
||||
### Option 1: Compiling the library on the database server
|
||||
|
||||
The most sure way to get a working library is to compile it on the database
|
||||
server. From the prerequisites you need at least cmake, gcc and the
|
||||
PostgreSQL server package.
|
||||
|
||||
Clone or unpack the Nominatim source code, enter the source directory and
|
||||
create and enter a build directory.
|
||||
|
||||
```sh
|
||||
cd Nominatim
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
|
||||
Now configure cmake to only build the PostgreSQL module and build it:
|
||||
|
||||
```
|
||||
cmake -DBUILD_IMPORTER=off -DBUILD_API=off -DBUILD_TESTS=off -DBUILD_DOCS=off -DBUILD_OSM2PGSQL=off ..
|
||||
make
|
||||
```
|
||||
|
||||
When done, you find the normalization library in `build/module/nominatim.so`.
|
||||
Copy it to a place where it is readable and executable by the PostgreSQL server
|
||||
process.
|
||||
|
||||
### Option 2: Compiling the library on the import machine
|
||||
|
||||
You can also compile the normalization library on the machine from where you
|
||||
run the import.
|
||||
|
||||
!!! important
|
||||
You can only do this when the database server and the import machine have
|
||||
the same architecture and run the same version of Linux. Otherwise there is
|
||||
no guarantee that the compiled library is compatible with the PostgreSQL
|
||||
server running on the database server.
|
||||
|
||||
Make sure that the PostgreSQL server package is installed on the machine
|
||||
**with the same version as on the database server**. You do not need to install
|
||||
the PostgreSQL server itself.
|
||||
|
||||
Download and compile Nominatim as per standard instructions. Once done, you find
|
||||
the normalization library in `build/module/nominatim.so`. Copy the file to
|
||||
the database server at a location where it is readable and executable by the
|
||||
PostgreSQL server process.
|
||||
|
||||
### Running the import
|
||||
|
||||
On the client side you now need to configure the import to point to the
|
||||
correct location of the library **on the database server**. Add the following
|
||||
line to your your `.env` file:
|
||||
|
||||
```php
|
||||
NOMINATIM_DATABASE_MODULE_PATH="<directory on the database server where nominatim.so resides>"
|
||||
```
|
||||
|
||||
Now change the `NOMINATIM_DATABASE_DSN` to point to your remote server and continue
|
||||
to follow the [standard instructions for importing](Import.md).
|
||||
|
||||
|
||||
## Moving the database to another machine
|
||||
|
||||
For some configurations it may be useful to run the import on one machine, then
|
||||
move the database to another machine and run the Nominatim service from there.
|
||||
For example, you might want to use a large machine to be able to run the import
|
||||
quickly but only want a smaller machine for production because there is not so
|
||||
much load. Or you might want to do the import once and then replicate the
|
||||
database to many machines.
|
||||
|
||||
The important thing to keep in mind when transferring the Nominatim installation
|
||||
is that you need to transfer the database _and the project directory_. Both
|
||||
parts are essential for your installation.
|
||||
|
||||
The Nominatim database can be transferred using the `pg_dump`/`pg_restore` tool.
|
||||
Make sure to use the same version of PostgreSQL and PostGIS on source and
|
||||
target machine.
|
||||
|
||||
!!! note
|
||||
Before creating a dump of your Nominatim database, consider running
|
||||
`nominatim freeze` first. Your database looses the ability to receive further
|
||||
data updates but the resulting database is only about a third of the size
|
||||
of a full database.
|
||||
|
||||
Next install Nominatim on the target machine by following the standard installation
|
||||
instructions. Again, make sure to use the same version as the source machine.
|
||||
|
||||
Create a project directory on your destination machine and set up the `.env`
|
||||
file to match the configuration on the source machine. Finally run
|
||||
|
||||
nominatim refresh --website
|
||||
|
||||
to make sure that the local installation of Nominatim will be used.
|
||||
|
||||
If you are using the legacy tokenizer you might also have to switch to the
|
||||
PostgreSQL module that was compiled on your target machine. If you get errors
|
||||
that PostgreSQL cannot find or access `nominatim.so` then rerun
|
||||
|
||||
nominatim refresh --functions
|
||||
|
||||
on the target machine to update the the location of the module.
|
||||
|
||||
151
docs/admin/Deployment-PHP.md
Normal file
151
docs/admin/Deployment-PHP.md
Normal file
@@ -0,0 +1,151 @@
|
||||
# Deploying Nominatim using the PHP frontend
|
||||
|
||||
!!! danger
|
||||
The PHP frontend is deprecated and will be removed in Nominatim 5.0.
|
||||
|
||||
The Nominatim API is implemented as a PHP application. The `website/` directory
|
||||
in the project directory contains the configured website. You can serve this
|
||||
in a production environment with any web server that is capable to run
|
||||
PHP scripts.
|
||||
|
||||
This section gives a quick overview on how to configure Apache and Nginx to
|
||||
serve Nominatim. It is not meant as a full system administration guide on how
|
||||
to run a web service. Please refer to the documentation of
|
||||
[Apache](https://httpd.apache.org/docs/current/) and
|
||||
[Nginx](https://nginx.org/en/docs/)
|
||||
for background information on configuring the services.
|
||||
|
||||
!!! Note
|
||||
Throughout this page, we assume your Nominatim project directory is
|
||||
located in `/srv/nominatim-project` and you have installed Nominatim
|
||||
using the default installation prefix `/usr/local`. If you have put it
|
||||
somewhere else, you need to adjust the commands and configuration
|
||||
accordingly.
|
||||
|
||||
We further assume that your web server runs as user `www-data`. Older
|
||||
versions of CentOS may still use the user name `apache`. You also need
|
||||
to adapt the instructions in this case.
|
||||
|
||||
## Making the website directory accessible
|
||||
|
||||
You need to make sure that the `website` directory is accessible for the
|
||||
web server user. You can check that the permissions are correct by accessing
|
||||
on of the php files as the web server user:
|
||||
|
||||
``` sh
|
||||
sudo -u www-data head -n 1 /srv/nominatim-project/website/search.php
|
||||
```
|
||||
|
||||
If this shows a permission error, then you need to adapt the permissions of
|
||||
each directory in the path so that it is executable for `www-data`.
|
||||
|
||||
If you have SELinux enabled, further adjustments may be necessary to give the
|
||||
web server access. At a minimum the following SELinux labelling should be done
|
||||
for Nominatim:
|
||||
|
||||
``` sh
|
||||
sudo semanage fcontext -a -t httpd_sys_content_t "/usr/local/nominatim/lib/lib-php(/.*)?"
|
||||
sudo semanage fcontext -a -t httpd_sys_content_t "/srv/nominatim-project/website(/.*)?"
|
||||
sudo semanage fcontext -a -t lib_t "/srv/nominatim-project/module/nominatim.so"
|
||||
sudo restorecon -R -v /usr/local/lib/nominatim
|
||||
sudo restorecon -R -v /srv/nominatim-project
|
||||
```
|
||||
|
||||
## Nominatim with Apache
|
||||
|
||||
### Installing the required packages
|
||||
|
||||
With Apache you can use the PHP module to run Nominatim.
|
||||
|
||||
Under Ubuntu/Debian install them with:
|
||||
|
||||
``` sh
|
||||
sudo apt install apache2 libapache2-mod-php
|
||||
```
|
||||
|
||||
### Configuring Apache
|
||||
|
||||
Make sure your Apache configuration contains the required permissions for the
|
||||
directory and create an alias:
|
||||
|
||||
``` apache
|
||||
<Directory "/srv/nominatim-project/website">
|
||||
Options FollowSymLinks MultiViews
|
||||
AddType text/html .php
|
||||
DirectoryIndex search.php
|
||||
Require all granted
|
||||
</Directory>
|
||||
Alias /nominatim /srv/nominatim-project/website
|
||||
```
|
||||
|
||||
After making changes in the apache config you need to restart apache.
|
||||
The website should now be available on `http://localhost/nominatim`.
|
||||
|
||||
## Nominatim with Nginx
|
||||
|
||||
### Installing the required packages
|
||||
|
||||
Nginx has no built-in PHP interpreter. You need to use php-fpm as a daemon for
|
||||
serving PHP cgi.
|
||||
|
||||
On Ubuntu/Debian install nginx and php-fpm with:
|
||||
|
||||
``` sh
|
||||
sudo apt install nginx php-fpm
|
||||
```
|
||||
|
||||
### Configure php-fpm and Nginx
|
||||
|
||||
By default php-fpm listens on a network socket. If you want it to listen to a
|
||||
Unix socket instead, change the pool configuration
|
||||
(`/etc/php/<php version>/fpm/pool.d/www.conf`) as follows:
|
||||
|
||||
``` ini
|
||||
; Replace the tcp listener and add the unix socket
|
||||
listen = /var/run/php-fpm-nominatim.sock
|
||||
|
||||
; Ensure that the daemon runs as the correct user
|
||||
listen.owner = www-data
|
||||
listen.group = www-data
|
||||
listen.mode = 0666
|
||||
```
|
||||
|
||||
Tell nginx that php files are special and to fastcgi_pass to the php-fpm
|
||||
unix socket by adding the location definition to the default configuration.
|
||||
|
||||
``` nginx
|
||||
root /srv/nominatim-project/website;
|
||||
index search.php;
|
||||
location / {
|
||||
try_files $uri $uri/ @php;
|
||||
}
|
||||
|
||||
location @php {
|
||||
fastcgi_param SCRIPT_FILENAME "$document_root$uri.php";
|
||||
fastcgi_param PATH_TRANSLATED "$document_root$uri.php";
|
||||
fastcgi_param QUERY_STRING $args;
|
||||
fastcgi_pass unix:/var/run/php-fpm-nominatim.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
if (!-f $document_root$fastcgi_script_name) {
|
||||
return 404;
|
||||
}
|
||||
fastcgi_pass unix:/var/run/php-fpm-nominatim.sock;
|
||||
fastcgi_index search.php;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
```
|
||||
|
||||
Restart the nginx and php-fpm services and the website should now be available
|
||||
at `http://localhost/`.
|
||||
|
||||
## Nominatim with other webservers
|
||||
|
||||
Users have created instructions for other webservers:
|
||||
|
||||
* [Caddy](https://github.com/osm-search/Nominatim/discussions/2580)
|
||||
|
||||
148
docs/admin/Deployment-Python.md
Normal file
148
docs/admin/Deployment-Python.md
Normal file
@@ -0,0 +1,148 @@
|
||||
# Deploying the Nominatim Python frontend
|
||||
|
||||
Nominatim can be run as a Python-based
|
||||
[ASGI web application](https://asgi.readthedocs.io/en/latest/). You have the
|
||||
choice between [Falcon](https://falcon.readthedocs.io/en/stable/)
|
||||
and [Starlette](https://www.starlette.io/) as the ASGI framework.
|
||||
|
||||
This section gives a quick overview on how to configure Nginx to serve
|
||||
Nominatim. Please refer to the documentation of
|
||||
[Nginx](https://nginx.org/en/docs/) for background information on how
|
||||
to configure it.
|
||||
|
||||
!!! Note
|
||||
Throughout this page, we assume your Nominatim project directory is
|
||||
located in `/srv/nominatim-project`. If you have put it somewhere else,
|
||||
you need to adjust the commands and configuration accordingly.
|
||||
|
||||
|
||||
### Installing the required packages
|
||||
|
||||
The Nominatim frontend is best run from its own virtual environment. If
|
||||
you have already created one for the database backend during the
|
||||
[installation](Installation.md#building-nominatim), you can use that. Otherwise
|
||||
create one now with:
|
||||
|
||||
```sh
|
||||
sudo apt-get install virtualenv
|
||||
virtualenv /srv/nominatim-venv
|
||||
```
|
||||
|
||||
The Nominatim frontend is contained in the 'nominatim-api' package. To
|
||||
install directly from the source tree run:
|
||||
|
||||
```sh
|
||||
cd Nominatim
|
||||
/srv/nominatim-venv/bin/pip install packaging/nominatim-api
|
||||
```
|
||||
|
||||
The recommended way to deploy a Python ASGI application is to run
|
||||
the ASGI runner [uvicorn](https://uvicorn.org/)
|
||||
together with [gunicorn](https://gunicorn.org/) HTTP server. We use
|
||||
Falcon here as the web framework.
|
||||
|
||||
Add the necessary packages to your virtual environment:
|
||||
|
||||
``` sh
|
||||
/srv/nominatim-venv/bin/pip install falcon uvicorn gunicorn
|
||||
```
|
||||
|
||||
### Setting up Nominatim as a systemd job
|
||||
|
||||
Next you need to set up the service that runs the Nominatim frontend. This is
|
||||
easiest done with a systemd job.
|
||||
|
||||
First you need to tell systemd to create a socket file to be used by
|
||||
hunicorn. Create the following file `/etc/systemd/system/nominatim.socket`:
|
||||
|
||||
``` systemd
|
||||
[Unit]
|
||||
Description=Gunicorn socket for Nominatim
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/nominatim.sock
|
||||
SocketUser=www-data
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Now you can add the systemd service for Nominatim itself.
|
||||
Create the following file `/etc/systemd/system/nominatim.service`:
|
||||
|
||||
``` systemd
|
||||
[Unit]
|
||||
Description=Nominatim running as a gunicorn application
|
||||
After=network.target
|
||||
Requires=nominatim.socket
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=www-data
|
||||
Group=www-data
|
||||
WorkingDirectory=/srv/nominatim-project
|
||||
ExecStart=/srv/nominatim-venv/bin/gunicorn -b unix:/run/nominatim.sock -w 4 -k uvicorn.workers.UvicornWorker nominatim_api.server.falcon.server:run_wsgi
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
StandardOutput=append:/var/log/gunicorn-nominatim.log
|
||||
StandardError=inherit
|
||||
PrivateTmp=true
|
||||
TimeoutStopSec=5
|
||||
KillMode=mixed
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
This sets up gunicorn with 4 workers (`-w 4` in ExecStart). Each worker runs
|
||||
its own Python process using
|
||||
[`NOMINATIM_API_POOL_SIZE`](../customize/Settings.md#nominatim_api_pool_size)
|
||||
connections to the database to serve requests in parallel.
|
||||
|
||||
Make the new services known to systemd and start it:
|
||||
|
||||
``` sh
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable nominatim.socket
|
||||
sudo systemctl start nominatim.socket
|
||||
sudo systemctl enable nominatim.service
|
||||
sudo systemctl start nominatim.service
|
||||
```
|
||||
|
||||
This sets the service up, so that Nominatim is automatically started
|
||||
on reboot.
|
||||
|
||||
### Configuring nginx
|
||||
|
||||
To make the service available to the world, you need to proxy it through
|
||||
nginx. Add the following definition to the default configuration:
|
||||
|
||||
``` nginx
|
||||
upstream nominatim_service {
|
||||
server unix:/run/nominatim.sock fail_timeout=0;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
root /var/www/html;
|
||||
index /search;
|
||||
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_redirect off;
|
||||
proxy_pass http://nominatim_service;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reload nginx with
|
||||
|
||||
```
|
||||
sudo systemctl reload nginx
|
||||
```
|
||||
|
||||
and you should be able to see the status of your server under
|
||||
`http://localhost/status`.
|
||||
@@ -16,46 +16,27 @@ was killed. If it looks like this:
|
||||
then you can resume with the following command:
|
||||
|
||||
```sh
|
||||
./utils/setup.php --index --create-search-indices --create-country-names
|
||||
nominatim import --continue indexing
|
||||
```
|
||||
|
||||
If the reported rank is 26 or higher, you can also safely add `--index-noanalyse`.
|
||||
|
||||
|
||||
### PHP "open_basedir restriction in effect" warnings
|
||||
### PostgreSQL crashed "invalid page in block"
|
||||
|
||||
PHP Warning: file_get_contents(): open_basedir restriction in effect.
|
||||
Usually serious problem, can be a hardware issue, not all data written to disc
|
||||
for example. Check PostgreSQL log file and search PostgreSQL issues/mailing
|
||||
list for hints.
|
||||
|
||||
You need to adjust the
|
||||
[open_basedir](https://www.php.net/manual/en/ini.core.php#ini.open-basedir)
|
||||
setting in your PHP configuration (`php.ini` file). By default this setting may
|
||||
look like this:
|
||||
|
||||
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/
|
||||
|
||||
Either add reported directories to the list or disable this setting temporarily
|
||||
by adding ";" at the beginning of the line. Don't forget to enable this setting
|
||||
again once you are done with the PHP command line operations.
|
||||
|
||||
|
||||
### PHP timzeone warnings
|
||||
|
||||
The Apache log may contain lots of PHP warnings like this:
|
||||
`PHP Warning: date_default_timezone_set() function.`
|
||||
|
||||
You should set the default time zone as instructed in the warning in
|
||||
your `php.ini` file. Find the entry about timezone and set it to
|
||||
something like this:
|
||||
|
||||
; Defines the default timezone used by the date functions
|
||||
; https://php.net/date.timezone
|
||||
date.timezone = 'America/Denver'
|
||||
|
||||
Or
|
||||
If it happened during index creation you can try rerunning the step with
|
||||
|
||||
```sh
|
||||
nominatim import --continue indexing
|
||||
```
|
||||
echo "date.timezone = 'America/Denver'" > /etc/php.d/timezone.ini
|
||||
```
|
||||
|
||||
Otherwise it's best to start the full setup from the beginning.
|
||||
|
||||
|
||||
|
||||
### nominatim.so version mismatch
|
||||
|
||||
@@ -64,7 +45,7 @@ When running the import you may get a version mismatch:
|
||||
|
||||
pg_config seems to use bad includes sometimes when multiple versions
|
||||
of PostgreSQL are available in the system. Make sure you remove the
|
||||
server development libraries (`postgresql-server-dev-9.5` on Ubuntu)
|
||||
server development libraries (`postgresql-server-dev-13` on Ubuntu)
|
||||
and recompile (`cmake .. && make`).
|
||||
|
||||
|
||||
@@ -78,7 +59,7 @@ on a non-managed machine.
|
||||
|
||||
### I see the error: "function transliteration(text) does not exist"
|
||||
|
||||
Reinstall the nominatim functions with `setup.php --create--functions`
|
||||
Reinstall the nominatim functions with `nominatim refresh --functions`
|
||||
and check for any errors, e.g. a missing `nominatim.so` file.
|
||||
|
||||
### I see the error: "ERROR: mmap (remap) failed"
|
||||
@@ -91,14 +72,10 @@ If you are using a flatnode file, then it may also be that the underlying
|
||||
filesystem does not fully support 'mmap'. A notable candidate is virtualbox's
|
||||
vboxfs.
|
||||
|
||||
### I see the error: "clang: Command not found" on CentOS
|
||||
|
||||
On CentOS 7 users reported `/opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found`.
|
||||
Double-check clang is installed. Instead of `make` try running `make CLANG=true`.
|
||||
|
||||
### nominatim UPDATE failed: ERROR: buffer 179261 is not owned by resource owner Portal
|
||||
|
||||
Several users [reported this](https://github.com/openstreetmap/Nominatim/issues/1168) during the initial import of the database. It's
|
||||
Several users [reported this](https://github.com/openstreetmap/Nominatim/issues/1168)
|
||||
during the initial import of the database. It's
|
||||
something PostgreSQL internal Nominatim doesn't control. And PostgreSQL forums
|
||||
suggest it's threading related but definitely some kind of crash of a process.
|
||||
Users reported either rebooting the server, different hardware or just trying
|
||||
@@ -110,22 +87,6 @@ The server cannot access your database. Add `&debug=1` to your URL
|
||||
to get the full error message.
|
||||
|
||||
|
||||
### On CentOS the website shows "Could not connect to server"
|
||||
|
||||
`could not connect to server: No such file or directory`
|
||||
|
||||
On CentOS v7 the PostgreSQL server is started with `systemd`. Check if
|
||||
`/usr/lib/systemd/system/httpd.service` contains a line `PrivateTmp=true`. If
|
||||
so then Apache cannot see the `/tmp/.s.PGSQL.5432` file. It's a good security
|
||||
feature, so use the
|
||||
[preferred solution](../appendix/Install-on-Centos-7/#adding-selinux-security-settings).
|
||||
|
||||
However, you can solve this the quick and dirty way by commenting out that line and then run
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart httpd
|
||||
|
||||
|
||||
### Website reports "DB Error: insufficient permissions"
|
||||
|
||||
The user the webserver, e.g. Apache, runs under needs to have access to the
|
||||
@@ -156,7 +117,8 @@ Example error message
|
||||
|
||||
The PostgreSQL database, i.e. user `postgres`, needs to have access to that file.
|
||||
|
||||
The permission need to be read & executable by everybody, e.g.
|
||||
The permission need to be read & executable by everybody, but not writeable
|
||||
by everybody, e.g.
|
||||
|
||||
```
|
||||
-rwxr-xr-x 1 nominatim nominatim 297984 build/module/nominatim.so
|
||||
@@ -164,19 +126,45 @@ The permission need to be read & executable by everybody, e.g.
|
||||
|
||||
Try `chmod a+r nominatim.so; chmod a+x nominatim.so`.
|
||||
|
||||
When running SELinux, make sure that the
|
||||
[context is set up correctly](../appendix/Install-on-Centos-7/#adding-selinux-security-settings).
|
||||
When you recently updated your operating system, updated PostgreSQL to
|
||||
a new version or moved files (e.g. the build directory) you should
|
||||
recreate `nominatim.so`. Try
|
||||
|
||||
### Setup.php fails with "DB Error: extension not found"
|
||||
```
|
||||
cd build
|
||||
rm -r module/
|
||||
cmake $main_Nominatim_path && make
|
||||
```
|
||||
|
||||
### Setup fails with "DB Error: extension not found"
|
||||
|
||||
Make sure you have the PostgreSQL extensions "hstore" and "postgis" installed.
|
||||
See the installation instructions for a full list of required packages.
|
||||
|
||||
|
||||
### UnicodeEncodeError: 'ascii' codec can't encode character
|
||||
|
||||
Make sure that the operating system's locale is UTF-8. With some prebuilt
|
||||
images (e.g. LXC containers from Proxmox, see
|
||||
[discussion](https://github.com/osm-search/Nominatim/discussions/2343)) or
|
||||
images that optimize for size it might be missing.
|
||||
|
||||
On Ubuntu you can check the locale is installed:
|
||||
|
||||
```
|
||||
grep UTF-8 /etc/default/locale
|
||||
```
|
||||
|
||||
And install it using
|
||||
|
||||
```
|
||||
dpkg-reconfigure locales
|
||||
```
|
||||
|
||||
### I forgot to delete the flatnodes file before starting an import.
|
||||
|
||||
That's fine. For each import the flatnodes file get overwritten.
|
||||
See [https://help.openstreetmap.org/questions/52419/nominatim-flatnode-storage]()
|
||||
See [https://help.openstreetmap.org/questions/52419/nominatim-flatnode-storage](https://help.openstreetmap.org/questions/52419/nominatim-flatnode-storage)
|
||||
for more information.
|
||||
|
||||
|
||||
@@ -185,11 +173,3 @@ for more information.
|
||||
### Can I import negative OSM ids into Nominatim?
|
||||
|
||||
See [this question of Stackoverflow](https://help.openstreetmap.org/questions/64662/nominatim-flatnode-with-negative-id).
|
||||
|
||||
### Missing XML or text declaration
|
||||
|
||||
The website might show: `XML Parsing Error: XML or text declaration not at start of entity Location.`
|
||||
|
||||
Make sure there are no spaces at the beginning of your `settings/local.php` file.
|
||||
|
||||
|
||||
|
||||
@@ -1,322 +0,0 @@
|
||||
# Importing and Updating the Database
|
||||
|
||||
The following instructions explain how to create a Nominatim database
|
||||
from an OSM planet file and how to keep the database up to date. It
|
||||
is assumed that you have already successfully installed the Nominatim
|
||||
software itself, if not return to the [installation page](Installation.md).
|
||||
|
||||
## Configuration setup in settings/local.php
|
||||
|
||||
The Nominatim server can be customized via the file `settings/local.php`
|
||||
in the build directory. Note that this is a PHP file, so it must always
|
||||
start like this:
|
||||
|
||||
<?php
|
||||
|
||||
without any leading spaces.
|
||||
|
||||
There are lots of configuration settings you can tweak. Have a look
|
||||
at `settings/default.php` for a full list. Most should have a sensible default.
|
||||
|
||||
#### Flatnode files
|
||||
|
||||
If you plan to import a large dataset (e.g. Europe, North America, planet),
|
||||
you should also enable flatnode storage of node locations. With this
|
||||
setting enabled, node coordinates are stored in a simple file instead
|
||||
of the database. This will save you import time and disk storage.
|
||||
Add to your `settings/local.php`:
|
||||
|
||||
@define('CONST_Osm2pgsql_Flatnode_File', '/path/to/flatnode.file');
|
||||
|
||||
Replace the second part with a suitable path on your system and make sure
|
||||
the directory exists. There should be at least 64GB of free space.
|
||||
|
||||
## Downloading additional data
|
||||
|
||||
### Wikipedia/Wikidata rankings
|
||||
|
||||
Wikipedia can be used as an optional auxiliary data source to help indicate
|
||||
the importance of OSM features. Nominatim will work without this information
|
||||
but it will improve the quality of the results if this is installed.
|
||||
This data is available as a binary download:
|
||||
|
||||
cd $NOMINATIM_SOURCE_DIR/data
|
||||
wget https://www.nominatim.org/data/wikimedia-importance.sql.gz
|
||||
|
||||
The file is about 400MB and adds around 4GB to Nominatim database.
|
||||
|
||||
!!! tip
|
||||
If you forgot to download the wikipedia rankings, you can also add
|
||||
importances after the import. Download the files, then run
|
||||
`./utils/setup.php --import-wikipedia-articles`
|
||||
and `./utils/update.php --recompute-importance`.
|
||||
|
||||
### Great Britain, USA postcodes
|
||||
|
||||
Nominatim can use postcodes from an external source to improve searches that
|
||||
involve a GB or US postcode. This data can be optionally downloaded:
|
||||
|
||||
cd $NOMINATIM_SOURCE_DIR/data
|
||||
wget https://www.nominatim.org/data/gb_postcode_data.sql.gz
|
||||
wget https://www.nominatim.org/data/us_postcode_data.sql.gz
|
||||
|
||||
## Choosing the Data to Import
|
||||
|
||||
In its default setup Nominatim is configured to import the full OSM data
|
||||
set for the entire planet. Such a setup requires a powerful machine with
|
||||
at least 64GB of RAM and around 800GB of SSD hard disks. Depending on your
|
||||
use case there are various ways to reduce the amount of data imported. This
|
||||
section discusses these methods. They can also be combined.
|
||||
|
||||
### Using an extract
|
||||
|
||||
If you only need geocoding for a smaller region, then precomputed extracts
|
||||
are a good way to reduce the database size and import time.
|
||||
[Geofabrik](https://download.geofabrik.de) offers extracts for most countries.
|
||||
They even have daily updates which can be used with the update process described
|
||||
below. There are also
|
||||
[other providers for extracts](https://wiki.openstreetmap.org/wiki/Planet.osm#Downloading).
|
||||
|
||||
Please be aware that some extracts are not cut exactly along the country
|
||||
boundaries. As a result some parts of the boundary may be missing which means
|
||||
that Nominatim cannot compute the areas for some administrative areas.
|
||||
|
||||
### Dropping Data Required for Dynamic Updates
|
||||
|
||||
About half of the data in Nominatim's database is not really used for serving
|
||||
the API. It is only there to allow the data to be updated from the latest
|
||||
changes from OSM. For many uses these dynamic updates are not really required.
|
||||
If you don't plan to apply updates, the dynamic part of the database can be
|
||||
safely dropped using the following command:
|
||||
|
||||
```
|
||||
./utils/setup.php --drop
|
||||
```
|
||||
|
||||
Note that you still need to provide for sufficient disk space for the initial
|
||||
import. So this option is particularly interesting if you plan to transfer the
|
||||
database or reuse the space later.
|
||||
|
||||
### Reverse-only Imports
|
||||
|
||||
If you only want to use the Nominatim database for reverse lookups or
|
||||
if you plan to use the installation only for exports to a
|
||||
[photon](https://photon.komoot.de/) database, then you can set up a database
|
||||
without search indexes. Add `--reverse-only` to your setup command above.
|
||||
|
||||
This saves about 5% of disk space.
|
||||
|
||||
### Filtering Imported Data
|
||||
|
||||
Nominatim normally sets up a full search database containing administrative
|
||||
boundaries, places, streets, addresses and POI data. There are also other
|
||||
import styles available which only read selected data:
|
||||
|
||||
* **settings/import-admin.style**
|
||||
Only import administrative boundaries and places.
|
||||
* **settings/import-street.style**
|
||||
Like the admin style but also adds streets.
|
||||
* **settings/import-address.style**
|
||||
Import all data necessary to compute addresses down to house number level.
|
||||
* **settings/import-full.style**
|
||||
Default style that also includes points of interest.
|
||||
* **settings/import-extratags.style**
|
||||
Like the full style but also adds most of the OSM tags into the extratags
|
||||
column.
|
||||
|
||||
The style can be changed with the configuration `CONST_Import_Style`.
|
||||
|
||||
To give you an idea of the impact of using the different styles, the table
|
||||
below gives rough estimates of the final database size after import of a
|
||||
2018 planet and after using the `--drop` option. It also shows the time
|
||||
needed for the import on a machine with 64GB RAM, 4 CPUS and SSDs. Note that
|
||||
the given sizes are just an estimate meant for comparison of style requirements.
|
||||
Your planet import is likely to be larger as the OSM data grows with time.
|
||||
|
||||
style | Import time | DB size | after drop
|
||||
----------|--------------|------------|------------
|
||||
admin | 5h | 190 GB | 20 GB
|
||||
street | 42h | 400 GB | 180 GB
|
||||
address | 59h | 500 GB | 260 GB
|
||||
full | 80h | 575 GB | 300 GB
|
||||
extratags | 80h | 585 GB | 310 GB
|
||||
|
||||
You can also customize the styles further. For a description of the
|
||||
style format see [the development section](../develop/Import.md).
|
||||
|
||||
## Initial import of the data
|
||||
|
||||
!!! danger "Important"
|
||||
First try the import with a small extract, for example from
|
||||
[Geofabrik](https://download.geofabrik.de).
|
||||
|
||||
Download the data to import and load the data with the following command
|
||||
from the build directory:
|
||||
|
||||
```sh
|
||||
./utils/setup.php --osm-file <data file> --all 2>&1 | tee setup.log
|
||||
```
|
||||
|
||||
***Note for full planet imports:*** Even on a perfectly configured machine
|
||||
the import of a full planet takes at least 2 days. Once you see messages
|
||||
with `Rank .. ETA` appear, the indexing process has started. This part takes
|
||||
the most time. There are 30 ranks to process. Rank 26 and 30 are the most complex.
|
||||
They take each about a third of the total import time. If you have not reached
|
||||
rank 26 after two days of import, it is worth revisiting your system
|
||||
configuration as it may not be optimal for the import.
|
||||
|
||||
### Notes on memory usage
|
||||
|
||||
In the first step of the import Nominatim uses osm2pgsql to load the OSM data
|
||||
into the PostgreSQL database. This step is very demanding in terms of RAM usage.
|
||||
osm2pgsql and PostgreSQL are running in parallel at this point. PostgreSQL
|
||||
blocks at least the part of RAM that has been configured with the
|
||||
`shared_buffers` parameter during [PostgreSQL tuning](Installation#postgresql-tuning)
|
||||
and needs some memory on top of that. osm2pgsql needs at least 2GB of RAM for
|
||||
its internal data structures, potentially more when it has to process very large
|
||||
relations. In addition it needs to maintain a cache for node locations. The size
|
||||
of this cache can be configured with the parameter `--osm2pgsql-cache`.
|
||||
|
||||
When importing with a flatnode file, it is best to disable the node cache
|
||||
completely and leave the memory for the flatnode file. Nominatim will do this
|
||||
by default, so you do not need to configure anything in this case.
|
||||
|
||||
For imports without a flatnode file, set `--osm2pgsql-cache` approximately to
|
||||
the size of the OSM pbf file (in MB) you are importing. Make sure you leave
|
||||
enough RAM for PostgreSQL and osm2pgsql as mentioned above. If the system starts
|
||||
swapping or you are getting out-of-memory errors, reduce the cache size or
|
||||
even consider using a flatnode file.
|
||||
|
||||
### Verify import finished
|
||||
|
||||
Run this script to verify all required tables and indices got created successfully.
|
||||
|
||||
```sh
|
||||
./utils/check_import_finished.php
|
||||
```
|
||||
|
||||
|
||||
## Tuning the database
|
||||
|
||||
Accurate word frequency information for search terms helps PostgreSQL's query
|
||||
planner to make the right decisions. Recomputing them can improve the performance
|
||||
of forward geocoding in particular under high load. To recompute word counts run:
|
||||
|
||||
```sh
|
||||
./utils/update.php --recompute-word-counts
|
||||
```
|
||||
|
||||
This will take a couple of hours for a full planet installation. You can
|
||||
also defer that step to a later point in time when you realise that
|
||||
performance becomes an issue. Just make sure that updates are stopped before
|
||||
running this function.
|
||||
|
||||
If you want to be able to search for places by their type through
|
||||
[special key phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
|
||||
you also need to enable these key phrases like this:
|
||||
|
||||
./utils/specialphrases.php --wiki-import > specialphrases.sql
|
||||
psql -d nominatim -f specialphrases.sql
|
||||
|
||||
Note that this command downloads the phrases from the wiki link above. You
|
||||
need internet access for the step.
|
||||
|
||||
|
||||
## Installing Tiger housenumber data for the US
|
||||
|
||||
Nominatim is able to use the official [TIGER](https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html)
|
||||
address set to complement the OSM house number data in the US. You can add
|
||||
TIGER data to your own Nominatim instance by following these steps. The
|
||||
entire US adds about 10GB to your database.
|
||||
|
||||
1. Get preprocessed TIGER 2019 data and unpack it into the
|
||||
data directory in your Nominatim sources:
|
||||
|
||||
cd Nominatim/data
|
||||
wget https://nominatim.org/data/tiger2019-nominatim-preprocessed.tar.gz
|
||||
tar xf tiger2019-nominatim-preprocessed.tar.gz
|
||||
|
||||
`data-source/us-tiger/README.md` explains how the data got preprocessed.
|
||||
|
||||
2. Import the data into your Nominatim database:
|
||||
|
||||
./utils/setup.php --import-tiger-data
|
||||
|
||||
3. Enable use of the Tiger data in your `settings/local.php` by adding:
|
||||
|
||||
@define('CONST_Use_US_Tiger_Data', true);
|
||||
|
||||
4. Apply the new settings:
|
||||
|
||||
```sh
|
||||
./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
|
||||
```
|
||||
|
||||
|
||||
## Updates
|
||||
|
||||
There are many different ways to update your Nominatim database.
|
||||
The following section describes how to keep it up-to-date with Pyosmium.
|
||||
For a list of other methods see the output of `./utils/update.php --help`.
|
||||
|
||||
!!! warning
|
||||
If you have configured a flatnode file for the import, then you
|
||||
need to keep this flatnode file around for updates as well.
|
||||
|
||||
#### Installing the newest version of Pyosmium
|
||||
|
||||
It is recommended to install Pyosmium via pip. Make sure to use python3.
|
||||
Run (as the same user who will later run the updates):
|
||||
|
||||
```sh
|
||||
pip3 install --user osmium
|
||||
```
|
||||
|
||||
Nominatim needs a tool called `pyosmium-get-updates` which comes with
|
||||
Pyosmium. You need to tell Nominatim where to find it. Add the
|
||||
following line to your `settings/local.php`:
|
||||
|
||||
@define('CONST_Pyosmium_Binary', '/home/user/.local/bin/pyosmium-get-changes');
|
||||
|
||||
The path above is fine if you used the `--user` parameter with pip.
|
||||
Replace `user` with your user name.
|
||||
|
||||
#### Setting up the update process
|
||||
|
||||
Next the update needs to be initialised. By default Nominatim is configured
|
||||
to update using the global minutely diffs.
|
||||
|
||||
If you want a different update source you will need to add some settings
|
||||
to `settings/local.php`. For example, to use the daily country extracts
|
||||
diffs for Ireland from Geofabrik add the following:
|
||||
|
||||
// base URL of the replication service
|
||||
@define('CONST_Replication_Url', 'https://download.geofabrik.de/europe/ireland-and-northern-ireland-updates');
|
||||
// How often upstream publishes diffs
|
||||
@define('CONST_Replication_Update_Interval', '86400');
|
||||
// How long to sleep if no update found yet
|
||||
@define('CONST_Replication_Recheck_Interval', '900');
|
||||
|
||||
To set up the update process now run the following command:
|
||||
|
||||
./utils/update.php --init-updates
|
||||
|
||||
It outputs the date where updates will start. Recheck that this date is
|
||||
what you expect.
|
||||
|
||||
The `--init-updates` command needs to be rerun whenever the replication service
|
||||
is changed.
|
||||
|
||||
#### Updating Nominatim
|
||||
|
||||
The following command will keep your database constantly up to date:
|
||||
|
||||
./utils/update.php --import-osmosis-all
|
||||
|
||||
(Note that even though the old name "import-osmosis-all" has been kept for
|
||||
compatibility reasons, Osmosis is not required to run this - it uses pyosmium
|
||||
behind the scenes.)
|
||||
|
||||
If you have imported multiple country extracts and want to keep them
|
||||
up-to-date, [Advanced installations section](Advanced-Installations.md) contains instructions
|
||||
to set up and update multiple country extracts.
|
||||
339
docs/admin/Import.md
Normal file
339
docs/admin/Import.md
Normal file
@@ -0,0 +1,339 @@
|
||||
# Importing the Database
|
||||
|
||||
The following instructions explain how to create a Nominatim database
|
||||
from an OSM planet file. It is assumed that you have already successfully
|
||||
installed the Nominatim software itself and the `nominatim` tool can be found
|
||||
in your `PATH`. If this is not the case, return to the
|
||||
[installation page](Installation.md).
|
||||
|
||||
## Creating the project directory
|
||||
|
||||
Before you start the import, you should create a project directory for your
|
||||
new database installation. This directory receives all data that is related
|
||||
to a single Nominatim setup: configuration, extra data, etc. Create a project
|
||||
directory apart from the Nominatim software and change into the directory:
|
||||
|
||||
```
|
||||
mkdir ~/nominatim-project
|
||||
cd ~/nominatim-project
|
||||
```
|
||||
|
||||
In the following, we refer to the project directory as `$PROJECT_DIR`. To be
|
||||
able to copy&paste instructions, you can export the appropriate variable:
|
||||
|
||||
```
|
||||
export PROJECT_DIR=~/nominatim-project
|
||||
```
|
||||
|
||||
The Nominatim tool assumes per default that the current working directory is
|
||||
the project directory but you may explicitly state a different directory using
|
||||
the `--project-dir` parameter. The following instructions assume that you run
|
||||
all commands from the project directory.
|
||||
|
||||
!!! tip "Migration Tip"
|
||||
|
||||
Nominatim used to be run directly from the build directory until version 3.6.
|
||||
Essentially, the build directory functioned as the project directory
|
||||
for the database installation. This setup still works and can be useful for
|
||||
development purposes. It is not recommended anymore for production setups.
|
||||
Create a project directory that is separate from the Nominatim software.
|
||||
|
||||
### Configuration setup in `.env`
|
||||
|
||||
The Nominatim server can be customized via an `.env` configuration file in the
|
||||
project directory. This is a file in [dotenv](https://github.com/theskumar/python-dotenv)
|
||||
format which looks the same as variable settings in a standard shell environment.
|
||||
You can also set the same configuration via environment variables. All
|
||||
settings have a `NOMINATIM_` prefix to avoid conflicts with other environment
|
||||
variables.
|
||||
|
||||
There are lots of configuration settings you can tweak. A full reference
|
||||
can be found in the chapter [Configuration Settings](../customize/Settings.md).
|
||||
Most should have a sensible default.
|
||||
|
||||
#### Flatnode files
|
||||
|
||||
If you plan to import a large dataset (e.g. Europe, North America, planet),
|
||||
you should also enable flatnode storage of node locations. With this
|
||||
setting enabled, node coordinates are stored in a simple file instead
|
||||
of the database. This will save you import time and disk storage.
|
||||
Add to your `.env`:
|
||||
|
||||
NOMINATIM_FLATNODE_FILE="/path/to/flatnode.file"
|
||||
|
||||
Replace the second part with a suitable path on your system and make sure
|
||||
the directory exists. There should be at least 75GB of free space.
|
||||
|
||||
## Downloading additional data
|
||||
|
||||
### Wikipedia/Wikidata rankings
|
||||
|
||||
Wikipedia can be used as an optional auxiliary data source to help indicate
|
||||
the importance of OSM features. Nominatim will work without this information
|
||||
but it will improve the quality of the results if this is installed.
|
||||
This data is available as a binary download. Put it into your project directory:
|
||||
|
||||
cd $PROJECT_DIR
|
||||
wget https://nominatim.org/data/wikimedia-importance.csv.gz
|
||||
wget -O secondary_importance.sql.gz https://nominatim.org/data/wikimedia-secondary-importance.sql.gz
|
||||
|
||||
The files are about 400MB and add around 4GB to the Nominatim database. For
|
||||
more information about importance,
|
||||
see [Importance Customization](../customize/Importance.md).
|
||||
|
||||
!!! tip
|
||||
If you forgot to download the wikipedia rankings, then you can
|
||||
also add importances after the import. Download the SQL files, then
|
||||
run `nominatim refresh --wiki-data --secondary-importance --importance`.
|
||||
Updating importances for a planet will take a couple of hours.
|
||||
|
||||
### External postcodes
|
||||
|
||||
Nominatim can use postcodes from an external source to improve searching with
|
||||
postcodes. We provide precomputed postcodes sets for the US (using TIGER data)
|
||||
and the UK (using the [CodePoint OpenData set](https://osdatahub.os.uk/downloads/open/CodePointOpen).
|
||||
This data can be optionally downloaded into the project directory:
|
||||
|
||||
cd $PROJECT_DIR
|
||||
wget https://nominatim.org/data/gb_postcodes.csv.gz
|
||||
wget https://nominatim.org/data/us_postcodes.csv.gz
|
||||
|
||||
You can also add your own custom postcode sources, see
|
||||
[Customization of postcodes](../customize/Postcodes.md).
|
||||
|
||||
## Choosing the data to import
|
||||
|
||||
In its default setup Nominatim is configured to import the full OSM data
|
||||
set for the entire planet. Such a setup requires a powerful machine with
|
||||
at least 64GB of RAM and around 900GB of SSD hard disks. Depending on your
|
||||
use case there are various ways to reduce the amount of data imported. This
|
||||
section discusses these methods. They can also be combined.
|
||||
|
||||
### Using an extract
|
||||
|
||||
If you only need geocoding for a smaller region, then precomputed OSM extracts
|
||||
are a good way to reduce the database size and import time.
|
||||
[Geofabrik](https://download.geofabrik.de) offers extracts for most countries.
|
||||
They even have daily updates which can be used with the update process described
|
||||
[in the next section](Update.md). There are also
|
||||
[other providers for extracts](https://wiki.openstreetmap.org/wiki/Planet.osm#Downloading).
|
||||
|
||||
Please be aware that some extracts are not cut exactly along the country
|
||||
boundaries. As a result some parts of the boundary may be missing which means
|
||||
that Nominatim cannot compute the areas for some administrative areas.
|
||||
|
||||
### Dropping Data Required for Dynamic Updates
|
||||
|
||||
About half of the data in Nominatim's database is not really used for serving
|
||||
the API. It is only there to allow the data to be updated from the latest
|
||||
changes from OSM. For many uses these dynamic updates are not really required.
|
||||
If you don't plan to apply updates, you can run the import with the
|
||||
`--no-updates` parameter. This will drop the dynamic part of the database as
|
||||
soon as it is not required anymore.
|
||||
|
||||
You can also drop the dynamic part later using the following command:
|
||||
|
||||
```
|
||||
nominatim freeze
|
||||
```
|
||||
|
||||
Note that you still need to provide for sufficient disk space for the initial
|
||||
import. So this option is particularly interesting if you plan to transfer the
|
||||
database or reuse the space later.
|
||||
|
||||
!!! warning
|
||||
The data structure for updates are also required when adding additional data
|
||||
after the import, for example [TIGER housenumber data](../customize/Tiger.md).
|
||||
If you plan to use those, you must not use the `--no-updates` parameter.
|
||||
Do a normal import, add the external data and once you are done with
|
||||
everything run `nominatim freeze`.
|
||||
|
||||
|
||||
### Reverse-only Imports
|
||||
|
||||
If you only want to use the Nominatim database for reverse lookups or
|
||||
if you plan to use the installation only for exports to a
|
||||
[photon](https://photon.komoot.io/) database, then you can set up a database
|
||||
without search indexes. Add `--reverse-only` to your setup command above.
|
||||
|
||||
This saves about 5% of disk space, import time won't be significant faster.
|
||||
|
||||
### Filtering Imported Data
|
||||
|
||||
Nominatim normally sets up a full search database containing administrative
|
||||
boundaries, places, streets, addresses and POI data. There are also other
|
||||
import styles available which only read selected data:
|
||||
|
||||
* **admin**
|
||||
Only import administrative boundaries and places.
|
||||
* **street**
|
||||
Like the admin style but also adds streets.
|
||||
* **address**
|
||||
Import all data necessary to compute addresses down to house number level.
|
||||
* **full**
|
||||
Default style that also includes points of interest.
|
||||
* **extratags**
|
||||
Like the full style but also adds most of the OSM tags into the extratags
|
||||
column.
|
||||
|
||||
The style can be changed with the configuration `NOMINATIM_IMPORT_STYLE`.
|
||||
|
||||
To give you an idea of the impact of using the different styles, the table
|
||||
below gives rough estimates of the final database size after import of a
|
||||
2020 planet and after using the `--drop` option. It also shows the time
|
||||
needed for the import on a machine with 64GB RAM, 4 CPUS and NVME disks.
|
||||
Note that the given sizes are just an estimate meant for comparison of
|
||||
style requirements. Your planet import is likely to be larger as the
|
||||
OSM data grows with time.
|
||||
|
||||
style | Import time | DB size | after drop
|
||||
----------|--------------|------------|------------
|
||||
admin | 4h | 215 GB | 20 GB
|
||||
street | 22h | 440 GB | 185 GB
|
||||
address | 36h | 545 GB | 260 GB
|
||||
full | 54h | 640 GB | 330 GB
|
||||
extratags | 54h | 650 GB | 340 GB
|
||||
|
||||
You can also customize the styles further.
|
||||
A [description of the style format](../customize/Import-Styles.md)
|
||||
can be found in the customization guide.
|
||||
|
||||
## Initial import of the data
|
||||
|
||||
!!! danger "Important"
|
||||
First try the import with a small extract, for example from
|
||||
[Geofabrik](https://download.geofabrik.de).
|
||||
|
||||
Download the data to import. Then issue the following command
|
||||
from the **project directory** to start the import:
|
||||
|
||||
```sh
|
||||
nominatim import --osm-file <data file> 2>&1 | tee setup.log
|
||||
```
|
||||
|
||||
The **project directory** is the one that you have set up at the beginning.
|
||||
See [creating the project directory](#creating-the-project-directory).
|
||||
|
||||
### Notes on full planet imports
|
||||
|
||||
Even on a perfectly configured machine
|
||||
the import of a full planet takes around 2 days. Once you see messages
|
||||
with `Rank .. ETA` appear, the indexing process has started. This part takes
|
||||
the most time. There are 30 ranks to process. Rank 26 and 30 are the most complex.
|
||||
They take each about a third of the total import time. If you have not reached
|
||||
rank 26 after two days of import, it is worth revisiting your system
|
||||
configuration as it may not be optimal for the import.
|
||||
|
||||
### Notes on memory usage
|
||||
|
||||
In the first step of the import Nominatim uses [osm2pgsql](https://osm2pgsql.org)
|
||||
to load the OSM data into the PostgreSQL database. This step is very demanding
|
||||
in terms of RAM usage. osm2pgsql and PostgreSQL are running in parallel at
|
||||
this point. PostgreSQL blocks at least the part of RAM that has been configured
|
||||
with the `shared_buffers` parameter during
|
||||
[PostgreSQL tuning](Installation.md#tuning-the-postgresql-database)
|
||||
and needs some memory on top of that. osm2pgsql needs at least 2GB of RAM for
|
||||
its internal data structures, potentially more when it has to process very large
|
||||
relations. In addition it needs to maintain a cache for node locations. The size
|
||||
of this cache can be configured with the parameter `--osm2pgsql-cache`.
|
||||
|
||||
When importing with a flatnode file, it is best to disable the node cache
|
||||
completely and leave the memory for the flatnode file. Nominatim will do this
|
||||
by default, so you do not need to configure anything in this case.
|
||||
|
||||
For imports without a flatnode file, set `--osm2pgsql-cache` approximately to
|
||||
the size of the OSM pbf file you are importing. The size needs to be given in
|
||||
MB. Make sure you leave enough RAM for PostgreSQL and osm2pgsql as mentioned
|
||||
above. If the system starts swapping or you are getting out-of-memory errors,
|
||||
reduce the cache size or even consider using a flatnode file.
|
||||
|
||||
|
||||
### Testing the installation
|
||||
|
||||
Run this script to verify that all required tables and indices got created
|
||||
successfully.
|
||||
|
||||
```sh
|
||||
nominatim admin --check-database
|
||||
```
|
||||
|
||||
Now you can try out your installation by executing a simple query on the
|
||||
command line:
|
||||
|
||||
``` sh
|
||||
nominatim search --query Berlin
|
||||
```
|
||||
|
||||
or, when you have a reverse-only installation:
|
||||
|
||||
``` sh
|
||||
nominatim reverse --lat 51 --lon 45
|
||||
```
|
||||
|
||||
If you want to run Nominatim as a service, you need to make a choice between
|
||||
running the modern Python frontend and the legacy PHP frontend.
|
||||
Make sure you have installed the right packages as per
|
||||
[Installation](Installation.md#software).
|
||||
|
||||
#### Testing the Python frontend
|
||||
|
||||
To run the test server against the Python frontend, you must choose a
|
||||
web framework to use, either starlette or falcon. Make sure the appropriate
|
||||
packages are installed. Then run
|
||||
|
||||
``` sh
|
||||
nominatim serve
|
||||
```
|
||||
|
||||
or, if you prefer to use Starlette instead of Falcon as webserver,
|
||||
|
||||
``` sh
|
||||
nominatim serve --engine starlette
|
||||
```
|
||||
|
||||
Go to `http://localhost:8088/status.php` and you should see the message `OK`.
|
||||
You can also run a search query, e.g. `http://localhost:8088/search.php?q=Berlin`
|
||||
or, for reverse-only installations a reverse query,
|
||||
e.g. `http://localhost:8088/reverse.php?lat=27.1750090510034&lon=78.04209025`.
|
||||
|
||||
Do not use this test server in production.
|
||||
To run Nominatim via webservers like Apache or nginx, please continue reading
|
||||
[Deploy the Python frontend](Deployment-Python.md).
|
||||
|
||||
#### Testing the PHP frontend
|
||||
|
||||
!!! danger
|
||||
The PHP fronted is deprecated and will be removed in Nominatim 5.0.
|
||||
|
||||
You can run a small test server with the PHP frontend like this:
|
||||
|
||||
```sh
|
||||
nominatim serve --engine php
|
||||
```
|
||||
|
||||
Go to `http://localhost:8088/status.php` and you should see the message `OK`.
|
||||
You can also run a search query, e.g. `http://localhost:8088/search.php?q=Berlin`
|
||||
or, for reverse-only installations a reverse query,
|
||||
e.g. `http://localhost:8088/reverse.php?lat=27.1750090510034&lon=78.04209025`.
|
||||
|
||||
Do not use this test server in production.
|
||||
To run Nominatim via webservers like Apache or nginx, please continue reading
|
||||
[Deploy the PHP frontend](Deployment-PHP.md).
|
||||
|
||||
|
||||
|
||||
## Enabling search by category phrases
|
||||
|
||||
To be able to search for places by their type using
|
||||
[special phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
|
||||
you also need to import these key phrases like this:
|
||||
|
||||
```sh
|
||||
nominatim special-phrases --import-from-wiki
|
||||
```
|
||||
|
||||
Note that this command downloads the phrases from the wiki link above. You
|
||||
need internet access for the step.
|
||||
|
||||
You can also import special phrases from a csv file, for more
|
||||
information please see the [Customization part](../customize/Special-Phrases.md).
|
||||
@@ -4,10 +4,8 @@ This page contains generic installation instructions for Nominatim and its
|
||||
prerequisites. There are also step-by-step instructions available for
|
||||
the following operating systems:
|
||||
|
||||
* [Ubuntu 20.04](../appendix/Install-on-Ubuntu-20.md)
|
||||
* [Ubuntu 18.04](../appendix/Install-on-Ubuntu-18.md)
|
||||
* [CentOS 8](../appendix/Install-on-Centos-8.md)
|
||||
* [CentOS 7.2](../appendix/Install-on-Centos-7.md)
|
||||
* [Ubuntu 24.04](Install-on-Ubuntu-24.md)
|
||||
* [Ubuntu 22.04](Install-on-Ubuntu-22.md)
|
||||
|
||||
These OS-specific instructions can also be found in executable form
|
||||
in the `vagrant/` directory.
|
||||
@@ -17,60 +15,87 @@ and can't offer support.
|
||||
|
||||
* [Docker](https://github.com/mediagis/nominatim-docker)
|
||||
* [Docker on Kubernetes](https://github.com/peter-evans/nominatim-k8s)
|
||||
* [Kubernetes with Helm](https://github.com/robjuz/helm-charts/blob/master/charts/nominatim/README.md)
|
||||
* [Ansible](https://github.com/synthesio/infra-ansible-nominatim)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Software
|
||||
|
||||
For compiling:
|
||||
!!! Warning
|
||||
For larger installations you **must have** PostgreSQL 11+ and PostGIS 3+
|
||||
otherwise import and queries will be slow to the point of being unusable.
|
||||
Query performance has marked improvements with PostgreSQL 13+ and PostGIS 3.2+.
|
||||
|
||||
For running Nominatim:
|
||||
|
||||
* [PostgreSQL](https://www.postgresql.org) (9.6+ will work, 11+ strongly recommended)
|
||||
* [PostGIS](https://postgis.net) (2.2+ will work, 3.0+ strongly recommended)
|
||||
* [osm2pgsql](https://osm2pgsql.org) (1.8+, optional when building with CMake)
|
||||
* [Python 3](https://www.python.org/) (3.7+)
|
||||
|
||||
Furthermore the following Python libraries are required:
|
||||
|
||||
* [Psycopg3](https://www.psycopg.org)
|
||||
* [Python Dotenv](https://github.com/theskumar/python-dotenv)
|
||||
* [psutil](https://github.com/giampaolo/psutil)
|
||||
* [Jinja2](https://palletsprojects.com/p/jinja/)
|
||||
* [PyICU](https://pypi.org/project/PyICU/)
|
||||
* [PyYaml](https://pyyaml.org/) (5.1+)
|
||||
* [datrie](https://github.com/pytries/datrie)
|
||||
|
||||
These will be installed automatically when using pip installation.
|
||||
|
||||
When using legacy CMake-based installation:
|
||||
|
||||
* [cmake](https://cmake.org/)
|
||||
* [expat](https://libexpat.github.io/)
|
||||
* [proj](https://proj.org/)
|
||||
* [bzip2](http://www.bzip.org/)
|
||||
* [zlib](https://www.zlib.net/)
|
||||
* [Boost libraries](https://www.boost.org/), including system and filesystem
|
||||
* [ICU](http://site.icu-project.org/)
|
||||
* [nlohmann/json](https://json.nlohmann.me/)
|
||||
* [Boost libraries](https://www.boost.org/), including system and file system
|
||||
* PostgreSQL client libraries
|
||||
* a recent C++ compiler (gcc 5+ or Clang 3.8+)
|
||||
|
||||
For running Nominatim:
|
||||
|
||||
* [PostgreSQL](https://www.postgresql.org) (9.3+)
|
||||
* [PostGIS](https://postgis.org) (2.2+)
|
||||
* [Python 3](https://www.python.org/)
|
||||
* [Psycopg2](https://initd.org/psycopg)
|
||||
* [PHP](https://php.net) (7.0 or later)
|
||||
* PHP-pgsql
|
||||
* PHP-intl (bundled with PHP)
|
||||
* a webserver (apache or nginx are recommended)
|
||||
|
||||
For running continuous updates:
|
||||
|
||||
* [pyosmium](https://osmcode.org/pyosmium/) (with Python 3)
|
||||
* [pyosmium](https://osmcode.org/pyosmium/)
|
||||
|
||||
For running tests:
|
||||
For running the Python frontend:
|
||||
|
||||
* [behave](http://pythonhosted.org/behave/)
|
||||
* [nose](https://nose.readthedocs.io)
|
||||
* [phpunit](https://phpunit.de) >= 7.3
|
||||
* [SQLAlchemy](https://www.sqlalchemy.org/) (1.4.31+ with greenlet support)
|
||||
* [asyncpg](https://magicstack.github.io/asyncpg) (0.8+, only when using SQLAlchemy < 2.0)
|
||||
* one of the following web frameworks:
|
||||
* [falcon](https://falconframework.org/) (3.0+)
|
||||
* [starlette](https://www.starlette.io/)
|
||||
* [uvicorn](https://www.uvicorn.org/)
|
||||
|
||||
For running the legacy PHP frontend (deprecated, will be removed in Nominatim 5.0):
|
||||
|
||||
* [PHP](https://php.net) (7.3+)
|
||||
* PHP-pgsql
|
||||
* PHP-intl (bundled with PHP)
|
||||
|
||||
|
||||
For dependencies for running tests and building documentation, see
|
||||
the [Development section](../develop/Development-Environment.md).
|
||||
|
||||
### Hardware
|
||||
|
||||
A minimum of 2GB of RAM is required or installation will fail. For a full
|
||||
planet import 64GB of RAM or more are strongly recommended. Do not report
|
||||
planet import 128GB of RAM or more are strongly recommended. Do not report
|
||||
out of memory problems if you have less than 64GB RAM.
|
||||
|
||||
For a full planet install you will need at least 800GB of hard disk space
|
||||
(take into account that the OSM database is growing fast). SSD disks
|
||||
will help considerably to speed up import and queries.
|
||||
For a full planet install you will need at least 1TB of hard disk space.
|
||||
Take into account that the OSM database is growing fast.
|
||||
Fast disks are essential. Using NVME disks is recommended.
|
||||
|
||||
Even on a well configured machine the import of a full planet takes
|
||||
at least 2 days. Without SSDs 7-8 days are more realistic.
|
||||
around 2.5 days. When using traditional SSDs, 4-5 days are more realistic.
|
||||
|
||||
## Setup of the server
|
||||
|
||||
### PostgreSQL tuning
|
||||
## Tuning the PostgreSQL database
|
||||
|
||||
You might want to tune your PostgreSQL installation so that the later steps
|
||||
make best use of your hardware. You should tune the following parameters in
|
||||
@@ -80,15 +105,16 @@ your `postgresql.conf` file.
|
||||
maintenance_work_mem = (10GB)
|
||||
autovacuum_work_mem = 2GB
|
||||
work_mem = (50MB)
|
||||
effective_cache_size = (24GB)
|
||||
synchronous_commit = off
|
||||
checkpoint_segments = 100 # only for postgresql <= 9.4
|
||||
max_wal_size = 1GB # postgresql > 9.4
|
||||
checkpoint_timeout = 10min
|
||||
max_wal_size = 1GB
|
||||
checkpoint_timeout = 60min
|
||||
checkpoint_completion_target = 0.9
|
||||
random_page_cost = 1.0
|
||||
wal_level = minimal
|
||||
max_wal_senders = 0
|
||||
|
||||
The numbers in brackets behind some parameters seem to work fine for
|
||||
64GB RAM machine. Adjust to your setup. A higher number for `max_wal_size`
|
||||
128GB RAM machine. Adjust to your setup. A higher number for `max_wal_size`
|
||||
means that PostgreSQL needs to run checkpoints less often but it does require
|
||||
the additional space on your disk.
|
||||
|
||||
@@ -101,91 +127,93 @@ you might consider setting:
|
||||
and even reduce `autovacuum_work_mem` further. This will reduce the amount
|
||||
of memory that autovacuum takes away from the import process.
|
||||
|
||||
For the initial import, you should also set:
|
||||
## Installing the latest release
|
||||
|
||||
fsync = off
|
||||
full_page_writes = off
|
||||
The latest release can be simply installed via Pypi. Make sure you have
|
||||
osm2pgsql, PostgreSQL and libICU in its development version installed.
|
||||
|
||||
Don't forget to reenable them after the initial import or you risk database
|
||||
corruption.
|
||||
Then just run:
|
||||
|
||||
pip install nominatim-{db,api}
|
||||
|
||||
### Webserver setup
|
||||
## Downloading and building Nominatim
|
||||
|
||||
The `website/` directory in the build directory contains the configured
|
||||
website. Include the directory into your webbrowser to serve php files
|
||||
from there.
|
||||
The following instructions are only relevant, if you want to build and
|
||||
install Nominatim from source.
|
||||
|
||||
#### Configure for use with Apache
|
||||
You can download the [latest release from nominatim.org](https://nominatim.org/downloads/).
|
||||
The release contains all necessary files. Just unpack it.
|
||||
|
||||
Make sure your Apache configuration contains the required permissions for the
|
||||
directory and create an alias:
|
||||
If you want to install latest development version from github, make sure to
|
||||
also check out the osm2pgsql subproject:
|
||||
|
||||
``` apache
|
||||
<Directory "/srv/nominatim/build/website">
|
||||
Options FollowSymLinks MultiViews
|
||||
AddType text/html .php
|
||||
DirectoryIndex search.php
|
||||
Require all granted
|
||||
</Directory>
|
||||
Alias /nominatim /srv/nominatim/build/website
|
||||
```
|
||||
git clone --recursive https://github.com/openstreetmap/Nominatim.git
|
||||
```
|
||||
|
||||
`/srv/nominatim/build` should be replaced with the location of your
|
||||
build directory.
|
||||
The development version does not include the country grid. Download it separately:
|
||||
|
||||
After making changes in the apache config you need to restart apache.
|
||||
The website should now be available on http://localhost/nominatim.
|
||||
|
||||
#### Configure for use with Nginx
|
||||
|
||||
Use php-fpm as a deamon for serving PHP cgi. Install php-fpm together with nginx.
|
||||
|
||||
By default php listens on a network socket. If you want it to listen to a
|
||||
Unix socket instead, change the pool configuration (`pool.d/www.conf`) as
|
||||
follows:
|
||||
|
||||
; Comment out the tcp listener and add the unix socket
|
||||
;listen = 127.0.0.1:9000
|
||||
listen = /var/run/php5-fpm.sock
|
||||
|
||||
; Ensure that the daemon runs as the correct user
|
||||
listen.owner = www-data
|
||||
listen.group = www-data
|
||||
listen.mode = 0666
|
||||
|
||||
Tell nginx that php files are special and to fastcgi_pass to the php-fpm
|
||||
unix socket by adding the location definition to the default configuration.
|
||||
|
||||
``` nginx
|
||||
root /srv/nominatim/build/website;
|
||||
index search.php;
|
||||
location / {
|
||||
try_files $uri $uri/ @php;
|
||||
}
|
||||
|
||||
location @php {
|
||||
fastcgi_param SCRIPT_FILENAME "$document_root$uri.php";
|
||||
fastcgi_param PATH_TRANSLATED "$document_root$uri.php";
|
||||
fastcgi_param QUERY_STRING $args;
|
||||
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
if (!-f $document_root$fastcgi_script_name) {
|
||||
return 404;
|
||||
}
|
||||
fastcgi_pass unix:/var/run/php7.3-fpm.sock;
|
||||
fastcgi_index search.php;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
```
|
||||
wget -O Nominatim/data/country_osm_grid.sql.gz https://nominatim.org/data/country_grid.sql.gz
|
||||
```
|
||||
|
||||
Restart the nginx and php5-fpm services and the website should now be available
|
||||
at `http://localhost/`.
|
||||
### Building Nominatim
|
||||
|
||||
#### Building the latest release version with pip
|
||||
|
||||
Nominatim is easiest to run from its own virtual environment. To create one, run:
|
||||
|
||||
sudo apt-get install virtualenv
|
||||
virtualenv /srv/nominatim-venv
|
||||
|
||||
To install the latest release of Nominatim into the virtual environment, run:
|
||||
|
||||
/srv/nominatim-venv/bin/pip install nominatim-db nominatim-api
|
||||
|
||||
#### Building in legacy CMake mode
|
||||
|
||||
!!! warning
|
||||
Installing Nominatim through CMake is now deprecated. The infrastructure
|
||||
will be removed in Nominatim 5.0. Please switch to pip installation.
|
||||
|
||||
To build Nominatim with CMake, you need to download and unpack the source code
|
||||
as described above.
|
||||
The code must be built in a separate directory. Create the directory and
|
||||
change into it.
|
||||
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
|
||||
Nominatim uses cmake and make for building. Assuming that you have created the
|
||||
build at the same level as the Nominatim source directory run:
|
||||
|
||||
```
|
||||
cmake ../Nominatim
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
!!! warning
|
||||
The default installation no longer compiles the PostgreSQL module that
|
||||
is needed for the legacy tokenizer from older Nominatim versions. If you
|
||||
are upgrading an older database or want to run the
|
||||
[legacy tokenizer](../customize/Tokenizers.md#legacy-tokenizer) for
|
||||
some other reason, you need to enable the PostgreSQL module via
|
||||
cmake: `cmake -DBUILD_MODULE=on ../Nominatim`. To compile the module
|
||||
you need to have the server development headers for PostgreSQL installed.
|
||||
On Ubuntu/Debian run: `sudo apt install postgresql-server-dev-<postgresql version>`
|
||||
The legacy tokenizer is deprecated and will be removed in Nominatim 5.0
|
||||
|
||||
|
||||
Now continue with [importing the database](Import-and-Update.md).
|
||||
Nominatim installs itself into `/usr/local` per default. To choose a different
|
||||
installation directory add `-DCMAKE_INSTALL_PREFIX=<install root>` to the
|
||||
cmake command. Make sure that the `bin` directory is available in your path
|
||||
in that case, e.g.
|
||||
|
||||
```
|
||||
export PATH=<install root>/bin:$PATH
|
||||
```
|
||||
|
||||
Now continue with [importing the database](Import.md).
|
||||
|
||||
72
docs/admin/Maintenance.md
Normal file
72
docs/admin/Maintenance.md
Normal file
@@ -0,0 +1,72 @@
|
||||
This chapter describes the various operations the Nominatim database administrator
|
||||
may use to clean and maintain the database. None of these operations is mandatory
|
||||
but they may help improve the performance and accuracy of results.
|
||||
|
||||
|
||||
## Updating postcodes
|
||||
|
||||
Command: `nominatim refresh --postcodes`
|
||||
|
||||
Postcode centroids (aka 'calculated postcodes') are generated by looking at all
|
||||
postcodes of a country, grouping them and calculating the geometric centroid.
|
||||
There is currently no logic to deal with extreme outliers (typos or other
|
||||
mistakes in OSM data). There is also no check if a postcodes adheres to a
|
||||
country's format, e.g. if Swiss postcodes are 4 digits.
|
||||
|
||||
When running regular updates, postcodes results can be improved by running
|
||||
this command on a regular basis. Note that only the postcode table and the
|
||||
postcode search terms are updated. The postcode that is assigned to each place
|
||||
is only updated when the place is updated.
|
||||
|
||||
The command takes around 70min to run on the planet and needs ca. 40GB of
|
||||
temporary disk space.
|
||||
|
||||
|
||||
## Updating word counts
|
||||
|
||||
Command: `nominatim refresh --word-counts`
|
||||
|
||||
Nominatim keeps frequency statistics about all search terms it indexes. These
|
||||
statistics are currently used to optimise queries to the database. Thus better
|
||||
statistics mean better performance. Word counts are created once after import
|
||||
and are usually sufficient even when running regular updates. You might want
|
||||
to rerun the statistics computation when adding larger amounts of new data,
|
||||
for example, when adding an additional country via `nominatim add-data`.
|
||||
|
||||
|
||||
## Forcing recomputation of places and areas
|
||||
|
||||
Command: `nominatim refresh --data-object [NWR]<id> --data-area [NWR]<id>`
|
||||
|
||||
When running replication updates, Nominatim tries to recompute the search
|
||||
and address information for all places that are affected by a change. But it
|
||||
needs to restrict the total number of changes to make sure it can keep up
|
||||
with the minutely updates. Therefore it will refrain from propagating changes
|
||||
that affect a lot of objects.
|
||||
|
||||
The administrator may force an update of places in the database.
|
||||
`nominatim refresh --data-object` invalidates a single OSM object.
|
||||
`nominatim refresh --data-area` invalidates an OSM object and all dependent
|
||||
objects. That are usually the places that inside its area or around the
|
||||
center of the object. Both commands expect the OSM object as an argument
|
||||
of the form OSM type + OSM id. The type must be `N` (node), `W` (way) or
|
||||
`R` (relation).
|
||||
|
||||
After invalidating the object, indexing must be run again. If continuous
|
||||
update are running in the background, the objects will be recomputed together
|
||||
with the next round of updates. Otherwise you need to run `nominatim index`
|
||||
to finish the recomputation.
|
||||
|
||||
|
||||
## Removing large deleted objects
|
||||
|
||||
Command: `nominatim admin --clean-deleted <PostgreSQL Time Interval>`
|
||||
|
||||
Nominatim refuses to delete very large areas because often these deletions are
|
||||
accidental and are reverted within hours. Instead the deletions are logged in
|
||||
the `import_polygon_delete` table and left to the administrator to clean up.
|
||||
|
||||
To run this command you will need to pass a PostgreSQL time interval. For example to
|
||||
delete any objects that have been deleted more than a month ago you would run:
|
||||
`nominatim admin --clean-deleted '1 month'`
|
||||
|
||||
@@ -1,10 +1,214 @@
|
||||
# Database Migrations
|
||||
|
||||
This page describes database migrations necessary to update existing databases
|
||||
to newer versions of Nominatim.
|
||||
Nominatim offers automatic migrations since version 3.7. Please follow
|
||||
the following steps:
|
||||
|
||||
SQL statements should be executed from the PostgreSQL commandline. Execute
|
||||
`psql nominatim` to enter command line mode.
|
||||
* Stop any updates that are potentially running
|
||||
* Update the backend: `pip install -U nominatim-db`
|
||||
* Go to your project directory and run `nominatim admin --migrate`
|
||||
* Update the frontend: `pip install -U nominatim-api`
|
||||
* (optionally) Restart updates
|
||||
|
||||
If you are still using CMake for the installation of Nominatim, then you
|
||||
need to update the software in one step before migrating the database.
|
||||
It is not recommended to do this while the machine is serving requests.
|
||||
|
||||
Below you find additional migrations and hints about other structural and
|
||||
breaking changes. **Please read them before running the migration.**
|
||||
|
||||
!!! note
|
||||
If you are migrating from a version <3.6, then you still have to follow
|
||||
the manual migration steps up to 3.6.
|
||||
|
||||
## 4.4.0 -> 4.5.0
|
||||
|
||||
### New structure for Python packages
|
||||
|
||||
The nominatim Python package has been split into `nominatim-db` and `nominatim-api`.
|
||||
Any imports need to be adapted accordingly.
|
||||
|
||||
If you are running the Python frontend, change the server module from
|
||||
`nominatim.server.falcon.server` to `nominatim_api.server.falcon.server`.
|
||||
|
||||
If you are using the Nominatim library, all imports need to be changed
|
||||
from `nominatim.api.<module>` to `nominatim_api.<module>`.
|
||||
|
||||
If you have written custom tokenizers or sanitizers, the appropriate modules
|
||||
are now found in `nominatim_db`.
|
||||
|
||||
## 4.2.0 -> 4.3.0
|
||||
|
||||
### New indexes for reverse lookup
|
||||
|
||||
The reverse lookup algorithm has changed slightly to improve performance.
|
||||
This change needs a different index in the database. The required index
|
||||
will be automatically build during migration. Until the new index is available
|
||||
performance of the /reverse endpoint is significantly reduced. You should
|
||||
therefore either remove traffic from the machine before attempting a
|
||||
version update or create the index manually **before** starting the update
|
||||
using the following SQL:
|
||||
|
||||
```sql
|
||||
CREATE INDEX IF NOT EXISTS idx_placex_geometry_reverse_lookupPlaceNode
|
||||
ON placex USING gist (ST_Buffer(geometry, reverse_place_diameter(rank_search)))
|
||||
WHERE rank_address between 4 and 25 AND type != 'postcode'
|
||||
AND name is not null AND linked_place_id is null AND osm_type = 'N';
|
||||
```
|
||||
|
||||
## 4.0.0 -> 4.1.0
|
||||
|
||||
### ICU tokenizer is the new default
|
||||
|
||||
Nominatim now installs the [ICU tokenizer](../customize/Tokenizers.md#icu-tokenizer)
|
||||
by default. This only has an effect on newly installed databases. When
|
||||
updating older databases, it keeps its installed tokenizer. If you still
|
||||
run with the legacy tokenizer, make sure to compile Nominatim with the
|
||||
PostgreSQL module, see [Installation](Installation.md#building-nominatim).
|
||||
|
||||
### geocodejson output changed
|
||||
|
||||
The `type` field of the geocodejson output has changed. It now contains
|
||||
the address class of the object instead of the value of the OSM tag. If
|
||||
your client has used the `type` field, switch them to read `osm_value`
|
||||
instead.
|
||||
|
||||
## 3.7.0 -> 4.0.0
|
||||
|
||||
### NOMINATIM_PHRASE_CONFIG removed
|
||||
|
||||
Custom blacklist configurations for special phrases now need to be handed
|
||||
with the `--config` parameter to `nominatim special-phrases`. Alternatively
|
||||
you can put your custom configuration in the project directory in a file
|
||||
named `phrase-settings.json`.
|
||||
|
||||
Version 3.8 also removes the automatic converter for the php format of
|
||||
the configuration in older versions. If you are updating from Nominatim < 3.7
|
||||
and still work with a custom `phrase-settings.php`, you need to manually
|
||||
convert it into a json format.
|
||||
|
||||
### PHP utils removed
|
||||
|
||||
The old PHP utils have now been removed completely. You need to switch to
|
||||
the appropriate functions of the nominatim command line tool. See
|
||||
[Introducing `nominatim` command line tool](#introducing-nominatim-command-line-tool)
|
||||
below.
|
||||
|
||||
## 3.6.0 -> 3.7.0
|
||||
|
||||
### New format and name of configuration file
|
||||
|
||||
The configuration for an import is now saved in a `.env` file in the project
|
||||
directory. This file follows the dotenv format. For more information, see
|
||||
the [installation chapter](Import.md#configuration-setup-in-env).
|
||||
|
||||
To migrate to the new system, create a new project directory, add the `.env`
|
||||
file and port your custom configuration from `settings/local.php`. Most
|
||||
settings are named similar and only have received a `NOMINATIM_` prefix.
|
||||
Use the default settings in `settings/env.defaults` as a reference.
|
||||
|
||||
### New location for data files
|
||||
|
||||
External data files for Wikipedia importance, postcodes etc. are no longer
|
||||
expected to reside in the source tree by default. Instead they will be searched
|
||||
in the project directory. If you have an automated setup script you must
|
||||
either adapt the download location or explicitly set the location of the
|
||||
files to the old place in your `.env`.
|
||||
|
||||
### Introducing `nominatim` command line tool
|
||||
|
||||
The various php utilities have been replaced with a single `nominatim`
|
||||
command line tool. Make sure to adapt any scripts. There is no direct 1:1
|
||||
matching between the old utilities and the commands of nominatim CLI. The
|
||||
following list gives you a list of nominatim sub-commands that contain
|
||||
functionality of each script:
|
||||
|
||||
* ./utils/setup.php: `import`, `freeze`, `refresh`
|
||||
* ./utils/update.php: `replication`, `add-data`, `index`, `refresh`
|
||||
* ./utils/specialphrases.php: `special-phrases`
|
||||
* ./utils/check_import_finished.php: `admin`
|
||||
* ./utils/warm.php: `admin`
|
||||
* ./utils/export.php: `export`
|
||||
|
||||
Try `nominatim <command> --help` for more information about each subcommand.
|
||||
|
||||
`./utils/query.php` no longer exists in its old form. `nominatim search`
|
||||
provides a replacement but returns different output.
|
||||
|
||||
### Switch to normalized house numbers
|
||||
|
||||
The housenumber column in the placex table uses now normalized version.
|
||||
The automatic migration step will convert the column but this may take a
|
||||
very long time. It is advisable to take the machine offline while doing that.
|
||||
|
||||
## 3.5.0 -> 3.6.0
|
||||
|
||||
### Change of layout of search_name_* tables
|
||||
|
||||
The table need a different index for nearest place lookup. Recreate the
|
||||
indexes using the following shell script:
|
||||
|
||||
```bash
|
||||
for table in `psql -d nominatim -c "SELECT tablename FROM pg_tables WHERE tablename LIKE 'search_name_%'" -tA | grep -v search_name_blank`;
|
||||
do
|
||||
psql -d nominatim -c "DROP INDEX idx_${table}_centroid_place; CREATE INDEX idx_${table}_centroid_place ON ${table} USING gist (centroid) WHERE ((address_rank >= 2) AND (address_rank <= 25)); DROP INDEX idx_${table}_centroid_street; CREATE INDEX idx_${table}_centroid_street ON ${table} USING gist (centroid) WHERE ((address_rank >= 26) AND (address_rank <= 27))";
|
||||
done
|
||||
```
|
||||
|
||||
### Removal of html output
|
||||
|
||||
The debugging UI is no longer directly provided with Nominatim. Instead we
|
||||
now provide a simple Javascript application. Please refer to
|
||||
[Setting up the Nominatim UI](Setup-Nominatim-UI.md) for details on how to
|
||||
set up the UI.
|
||||
|
||||
The icons served together with the API responses have been moved to the
|
||||
nominatim-ui project as well. If you want to keep the `icon` field in the
|
||||
response, you need to set `CONST_MapIcon_URL` to the URL of the `/mapicon`
|
||||
directory of nominatim-ui.
|
||||
|
||||
### Change order during indexing
|
||||
|
||||
When reindexing places during updates, there is now a different order used
|
||||
which needs a different database index. Create it with the following SQL command:
|
||||
|
||||
```sql
|
||||
CREATE INDEX idx_placex_pendingsector_rank_address
|
||||
ON placex
|
||||
USING BTREE (rank_address, geometry_sector)
|
||||
WHERE indexed_status > 0;
|
||||
```
|
||||
|
||||
You can then drop the old index with:
|
||||
|
||||
```sql
|
||||
DROP INDEX idx_placex_pendingsector;
|
||||
```
|
||||
|
||||
### Unused index
|
||||
|
||||
This index has been unused ever since the query using it was changed two years ago. Saves about 12GB on a planet installation.
|
||||
|
||||
```sql
|
||||
DROP INDEX idx_placex_geometry_reverse_lookupPoint;
|
||||
```
|
||||
|
||||
### Switching to dotenv
|
||||
|
||||
As part of the work changing the configuration format, the configuration for
|
||||
the website is now using a separate configuration file. To create the
|
||||
configuration file, run the following command after updating:
|
||||
|
||||
```sh
|
||||
./utils/setup.php --setup-website
|
||||
```
|
||||
|
||||
### Update SQL code
|
||||
|
||||
To update the SQL code to the leatest version run:
|
||||
|
||||
```
|
||||
./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
|
||||
```
|
||||
|
||||
## 3.4.0 -> 3.5.0
|
||||
|
||||
@@ -17,10 +221,32 @@ follows:
|
||||
* download the new Wikipedia tables as described in the import section
|
||||
* reimport the tables: `./utils/setup.php --import-wikipedia-articles`
|
||||
* update the functions: `./utils/setup.php --create-functions --enable-diff-updates`
|
||||
* create a new lookup index:
|
||||
```sql
|
||||
CREATE INDEX idx_placex_wikidata
|
||||
ON placex
|
||||
USING BTREE ((extratags -> 'wikidata'))
|
||||
WHERE extratags ? 'wikidata'
|
||||
AND class = 'place'
|
||||
AND osm_type = 'N'
|
||||
AND rank_search < 26;
|
||||
```
|
||||
* compute importance: `./utils/update.php --recompute-importance`
|
||||
|
||||
The last step takes about 10 hours on the full planet.
|
||||
|
||||
Remove one function (it will be recreated in the next step):
|
||||
|
||||
```sql
|
||||
DROP FUNCTION create_country(hstore,character varying);
|
||||
```
|
||||
|
||||
Finally, update all SQL functions:
|
||||
|
||||
```sh
|
||||
./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
|
||||
```
|
||||
|
||||
## 3.3.0 -> 3.4.0
|
||||
|
||||
### Reorganisation of location_area_country table
|
||||
@@ -38,6 +264,12 @@ CREATE INDEX idx_location_area_country_geometry ON location_area_country USING G
|
||||
CREATE INDEX idx_location_area_country_place_id ON location_area_country USING BTREE (place_id);
|
||||
```
|
||||
|
||||
Finally, update all SQL functions:
|
||||
|
||||
```sh
|
||||
./utils/setup.php --create-functions --enable-diff-updates --create-partition-functions
|
||||
```
|
||||
|
||||
## 3.2.0 -> 3.3.0
|
||||
|
||||
### New database connection string (DSN) format
|
||||
@@ -54,7 +286,7 @@ The new format is
|
||||
|
||||
### Natural Earth country boundaries no longer needed as fallback
|
||||
|
||||
```
|
||||
```sql
|
||||
DROP TABLE country_naturalearthdata;
|
||||
```
|
||||
|
||||
@@ -80,27 +312,37 @@ following command:
|
||||
The reverse algorithm has changed and requires new indexes. Run the following
|
||||
SQL statements to create the indexes:
|
||||
|
||||
```
|
||||
```sql
|
||||
CREATE INDEX idx_placex_geometry_reverse_lookupPoint
|
||||
ON placex USING gist (geometry)
|
||||
WHERE (name is not null or housenumber is not null or rank_address between 26 and 27)
|
||||
AND class not in ('railway','tunnel','bridge','man_made')
|
||||
AND rank_address >= 26 AND indexed_status = 0 AND linked_place_id is null;
|
||||
ON placex
|
||||
USING gist (geometry)
|
||||
WHERE (name IS NOT null or housenumber IS NOT null or rank_address BETWEEN 26 AND 27)
|
||||
AND class NOT IN ('railway','tunnel','bridge','man_made')
|
||||
AND rank_address >= 26
|
||||
AND indexed_status = 0
|
||||
AND linked_place_id IS null;
|
||||
CREATE INDEX idx_placex_geometry_reverse_lookupPolygon
|
||||
ON placex USING gist (geometry)
|
||||
WHERE St_GeometryType(geometry) in ('ST_Polygon', 'ST_MultiPolygon')
|
||||
AND rank_address between 4 and 25 AND type != 'postcode'
|
||||
AND name is not null AND indexed_status = 0 AND linked_place_id is null;
|
||||
AND rank_address between 4 and 25
|
||||
AND type != 'postcode'
|
||||
AND name is not null
|
||||
AND indexed_status = 0
|
||||
AND linked_place_id is null;
|
||||
CREATE INDEX idx_placex_geometry_reverse_placeNode
|
||||
ON placex USING gist (geometry)
|
||||
WHERE osm_type = 'N' AND rank_search between 5 and 25
|
||||
AND class = 'place' AND type != 'postcode'
|
||||
AND name is not null AND indexed_status = 0 AND linked_place_id is null;
|
||||
WHERE osm_type = 'N'
|
||||
AND rank_search between 5 and 25
|
||||
AND class = 'place'
|
||||
AND type != 'postcode'
|
||||
AND name is not null
|
||||
AND indexed_status = 0
|
||||
AND linked_place_id is null;
|
||||
```
|
||||
|
||||
You also need to grant the website user access to the `country_osm_grid` table:
|
||||
|
||||
```
|
||||
```sql
|
||||
GRANT SELECT ON table country_osm_grid to "www-user";
|
||||
```
|
||||
|
||||
@@ -108,7 +350,7 @@ Replace the `www-user` with the user name of your website server if necessary.
|
||||
|
||||
You can now drop the unused indexes:
|
||||
|
||||
```
|
||||
```sql
|
||||
DROP INDEX idx_placex_reverse_geometry;
|
||||
```
|
||||
|
||||
@@ -137,8 +379,8 @@ CREATE INDEX idx_postcode_geometry ON location_postcode USING GIST (geometry);
|
||||
CREATE UNIQUE INDEX idx_postcode_id ON location_postcode USING BTREE (place_id);
|
||||
CREATE INDEX idx_postcode_postcode ON location_postcode USING BTREE (postcode);
|
||||
GRANT SELECT ON location_postcode TO "www-data";
|
||||
drop type if exists nearfeaturecentr cascade;
|
||||
create type nearfeaturecentr as (
|
||||
DROP TYPE IF EXISTS nearfeaturecentr CASCADE;
|
||||
CREATE TYPE nearfeaturecentr AS (
|
||||
place_id BIGINT,
|
||||
keywords int[],
|
||||
rank_address smallint,
|
||||
|
||||
177
docs/admin/Setup-Nominatim-UI.md
Normal file
177
docs/admin/Setup-Nominatim-UI.md
Normal file
@@ -0,0 +1,177 @@
|
||||
# Setting up the Nominatim UI
|
||||
|
||||
Nominatim is a search API, it does not provide a website interface on its
|
||||
own. [nominatim-ui](https://github.com/osm-search/nominatim-ui) offers a
|
||||
small website for testing your setup and inspecting the database content.
|
||||
|
||||
This section provides a quick start how to use nominatim-ui with your
|
||||
installation. For more details, please also have a look at the
|
||||
[README of nominatim-ui](https://github.com/osm-search/nominatim-ui/blob/master/README.md).
|
||||
|
||||
## Installing nominatim-ui
|
||||
|
||||
We provide regular releases of nominatim-ui that contain the packaged website.
|
||||
They do not need any special installation. Just download, configure
|
||||
and run it. Grab the latest release from
|
||||
[nominatim-ui's Github release page](https://github.com/osm-search/nominatim-ui/releases)
|
||||
and unpack it. You can use `nominatim-ui-x.x.x.tar.gz` or `nominatim-ui-x.x.x.zip`.
|
||||
|
||||
Next you need to adapt the UI to your installation. Custom settings need to be
|
||||
put into `dist/theme/config.theme.js`. At a minimum you need to
|
||||
set `Nominatim_API_Endpoint` to point to your Nominatim installation:
|
||||
|
||||
cd nominatim-ui
|
||||
echo "Nominatim_Config.Nominatim_API_Endpoint='https://myserver.org/nominatim/';" > dist/theme/config.theme.js
|
||||
|
||||
For the full set of available settings, have a look at `dist/config.defaults.js`.
|
||||
|
||||
Then you can just test it locally by spinning up a webserver in the `dist`
|
||||
directory. For example, with Python:
|
||||
|
||||
cd nominatim-ui/dist
|
||||
python3 -m http.server 8765
|
||||
|
||||
The website is now available at `http://localhost:8765`.
|
||||
|
||||
## Forwarding searches to nominatim-ui
|
||||
|
||||
Nominatim used to provide the search interface directly by itself when
|
||||
`format=html` was requested. For all endpoints except for `/reverse` and
|
||||
`/lookup` this even used to be the default.
|
||||
|
||||
The following section describes how to set up Apache or nginx, so that your
|
||||
users are forwarded to nominatim-ui when they go to URL that formerly presented
|
||||
the UI.
|
||||
|
||||
### Setting up forwarding in Nginx
|
||||
|
||||
First of all make nominatim-ui available under `/ui` on your webserver:
|
||||
|
||||
``` nginx
|
||||
server {
|
||||
|
||||
# Here is the Nominatim setup as described in the Installation section
|
||||
|
||||
location /ui/ {
|
||||
alias <full path to the nominatim-ui directory>/dist/;
|
||||
index index.html;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Now we need to find out if a URL should be forwarded to the UI. Add the
|
||||
following `map` commands *outside* the server section:
|
||||
|
||||
``` nginx
|
||||
# Inspect the format parameter in the query arguments. We are interested
|
||||
# if it is set to html or something else or if it is missing completely.
|
||||
map $args $format {
|
||||
default default;
|
||||
~(^|&)format=html(&|$) html;
|
||||
~(^|&)format= other;
|
||||
}
|
||||
|
||||
# Determine from the URI and the format parameter above if forwarding is needed.
|
||||
map $uri/$format $forward_to_ui {
|
||||
default 1; # The default is to forward.
|
||||
~^/ui 0; # If the URI point to the UI already, we are done.
|
||||
~/other$ 0; # An explicit non-html format parameter. No forwarding.
|
||||
~/reverse.*/default 0; # Reverse and lookup assume xml format when
|
||||
~/lookup.*/default 0; # no format parameter is given. No forwarding.
|
||||
}
|
||||
```
|
||||
|
||||
The `$forward_to_ui` parameter can now be used to conditionally forward the
|
||||
calls:
|
||||
|
||||
```
|
||||
# When no endpoint is given, default to search.
|
||||
# Need to add a rewrite so that the rewrite rules below catch it correctly.
|
||||
rewrite ^/$ /search;
|
||||
|
||||
location @php {
|
||||
# fastcgi stuff..
|
||||
if ($forward_to_ui) {
|
||||
rewrite ^(/[^/]*) https://yourserver.com/ui$1.html redirect;
|
||||
}
|
||||
}
|
||||
|
||||
location ~ [^/]\.php(/|$) {
|
||||
# fastcgi stuff..
|
||||
if ($forward_to_ui) {
|
||||
rewrite (.*).php https://yourserver.com/ui$1.html redirect;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
!!! warning
|
||||
Be aware that the rewrite commands are slightly different for URIs with and
|
||||
without the .php suffix.
|
||||
|
||||
Reload nginx and the UI should be available.
|
||||
|
||||
### Setting up forwarding in Apache
|
||||
|
||||
First of all make nominatim-ui available in the `ui/` subdirectory where
|
||||
Nominatim is installed. For example, given you have set up an alias under
|
||||
`nominatim` like this:
|
||||
|
||||
``` apache
|
||||
Alias /nominatim /home/vagrant/build/website
|
||||
```
|
||||
|
||||
you need to insert the following rules for nominatim-ui before that alias:
|
||||
|
||||
```
|
||||
<Directory "/home/vagrant/nominatim-ui/dist">
|
||||
DirectoryIndex search.html
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
Alias /nominatim/ui /home/vagrant/nominatim-ui/dist
|
||||
```
|
||||
|
||||
Replace `/home/vagrant/nominatim-ui` with the directory where you have cloned
|
||||
nominatim-ui.
|
||||
|
||||
!!! important
|
||||
The alias for nominatim-ui must come before the alias for the Nominatim
|
||||
website directory.
|
||||
|
||||
To set up forwarding, the Apache rewrite module is needed. Enable it with:
|
||||
|
||||
``` sh
|
||||
sudo a2enmod rewrite
|
||||
```
|
||||
|
||||
Then add rewrite rules to the `Directory` directive of the Nominatim website
|
||||
directory like this:
|
||||
|
||||
``` apache
|
||||
<Directory "/home/vagrant/build/website">
|
||||
Options FollowSymLinks MultiViews
|
||||
AddType text/html .php
|
||||
Require all granted
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
# This must correspond to the URL where nominatim can be found.
|
||||
RewriteBase "/nominatim/"
|
||||
|
||||
# If no endpoint is given, then use search.
|
||||
RewriteRule ^(/|$) "search.php"
|
||||
|
||||
# If format-html is explicitly requested, forward to the UI.
|
||||
RewriteCond %{QUERY_STRING} "format=html"
|
||||
RewriteRule ^([^/]+)(.php)? ui/$1.html [R,END]
|
||||
|
||||
# If no format parameter is there then forward anything
|
||||
# but /reverse and /lookup to the UI.
|
||||
RewriteCond %{QUERY_STRING} "!format="
|
||||
RewriteCond %{REQUEST_URI} "!/lookup"
|
||||
RewriteCond %{REQUEST_URI} "!/reverse"
|
||||
RewriteRule ^([^/]+)(.php)? ui/$1.html [R,END]
|
||||
</Directory>
|
||||
```
|
||||
|
||||
Restart Apache and the UI should be available.
|
||||
232
docs/admin/Update.md
Normal file
232
docs/admin/Update.md
Normal file
@@ -0,0 +1,232 @@
|
||||
# Updating the Database
|
||||
|
||||
There are many different ways to update your Nominatim database.
|
||||
The following section describes how to keep it up-to-date using
|
||||
an [online replication service for OpenStreetMap data](https://wiki.openstreetmap.org/wiki/Planet.osm/diffs)
|
||||
For a list of other methods to add or update data see the output of
|
||||
`nominatim add-data --help`.
|
||||
|
||||
!!! important
|
||||
If you have configured a flatnode file for the import, then you
|
||||
need to keep this flatnode file around for updates.
|
||||
|
||||
### Installing the newest version of Pyosmium
|
||||
|
||||
The replication process uses
|
||||
[Pyosmium](https://docs.osmcode.org/pyosmium/latest/updating_osm_data.html)
|
||||
to download update data from the server.
|
||||
It is recommended to install Pyosmium via pip.
|
||||
Run (as the same user who will later run the updates):
|
||||
|
||||
```sh
|
||||
pip3 install --user osmium
|
||||
```
|
||||
|
||||
### Setting up the update process
|
||||
|
||||
Next the update process needs to be initialised. By default Nominatim is configured
|
||||
to update using the global minutely diffs.
|
||||
|
||||
If you want a different update source you will need to add some settings
|
||||
to `.env`. For example, to use the daily country extracts
|
||||
diffs for Ireland from Geofabrik add the following:
|
||||
|
||||
# base URL of the replication service
|
||||
NOMINATIM_REPLICATION_URL="https://download.geofabrik.de/europe/ireland-and-northern-ireland-updates"
|
||||
# How often upstream publishes diffs (in seconds)
|
||||
NOMINATIM_REPLICATION_UPDATE_INTERVAL=86400
|
||||
# How long to sleep if no update found yet (in seconds)
|
||||
NOMINATIM_REPLICATION_RECHECK_INTERVAL=900
|
||||
|
||||
To set up the update process now run the following command:
|
||||
|
||||
nominatim replication --init
|
||||
|
||||
It outputs the date where updates will start. Recheck that this date is
|
||||
what you expect.
|
||||
|
||||
The `replication --init` command needs to be rerun whenever the replication
|
||||
service is changed.
|
||||
|
||||
### Updating Nominatim
|
||||
|
||||
Nominatim supports different modes how to retrieve the update data from the
|
||||
server. Which one you want to use depends on your exact setup and how often you
|
||||
want to retrieve updates.
|
||||
|
||||
These instructions are for using a single source of updates. If you have
|
||||
imported multiple country extracts and want to keep them
|
||||
up-to-date, [Advanced installations section](Advanced-Installations.md)
|
||||
contains instructions to set up and update multiple country extracts.
|
||||
|
||||
#### One-time mode
|
||||
|
||||
When the `--once` parameter is given, then Nominatim will download exactly one
|
||||
batch of updates and then exit. This one-time mode still respects the
|
||||
`NOMINATIM_REPLICATION_UPDATE_INTERVAL` that you have set. If according to
|
||||
the update interval no new data has been published yet, it will go to sleep
|
||||
until the next expected update and only then attempt to download the next batch.
|
||||
|
||||
The one-time mode is particularly useful if you want to run updates continuously
|
||||
but need to schedule other work in between updates. For example, the main
|
||||
service at osm.org uses it, to regularly recompute postcodes -- a process that
|
||||
must not be run while updates are in progress. Its update script
|
||||
looks like this:
|
||||
|
||||
```sh
|
||||
#!/bin/bash
|
||||
|
||||
# Switch to your project directory.
|
||||
cd /srv/nominatim
|
||||
|
||||
while true; do
|
||||
nominatim replication --once
|
||||
if [ -f "/srv/nominatim/schedule-maintenance" ]; then
|
||||
rm /srv/nominatim/schedule-maintenance
|
||||
nominatim refresh --postcodes
|
||||
fi
|
||||
done
|
||||
```
|
||||
|
||||
A cron job then creates the file `/srv/nominatim/schedule-maintenance` once per night.
|
||||
|
||||
##### One-time mode with systemd
|
||||
|
||||
You can run the one-time mode with a systemd timer & service.
|
||||
|
||||
Create a timer description like `/etc/systemd/system/nominatim-updates.timer`:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Timer to start updates of Nominatim
|
||||
|
||||
[Timer]
|
||||
OnActiveSec=2
|
||||
OnUnitActiveSec=1min
|
||||
Unit=nominatim-updates.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
And then a similar service definition: `/etc/systemd/system/nominatim-updates.service`:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Single updates of Nominatim
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/srv/nominatim
|
||||
ExecStart=nominatim replication --once
|
||||
StandardOutput=append:/var/log/nominatim-updates.log
|
||||
StandardError=append:/var/log/nominatim-updates.error.log
|
||||
User=nominatim
|
||||
Group=nominatim
|
||||
Type=simple
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Replace the `WorkingDirectory` with your project directory. Also adapt user and
|
||||
group names as required. `OnUnitActiveSec` defines how often the individual
|
||||
update command is run.
|
||||
|
||||
Now activate the service and start the updates:
|
||||
|
||||
```
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable nominatim-updates.timer
|
||||
sudo systemctl start nominatim-updates.timer
|
||||
```
|
||||
|
||||
You can stop future data updates, while allowing any current, in-progress
|
||||
update steps to finish, by running `sudo systemctl stop
|
||||
nominatim-updates.timer` and waiting until `nominatim-updates.service` isn't
|
||||
running (`sudo systemctl is-active nominatim-updates.service`). Current output
|
||||
from the update can be seen like above (`systemctl status
|
||||
nominatim-updates.service`).
|
||||
|
||||
|
||||
#### Catch-up mode
|
||||
|
||||
With the `--catch-up` parameter, Nominatim will immediately try to download
|
||||
all changes from the server until the database is up-to-date. The catch-up mode
|
||||
still respects the parameter `NOMINATIM_REPLICATION_MAX_DIFF`. It downloads and
|
||||
applies the changes in appropriate batches until all is done.
|
||||
|
||||
The catch-up mode is foremost useful to bring the database up to speed after the
|
||||
initial import. Give that the service usually is not in production at this
|
||||
point, you can temporarily be a bit more generous with the batch size and
|
||||
number of threads you use for the updates by running catch-up like this:
|
||||
|
||||
```
|
||||
cd /srv/nominatim
|
||||
NOMINATIM_REPLICATION_MAX_DIFF=5000 nominatim replication --catch-up --threads 15
|
||||
```
|
||||
|
||||
The catch-up mode is also useful when you want to apply updates at a lower
|
||||
frequency than what the source publishes. You can set up a cron job to run
|
||||
replication catch-up at whatever interval you desire.
|
||||
|
||||
!!! hint
|
||||
When running scheduled updates with catch-up, it is a good idea to choose
|
||||
a replication source with an update frequency that is an order of magnitude
|
||||
lower. For example, if you want to update once a day, use an hourly updated
|
||||
source. This makes sure that you don't miss an entire day of updates when
|
||||
the source is unexpectedly late to publish its update.
|
||||
|
||||
If you want to use the source with the same update frequency (e.g. a daily
|
||||
updated source with daily updates), use the
|
||||
continuous update mode. It ensures to re-request the newest update until it
|
||||
is published.
|
||||
|
||||
|
||||
#### Continuous updates
|
||||
|
||||
!!! danger
|
||||
This mode is no longer recommended to use and will removed in future
|
||||
releases. systemd is much better
|
||||
suited for running regular updates. Please refer to the setup
|
||||
instructions for running one-time mode with systemd above.
|
||||
|
||||
This is the easiest mode. Simply run the replication command without any
|
||||
parameters:
|
||||
|
||||
nominatim replication
|
||||
|
||||
The update application keeps running forever and retrieves and applies
|
||||
new updates from the server as they are published.
|
||||
|
||||
You can run this command as a simple systemd service. Create a service
|
||||
description like that in `/etc/systemd/system/nominatim-updates.service`:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Continuous updates of Nominatim
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/srv/nominatim
|
||||
ExecStart=nominatim replication
|
||||
StandardOutput=append:/var/log/nominatim-updates.log
|
||||
StandardError=append:/var/log/nominatim-updates.error.log
|
||||
User=nominatim
|
||||
Group=nominatim
|
||||
Type=simple
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Replace the `WorkingDirectory` with your project directory. Also adapt user
|
||||
and group names as required.
|
||||
|
||||
Now activate the service and start the updates:
|
||||
|
||||
```
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable nominatim-updates
|
||||
sudo systemctl start nominatim-updates
|
||||
```
|
||||
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
# Place details
|
||||
|
||||
Lookup details about a single place by id. The default output is HTML for debugging search logic and results.
|
||||
Show all details about a single place saved in the database.
|
||||
|
||||
**The details page (including JSON output) exists for debugging only and must not be downloaded automatically**, see [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/).
|
||||
This API endpoint is meant for visual inspection of the data in the database,
|
||||
mainly together with [Nominatim-UI](https://github.com/osm-search/nominatim-ui/).
|
||||
The parameters of the endpoint and the output may change occasionally between
|
||||
versions of Nominatim. Do not rely on the output in scripts or applications.
|
||||
|
||||
!!! warning
|
||||
The details endpoint at https://nominatim.openstreetmap.org
|
||||
may not used in scripts or bots at all.
|
||||
See [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/).
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
The details API supports the following two request formats:
|
||||
|
||||
```
|
||||
https://nominatim.openstreetmap.org/details?osmtype=[N|W|R]&osmid=<value>&class=<value>
|
||||
``` xml
|
||||
https://nominatim.openstreetmap.org/details?osmtype=[N|W|R]&osmid=<value>&class=<value>
|
||||
```
|
||||
|
||||
`osmtype` and `osmid` are required parameter. The type is one of node (N), way (W)
|
||||
`osmtype` and `osmid` are required parameters. The type is one of node (N), way (W)
|
||||
or relation (R). The id must be a number. The `class` parameter is optional and
|
||||
allows to distinguish between entries, when the corresponding OSM object has more
|
||||
than one main tag. For example, when a place is tagged with `tourism=hotel` and
|
||||
@@ -23,73 +30,103 @@ to get exactly the one you want. If there are multiple places in the database
|
||||
but the `class` parameter is left out, then one of the places will be chosen
|
||||
at random and displayed.
|
||||
|
||||
```
|
||||
https://nominatim.openstreetmap.org/details?place_id=<value>
|
||||
``` xml
|
||||
https://nominatim.openstreetmap.org/details?place_id=<value>
|
||||
```
|
||||
|
||||
Placeids are assigned sequentially during Nominatim data import. The id for a place is different between Nominatim installation (servers) and changes when data gets reimported. Therefore it can't be used as permanent id and shouldn't be used in bug reports.
|
||||
Place IDs are assigned sequentially during Nominatim data import. The ID
|
||||
for a place is different between Nominatim installation (servers) and
|
||||
changes when data gets reimported. Therefore it cannot be used as
|
||||
a permanent id and shouldn't be used in bug reports.
|
||||
|
||||
!!! danger "Deprecation warning"
|
||||
The API can also be used with the URL
|
||||
`https://nominatim.openstreetmap.org/details.php`. This is now deprecated
|
||||
and will be removed in future versions.
|
||||
|
||||
|
||||
Additional optional parameters are explained below.
|
||||
## Parameters
|
||||
|
||||
This section lists additional optional parameters.
|
||||
|
||||
### Output format
|
||||
|
||||
* `format=[html|json]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| json_callback | function name | _unset_ |
|
||||
|
||||
See [Place Output Formats](Output.md) for details on each format. (Default: html)
|
||||
When set, then JSON output will be wrapped in a callback function with
|
||||
the given name. See [JSONP](https://en.wikipedia.org/wiki/JSONP) for more
|
||||
information.
|
||||
|
||||
* `json_callback=<string>`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| pretty | 0 or 1 | 0 |
|
||||
|
||||
Wrap JSON output in a callback function (JSONP) i.e. `<string>(<json>)`.
|
||||
Only has an effect for JSON output formats.
|
||||
|
||||
* `pretty=[0|1]`
|
||||
|
||||
For JSON output will add indentation to make it more human-readable. (Default: 0)
|
||||
`[PHP-only]` Add indentation to the output to make it more human-readable.
|
||||
|
||||
|
||||
### Output details
|
||||
|
||||
* `addressdetails=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| addressdetails | 0 or 1 | 0 |
|
||||
|
||||
Include a breakdown of the address into elements. (Default for JSON: 0, for HTML: 1)
|
||||
When set to 1, include a breakdown of the address into elements.
|
||||
|
||||
* `keywords=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| keywords | 0 or 1 | 0 |
|
||||
|
||||
Include a list of name keywords and address keywords (word ids). (Default: 0)
|
||||
When set to 1, include a list of name keywords and address keywords
|
||||
in the result.
|
||||
|
||||
* `linkedplaces=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| linkedplaces | 0 or 1 | 1 |
|
||||
|
||||
Include details of places higher in the address hierarchy. E.g. for a street this is usually the city, state, postal code, country. (Default: 1)
|
||||
Include details of places that are linked with this one. Places get linked
|
||||
together when they are different forms of the same physical object. Nominatim
|
||||
links two kinds of objects together: place nodes get linked with the
|
||||
corresponding administrative boundaries. Waterway relations get linked together with their
|
||||
members.
|
||||
|
||||
* `hierarchy=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| hierarchy | 0 or 1 | 0 |
|
||||
|
||||
Include details of places lower in the address hierarchy. E.g. for a city this usually a list of streets, suburbs, rivers. (Default for JSON: 0, for HTML: 1)
|
||||
Include details of places lower in the address hierarchy.
|
||||
|
||||
* `group_hierarchy=[0|1]`
|
||||
`[Python-only]` will only return properly parented places. These are address
|
||||
or POI-like places that reuse the address of their parent street or place.
|
||||
|
||||
For JSON output will group the places by type. (Default: 0)
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| group_hierarchy | 0 or 1 | 0 |
|
||||
|
||||
* `polygon_geojson=[0|1]`
|
||||
When set to 1, the output of the address hierarchy will be
|
||||
grouped by type.
|
||||
|
||||
Include geometry of result. (Default for JSON: 0, for HTML: 1)
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| polygon_geojson | 0 or 1 | 0 |
|
||||
|
||||
|
||||
Include geometry of result.
|
||||
|
||||
### Language of results
|
||||
|
||||
* `accept-language=<browser language string>`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| accept-language | browser language string | content of "Accept-Language" HTTP header |
|
||||
|
||||
Preferred language order for showing result, overrides the value
|
||||
specified in the "Accept-Language" HTTP header.
|
||||
Either use a standard RFC2616 accept-language string or a simple
|
||||
comma-separated list of language codes.
|
||||
Preferred language order for showing search results. This may either be
|
||||
a simple comma-separated list of language codes or have the same format
|
||||
as the ["Accept-Language" HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
##### HTML
|
||||
|
||||
[https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407](https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407)
|
||||
|
||||
##### JSON
|
||||
|
||||
[https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407&format=json](https://nominatim.openstreetmap.org/details.php?osmtype=W&osmid=38210407&format=json)
|
||||
|
||||
@@ -35,7 +35,7 @@ it contains the county/state/country across the border.
|
||||
#### 3. I get different counties/states/countries when I change the zoom parameter in the reverse query. How is that possible?
|
||||
|
||||
This is basically the same problem as in the previous answer.
|
||||
The zoom level influences at which [search rank](https://wiki.openstreetmap.org/wiki/Nominatim/Development_overview#Country_to_street_level) Nominatim starts looking
|
||||
The zoom level influences at which [search rank](../customize/Ranking.md#search-rank) Nominatim starts looking
|
||||
for the closest object. So the closest house number maybe on one side of the
|
||||
border while the closest street is on the other. As the address details contain
|
||||
the address of the closest object found, you might sometimes get one result,
|
||||
@@ -58,4 +58,28 @@ The [Overpass API](https://wiki.openstreetmap.org/wiki/Overpass_API) is more
|
||||
suited for these kinds of queries.
|
||||
|
||||
That said if you installed your own Nominatim instance you can use the
|
||||
`/utils/export.php` PHP script as basis to return such lists.
|
||||
`nominatim export` PHP script as basis to return such lists.
|
||||
|
||||
#### 7. My result has a wrong postcode. Where does it come from?
|
||||
|
||||
Most places in OSM don't have a postcode, so Nominatim tries to interpolate
|
||||
one. It first look at all the places that make up the address of the place.
|
||||
If one of them has a postcode defined, this is the one to be used. When
|
||||
none of the address parts has a postcode either, Nominatim interpolates one
|
||||
from the surrounding objects. If the postcode is for your result is one, then
|
||||
most of the time there is an OSM object with the wrong postcode nearby.
|
||||
|
||||
To find the bad postcode, go to
|
||||
[https://nominatim.openstreetmap.org](https://nominatim.openstreetmap.org)
|
||||
and search for your place. When you have found it, click on the 'details' link
|
||||
under the result to go to the details page. There is a field 'Computed Postcode'
|
||||
which should display the bad postcode. Click on the 'how?' link. A small
|
||||
explanation text appears. It contains a link to a query for Overpass Turbo.
|
||||
Click on that and you get a map with all places in the area that have the bad
|
||||
postcode. If none is displayed, zoom the map out a bit and then click on 'Run'.
|
||||
|
||||
Now go to [OpenStreetMap](https://openstreetmap.org) and fix the error you
|
||||
have just found. It will take at least a day for Nominatim to catch up with
|
||||
your data fix. Sometimes longer, depending on how much editing activity is in
|
||||
the area.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
The lookup API allows to query the address and other details of one or
|
||||
multiple OSM objects like node, way or relation.
|
||||
|
||||
## Parameters
|
||||
## Endpoint
|
||||
|
||||
The lookup API has the following format:
|
||||
|
||||
@@ -15,71 +15,140 @@ The lookup API has the following format:
|
||||
prefixed with its type, one of node(N), way(W) or relation(R). Up to 50 ids
|
||||
can be queried at the same time.
|
||||
|
||||
Additional optional parameters are explained below.
|
||||
!!! danger "Deprecation warning"
|
||||
The API can also be used with the URL
|
||||
`https://nominatim.openstreetmap.org/lookup.php`. This is now deprecated
|
||||
and will be removed in future versions.
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
This section lists additional optional parameters.
|
||||
|
||||
### Output format
|
||||
|
||||
* `format=[xml|json|jsonv2|geojson|geocodejson]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| format | one of: `xml`, `json`, `jsonv2`, `geojson`, `geocodejson` | `jsonv2` |
|
||||
|
||||
See [Place Output Formats](Output.md) for details on each format. (Default: xml)
|
||||
See [Place Output Formats](Output.md) for details on each format.
|
||||
|
||||
* `json_callback=<string>`
|
||||
|
||||
Wrap JSON output in a callback function (JSONP) i.e. `<string>(<json>)`.
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| json_callback | function name | _unset_ |
|
||||
|
||||
When given, then JSON output will be wrapped in a callback function with
|
||||
the given name. See [JSONP](https://en.wikipedia.org/wiki/JSONP) for more
|
||||
information.
|
||||
|
||||
Only has an effect for JSON output formats.
|
||||
|
||||
|
||||
### Output details
|
||||
|
||||
* `addressdetails=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| addressdetails | 0 or 1 | 0 |
|
||||
|
||||
Include a breakdown of the address into elements. (Default: 0)
|
||||
When set to 1, include a breakdown of the address into elements.
|
||||
The exact content of the address breakdown depends on the output format.
|
||||
|
||||
!!! tip
|
||||
If you are interested in a stable classification of address categories
|
||||
(suburb, city, state, etc), have a look at the `geocodejson` format.
|
||||
All other formats return classifications according to OSM tagging.
|
||||
There is a much larger set of categories and they are not always consistent,
|
||||
which makes them very hard to work with.
|
||||
|
||||
|
||||
* `extratags=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| extratags | 0 or 1 | 0 |
|
||||
|
||||
Include additional information in the result if available,
|
||||
e.g. wikipedia link, opening hours. (Default: 0)
|
||||
When set to 1, the response include any additional information in the result
|
||||
that is available in the database, e.g. wikipedia link, opening hours.
|
||||
|
||||
|
||||
* `namedetails=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| namedetails | 0 or 1 | 0 |
|
||||
|
||||
Include a list of alternative names in the results. These may include
|
||||
language variants, references, operator and brand. (Default: 0)
|
||||
When set to 1, include a full list of names for the result. These may include
|
||||
language variants, older names, references and brand.
|
||||
|
||||
|
||||
### Language of results
|
||||
|
||||
* `accept-language=<browser language string>`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| accept-language | browser language string | content of "Accept-Language" HTTP header |
|
||||
|
||||
Preferred language order for showing search results, overrides the value
|
||||
specified in the "Accept-Language" HTTP header.
|
||||
Either use a standard RFC2616 accept-language string or a simple
|
||||
comma-separated list of language codes.
|
||||
Preferred language order for showing search results. This may either be
|
||||
a simple comma-separated list of language codes or have the same format
|
||||
as the ["Accept-Language" HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
|
||||
|
||||
!!! tip
|
||||
First-time users of Nominatim tend to be confused that they get different
|
||||
results when using Nominatim in the browser versus in a command-line tool
|
||||
like wget or curl. The command-line tools
|
||||
usually don't send any Accept-Language header, prompting Nominatim
|
||||
to show results in the local language. Browsers on the contrary always
|
||||
send the currently chosen browser language.
|
||||
|
||||
|
||||
### Polygon output
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| polygon_geojson | 0 or 1 | 0 |
|
||||
| polygon_kml | 0 or 1 | 0 |
|
||||
| polygon_svg | 0 or 1 | 0 |
|
||||
| polygon_text | 0 or 1 | 0 |
|
||||
|
||||
Add the full geometry of the place to the result output. Output formats
|
||||
in GeoJSON, KML, SVG or WKT are supported. Only one of these
|
||||
options can be used at a time.
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| polygon_threshold | floating-point number | 0.0 |
|
||||
|
||||
When one of the polygon_* outputs is chosen, return a simplified version
|
||||
of the output geometry. The parameter describes the
|
||||
tolerance in degrees with which the geometry may differ from the original
|
||||
geometry. Topology is preserved in the geometry.
|
||||
|
||||
|
||||
### Other
|
||||
|
||||
* `email=<valid email address>`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| email | valid email address | _unset_ |
|
||||
|
||||
If you are making large numbers of request please include an appropriate email
|
||||
address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
|
||||
address to identify your requests. See Nominatim's
|
||||
[Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
|
||||
|
||||
* `debug=[0|1]`
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| debug | 0 or 1 | 0 |
|
||||
|
||||
Output assorted developer debug information. Data on internals of Nominatim's
|
||||
"Search Loop" logic, and SQL queries. The output is (rough) HTML format.
|
||||
This overrides the specified machine readable format. (Default: 0)
|
||||
"search loop" logic, and SQL queries. The output is HTML format.
|
||||
This overrides the specified machine readable format.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
##### XML
|
||||
|
||||
[https://nominatim.openstreetmap.org/lookup?osm_ids=R146656,W104393803,N240109189](https://nominatim.openstreetmap.org/lookup?osm_ids=R146656,W104393803,N240109189)
|
||||
[https://nominatim.openstreetmap.org/lookup?osm_ids=R146656,W104393803,N240109189](https://nominatim.openstreetmap.org/lookup?osm_ids=R146656,W50637691,N240109189)
|
||||
|
||||
```xml
|
||||
<lookupresults timestamp="Mon, 29 Jun 15 18:01:33 +0000" attribution="Data © OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright" querystring="R146656,W104393803,N240109189" polygon="false">
|
||||
<place place_id="127761056" osm_type="relation" osm_id="146656" place_rank="16" lat="53.4791466" lon="-2.2447445" display_name="Manchester, Greater Manchester, North West England, England, United Kingdom" class="boundary" type="administrative" importance="0.704893333438333">
|
||||
<lookupresults timestamp="Mon, 28 Mar 22 14:38:54 +0000" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" querystring="R146656,W50637691,N240109189" more_url="">
|
||||
<place place_id="282236157" osm_type="relation" osm_id="146656" place_rank="16" address_rank="16" boundingbox="53.3401044,53.5445923,-2.3199185,-2.1468288" lat="53.44246175" lon="-2.2324547359718547" display_name="Manchester, Greater Manchester, North West England, England, United Kingdom" class="boundary" type="administrative" importance="0.35">
|
||||
<city>Manchester</city>
|
||||
<county>Greater Manchester</county>
|
||||
<state_district>North West England</state_district>
|
||||
@@ -87,21 +156,20 @@ This overrides the specified machine readable format. (Default: 0)
|
||||
<country>United Kingdom</country>
|
||||
<country_code>gb</country_code>
|
||||
</place>
|
||||
<place place_id="77769745" osm_type="way" osm_id="104393803" place_rank="30" lat="52.5162024" lon="13.3777343363579" display_name="Brandenburg Gate, 1, Pariser Platz, Mitte, Berlin, 10117, Germany" class="tourism" type="attraction" importance="0.443472858361592">
|
||||
<attraction>Brandenburg Gate</attraction>
|
||||
<house_number>1</house_number>
|
||||
<pedestrian>Pariser Platz</pedestrian>
|
||||
<suburb>Mitte</suburb>
|
||||
<city_district>Mitte</city_district>
|
||||
<city>Berlin</city>
|
||||
<state>Berlin</state>
|
||||
<postcode>10117</postcode>
|
||||
<place place_id="115462561" osm_type="way" osm_id="50637691" place_rank="30" address_rank="30" boundingbox="52.3994612,52.3996426,13.0479574,13.0481754" lat="52.399550700000006" lon="13.048066846939687" display_name="Brandenburger Tor, Brandenburger Straße, Historische Innenstadt, Innenstadt, Potsdam, Brandenburg, 14467, Germany" class="tourism" type="attraction" importance="0.29402874005524">
|
||||
<tourism>Brandenburger Tor</tourism>
|
||||
<road>Brandenburger Straße</road>
|
||||
<suburb>Historische Innenstadt</suburb>
|
||||
<city>Potsdam</city>
|
||||
<state>Brandenburg</state>
|
||||
<postcode>14467</postcode>
|
||||
<country>Germany</country>
|
||||
<country_code>de</country_code>
|
||||
</place>
|
||||
<place place_id="2570600569" osm_type="node" osm_id="240109189" place_rank="15" lat="52.5170365" lon="13.3888599" display_name="Berlin, Germany" class="place" type="city" importance="0.822149797630868">
|
||||
<place place_id="567505" osm_type="node" osm_id="240109189" place_rank="15" address_rank="16" boundingbox="52.3586925,52.6786925,13.2396024,13.5596024" lat="52.5186925" lon="13.3996024" display_name="Berlin, 10178, Germany" class="place" type="city" importance="0.78753902824914">
|
||||
<city>Berlin</city>
|
||||
<state>Berlin</state>
|
||||
<postcode>10178</postcode>
|
||||
<country>Germany</country>
|
||||
<country_code>de</country_code>
|
||||
</place>
|
||||
@@ -110,38 +178,50 @@ This overrides the specified machine readable format. (Default: 0)
|
||||
|
||||
##### JSON with extratags
|
||||
|
||||
[https://nominatim.openstreetmap.org/lookup?osm_ids=W50637691&format=json](https://nominatim.openstreetmap.org/lookup?osm_ids=W50637691&format=json)
|
||||
[https://nominatim.openstreetmap.org/lookup?osm_ids=W50637691&format=json&extratags=1](https://nominatim.openstreetmap.org/lookup?osm_ids=W50637691&format=json&extratags=1)
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"place_id": "84271358",
|
||||
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
|
||||
"osm_type": "way",
|
||||
"osm_id": "50637691",
|
||||
"lat": "52.39955055",
|
||||
"lon": "13.04806574678",
|
||||
"display_name": "Brandenburger Tor, Brandenburger Straße, Nördliche Innenstadt, Innenstadt, Potsdam, Brandenburg, 14467, Germany",
|
||||
"class": "historic",
|
||||
"type": "city_gate",
|
||||
"importance": "0.221233780277011",
|
||||
"address": {
|
||||
"address29": "Brandenburger Tor",
|
||||
"pedestrian": "Brandenburger Straße",
|
||||
"suburb": "Nördliche Innenstadt",
|
||||
"city": "Potsdam",
|
||||
"state": "Brandenburg",
|
||||
"postcode": "14467",
|
||||
"country": "Germany",
|
||||
"country_code": "de"
|
||||
},
|
||||
"extratags": {
|
||||
"image": "http://commons.wikimedia.org/wiki/File:Potsdam_brandenburger_tor.jpg",
|
||||
"wikidata": "Q695045",
|
||||
"wikipedia": "de:Brandenburger Tor (Potsdam)",
|
||||
"wheelchair": "yes",
|
||||
"description": "Kleines Brandenburger Tor in Potsdam"
|
||||
}
|
||||
}
|
||||
{
|
||||
"place_id": 115462561,
|
||||
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
|
||||
"osm_type": "way",
|
||||
"osm_id": 50637691,
|
||||
"boundingbox": [
|
||||
"52.3994612",
|
||||
"52.3996426",
|
||||
"13.0479574",
|
||||
"13.0481754"
|
||||
],
|
||||
"lat": "52.399550700000006",
|
||||
"lon": "13.048066846939687",
|
||||
"display_name": "Brandenburger Tor, Brandenburger Straße, Historische Innenstadt, Innenstadt, Potsdam, Brandenburg, 14467, Germany",
|
||||
"class": "tourism",
|
||||
"type": "attraction",
|
||||
"importance": 0.2940287400552381,
|
||||
"address": {
|
||||
"tourism": "Brandenburger Tor",
|
||||
"road": "Brandenburger Straße",
|
||||
"suburb": "Historische Innenstadt",
|
||||
"city": "Potsdam",
|
||||
"state": "Brandenburg",
|
||||
"postcode": "14467",
|
||||
"country": "Germany",
|
||||
"country_code": "de"
|
||||
},
|
||||
"extratags": {
|
||||
"image": "http://commons.wikimedia.org/wiki/File:Potsdam_brandenburger_tor.jpg",
|
||||
"heritage": "4",
|
||||
"wikidata": "Q695045",
|
||||
"architect": "Carl von Gontard;Georg Christian Unger",
|
||||
"wikipedia": "de:Brandenburger Tor (Potsdam)",
|
||||
"wheelchair": "yes",
|
||||
"description": "Kleines Brandenburger Tor in Potsdam",
|
||||
"heritage:website": "http://www.bldam-brandenburg.de/images/stories/PDF/DML%202012/04-p-internet-13.pdf",
|
||||
"heritage:operator": "bldam",
|
||||
"architect:wikidata": "Q68768;Q95223",
|
||||
"year_of_construction": "1771"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -2,19 +2,17 @@
|
||||
|
||||
The [/reverse](Reverse.md), [/search](Search.md) and [/lookup](Lookup.md)
|
||||
API calls produce very similar output which is explained in this section.
|
||||
There is one section for each format which is selectable via the `format`
|
||||
parameter.
|
||||
There is one section for each format. The format correspond to what was
|
||||
selected via the `format` parameter.
|
||||
|
||||
## Formats
|
||||
|
||||
### JSON
|
||||
## JSON
|
||||
|
||||
The JSON format returns an array of places (for search and lookup) or
|
||||
a single place (for reverse) of the following format:
|
||||
|
||||
```
|
||||
{
|
||||
"place_id": "100149",
|
||||
"place_id": 100149,
|
||||
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
|
||||
"osm_type": "node",
|
||||
"osm_id": "107775",
|
||||
@@ -30,6 +28,7 @@ a single place (for reverse) of the following format:
|
||||
"city": "London",
|
||||
"state_district": "Greater London",
|
||||
"state": "England",
|
||||
"ISO3166-2-lvl4": "GB-ENG",
|
||||
"postcode": "SW1A 2DU",
|
||||
"country": "United Kingdom",
|
||||
"country_code": "gb"
|
||||
@@ -41,13 +40,13 @@ a single place (for reverse) of the following format:
|
||||
"wikipedia": "en:London",
|
||||
"population": "8416535"
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
The possible fields are:
|
||||
|
||||
* `place_id` - reference to the Nominatim internal database ID ([see notes](#place_id-is-not-a-persistent-id))
|
||||
* `osm_type`, `osm_id` - reference to the OSM object
|
||||
* `osm_type`, `osm_id` - reference to the OSM object ([see notes](#osm-reference))
|
||||
* `boundingbox` - area of corner coordinates ([see notes](#boundingbox))
|
||||
* `lat`, `lon` - latitude and longitude of the centroid of the object
|
||||
* `display_name` - full comma-separated address
|
||||
@@ -62,22 +61,22 @@ The possible fields are:
|
||||
* `geojson`, `svg`, `geotext`, `geokml` - full geometry
|
||||
(only with the appropriate `polygon_*` parameter)
|
||||
|
||||
### JSONv2
|
||||
## JSONv2
|
||||
|
||||
This is the same as the JSON format with two changes:
|
||||
|
||||
* `class` renamed to `category`
|
||||
* additional field `place_rank` with the search rank of the object
|
||||
|
||||
### GeoJSON
|
||||
## GeoJSON
|
||||
|
||||
This format follows the [RFC7946](https://geojson.org). Every feature includes
|
||||
a bounding box (`bbox`).
|
||||
|
||||
The feature list has the following fields:
|
||||
The properties object has the following fields:
|
||||
|
||||
* `place_id` - reference to the Nominatim internal database ID ([see notes](#place_id-is-not-a-persistent-id))
|
||||
* `osm_type`, `osm_id` - reference to the OSM object
|
||||
* `osm_type`, `osm_id` - reference to the OSM object ([see notes](#osm-reference))
|
||||
* `category`, `type` - key and value of the main OSM tag
|
||||
* `display_name` - full comma-separated address
|
||||
* `place_rank` - class search rank
|
||||
@@ -92,14 +91,17 @@ The feature list has the following fields:
|
||||
Use `polygon_geojson` to output the full geometry of the object instead
|
||||
of the centroid.
|
||||
|
||||
### GeocodeJSON
|
||||
## GeocodeJSON
|
||||
|
||||
The GeocodeJSON format follows the
|
||||
[GeocodeJSON spec 0.1.0](https://github.com/geocoders/geocodejson-spec).
|
||||
The following feature attributes are implemented:
|
||||
|
||||
* `osm_type`, `osm_id` - reference to the OSM object (unofficial extension)
|
||||
* `type` - value of the main tag of the object (e.g. residential, restaurant, ...)
|
||||
* `osm_type`, `osm_id` - reference to the OSM object (unofficial extension, [see notes](#osm-reference))
|
||||
* `type` - the 'address level' of the object ('house', 'street', `district`, `city`,
|
||||
`county`, `state`, `country`, `locality`)
|
||||
* `osm_key`- key of the main tag of the OSM object (e.g. boundary, highway, amenity)
|
||||
* `osm_value` - value of the main tag of the OSM object (e.g. residential, restaurant)
|
||||
* `label` - full comma-separated address
|
||||
* `name` - localised name of the place
|
||||
* `housenumber`, `street`, `locality`, `district`, `postcode`, `city`,
|
||||
@@ -110,24 +112,25 @@ The following feature attributes are implemented:
|
||||
Use `polygon_geojson` to output the full geometry of the object instead
|
||||
of the centroid.
|
||||
|
||||
### XML
|
||||
## XML
|
||||
|
||||
The XML response returns one or more place objects in slightly different
|
||||
formats depending on the API call.
|
||||
|
||||
#### Reverse
|
||||
### Reverse
|
||||
|
||||
```
|
||||
<reversegeocode timestamp="Sat, 11 Aug 18 11:53:21 +0000"
|
||||
attribution="Data © OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright"
|
||||
querystring="lat=48.400381&lon=11.745876&zoom=5&format=xml">
|
||||
<result place_id="179509537" osm_type="relation" osm_id="2145268" ref="BY"
|
||||
<result place_id="179509537" osm_type="relation" osm_id="2145268" ref="BY" place_rank="15" address_rank="15"
|
||||
lat="48.9467562" lon="11.4038717"
|
||||
boundingbox="47.2701114,50.5647142,8.9763497,13.8396373">
|
||||
Bavaria, Germany
|
||||
</result>
|
||||
<addressparts>
|
||||
<state>Bavaria</state>
|
||||
<ISO3166-2-lvl4>DE-BY</ISO3166-2-lvl4>
|
||||
<country>Germany</country>
|
||||
<country_code>de</country_code>
|
||||
</addressparts>
|
||||
@@ -148,7 +151,7 @@ attribution to OSM and the original querystring.
|
||||
The place information can be found in the `result` element. The attributes of that element contain:
|
||||
|
||||
* `place_id` - reference to the Nominatim internal database ID ([see notes](#place_id-is-not-a-persistent-id))
|
||||
* `osm_type`, `osm_id` - reference to the OSM object
|
||||
* `osm_type`, `osm_id` - reference to the OSM object ([see notes](#osm-reference))
|
||||
* `ref` - content of `ref` tag if it exists
|
||||
* `lat`, `lon` - latitude and longitude of the centroid of the object
|
||||
* `boundingbox` - comma-separated list of corner coordinates ([see notes](#boundingbox))
|
||||
@@ -159,14 +162,14 @@ The full address of the result can be found in the content of the
|
||||
Additional information requested with `addressdetails=1`, `extratags=1` and
|
||||
`namedetails=1` can be found in extra elements.
|
||||
|
||||
#### Search and Lookup
|
||||
### Search and Lookup
|
||||
|
||||
```
|
||||
<searchresults timestamp="Sat, 11 Aug 18 11:55:35 +0000"
|
||||
attribution="Data © OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright"
|
||||
querystring="london" polygon="false" exclude_place_ids="100149"
|
||||
more_url="https://nominatim.openstreetmap.org/search.php?q=london&addressdetails=1&extratags=1&exclude_place_ids=100149&format=xml&accept-language=en-US%2Cen%3Bq%3D0.7%2Cde%3Bq%3D0.3">
|
||||
<place place_id="100149" osm_type="node" osm_id="107775" place_rank="15"
|
||||
<place place_id="100149" osm_type="node" osm_id="107775" place_rank="15" address_rank="15"
|
||||
boundingbox="51.3473219,51.6673219,-0.2876474,0.0323526" lat="51.5073219" lon="-0.1276474"
|
||||
display_name="London, Greater London, England, SW1A 2DU, United Kingdom"
|
||||
class="place" type="city" importance="0.9654895765402"
|
||||
@@ -181,6 +184,7 @@ Additional information requested with `addressdetails=1`, `extratags=1` and
|
||||
<city>London</city>
|
||||
<state_district>Greater London</state_district>
|
||||
<state>England</state>
|
||||
<ISO3166-2-lvl4>GB-ENG</ISO3166-2-lvl4>
|
||||
<postcode>SW1A 2DU</postcode>
|
||||
<country>United Kingdom</country>
|
||||
<country_code>gb</country_code>
|
||||
@@ -203,11 +207,12 @@ The place information can be found in the `place` elements, of which there may
|
||||
be more than one. The attributes of that element contain:
|
||||
|
||||
* `place_id` - reference to the Nominatim internal database ID ([see notes](#place_id-is-not-a-persistent-id))
|
||||
* `osm_type`, `osm_id` - reference to the OSM object
|
||||
* `osm_type`, `osm_id` - reference to the OSM object ([see notes](#osm-reference))
|
||||
* `ref` - content of `ref` tag if it exists
|
||||
* `lat`, `lon` - latitude and longitude of the centroid of the object
|
||||
* `boundingbox` - comma-separated list of corner coordinates ([see notes](#boundingbox))
|
||||
* `place_rank` - class search rank
|
||||
* `place_rank` - class [search rank](../customize/Ranking.md#search-rank)
|
||||
* `address_rank` - place [address rank](../customize/Ranking.md#address-rank)
|
||||
* `display_name` - full comma-separated address
|
||||
* `class`, `type` - key and value of the main OSM tag
|
||||
* `importance` - computed importance rank
|
||||
@@ -217,39 +222,61 @@ When `addressdetails=1` is requested, the localised address parts appear
|
||||
as subelements with the type of the address part.
|
||||
|
||||
Additional information requested with `extratags=1` and `namedetails=1` can
|
||||
be found in extra elements as sub-element of each place.
|
||||
be found in extra elements as sub-element of `extratags` and `namedetails`
|
||||
respectively.
|
||||
|
||||
|
||||
## Notes on field values
|
||||
|
||||
### place_id is not a persistent id
|
||||
|
||||
The `place_id` is created when a Nominatim database gets installed. A
|
||||
single place will have a different value on another server or even when
|
||||
the same data gets re-imported. It's thus not useful to treat it as
|
||||
permanent for later use.
|
||||
The `place_id` is an internal identifier that is assigned data is imported
|
||||
into a Nominatim database. The same OSM object will have a different value
|
||||
on another server. It may even change its ID on the same server when it is
|
||||
removed and reimported while updating the database with fresh OSM data.
|
||||
It is thus not useful to treat it as permanent for later use.
|
||||
|
||||
The combination `osm_type`+`osm_id` is slighly better but remember in
|
||||
The combination `osm_type`+`osm_id` is slightly better but remember in
|
||||
OpenStreetMap mappers can delete, split, recreate places (and those
|
||||
get a new `osm_id`), there is no link between those old and new ids.
|
||||
Places can also change their meaning without changing their `osm_id`,
|
||||
e.g. when a restaurant is retagged as supermarket. For a more in-depth
|
||||
discussion see [Permanent ID](https://wiki.openstreetmap.org/wiki/Permanent_ID).
|
||||
|
||||
Nominatim merges some places (e.g. center node of a city with the boundary
|
||||
relation) so `osm_type`+`osm_id`+`class_name` would be more unique.
|
||||
If you need an ID that is consistent over multiple installations of Nominatim,
|
||||
then you should use the combination of `osm_type`+`osm_id`+`class`.
|
||||
|
||||
### OSM reference
|
||||
|
||||
Nominatim may sometimes return special objects that do not correspond directly
|
||||
to an object in OpenStreetMap. These are:
|
||||
|
||||
* **Postcodes**. Nominatim returns an postcode point created from all mapped
|
||||
postcodes of the same name. The class and type of these object is `place=postcdode`.
|
||||
No `osm_type` and `osm_id` are included in the result.
|
||||
* **Housenumber interpolations**. Nominatim returns a single interpolated
|
||||
housenumber from the interpolation way. The class and type are `place=house`
|
||||
and `osm_type` and `osm_id` correspond to the interpolation way in OSM.
|
||||
* **TIGER housenumber.** Nominatim returns a single interpolated housenumber
|
||||
from the TIGER data. The class and type are `place=house`
|
||||
and `osm_type` and `osm_id` correspond to the street mentioned in the result.
|
||||
|
||||
Please note that the `osm_type` and `osm_id` returned may be changed in the
|
||||
future. You should not expect to only find `node`, `way` and `relation` for
|
||||
the type.
|
||||
|
||||
### boundingbox
|
||||
|
||||
Comma separated list of min latitude, max latitude, min longitude, max longitude.
|
||||
The whole planet would be `-90,90,-180,180`.
|
||||
|
||||
Can we used to pan and center the map on the result, for example with leafletjs
|
||||
Can be used to pan and center the map on the result, for example with leafletjs
|
||||
mapping library
|
||||
`map.fitBounds([[bbox[0],bbox[2]],[bbox[1],bbox[3]]], {padding: [20, 20], maxzoom: 16});`
|
||||
|
||||
Bounds crossing the antimeridian have a min latitude -180 and max latitude 180,
|
||||
essentially covering the planet (See [issue 184](https://github.com/openstreetmap/Nominatim/issues/184)).
|
||||
essentially covering the entire planet
|
||||
(see [issue 184](https://github.com/openstreetmap/Nominatim/issues/184)).
|
||||
|
||||
### addressdetails
|
||||
|
||||
@@ -258,17 +285,18 @@ with a designation label. Per default the following labels may appear:
|
||||
|
||||
* continent
|
||||
* country, country_code
|
||||
* region, state, state_district, county
|
||||
* region, state, state_district, county, ISO3166-2-lvl<admin_level>
|
||||
* municipality, city, town, village
|
||||
* city_district, district, borough, suburb, subdivision
|
||||
* hamlet, croft, isolated_dwelling
|
||||
* neighbourhood, allotments, quarter
|
||||
* city_block, residental, farm, farmyard, industrial, commercial, retail
|
||||
* city_block, residential, farm, farmyard, industrial, commercial, retail
|
||||
* road
|
||||
* house_number, house_name
|
||||
* emergency, historic, military, natural, landuse, place, railway,
|
||||
man_made, aerialway, boundary, amenity, aeroway, club, craft, leisure,
|
||||
office, mountain_pass, shop, tourism, bridge, tunnel, waterway
|
||||
* postcode
|
||||
|
||||
They roughly correspond to the classification of the OpenStreetMap data
|
||||
according to either the `place` tag or the main key of the object.
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
### Nominatim API
|
||||
!!! Attention
|
||||
The current version of Nominatim implements two different search frontends:
|
||||
the old PHP frontend and the new Python frontend. They have a very similar
|
||||
API but differ in some implementation details. These are marked in the
|
||||
documentation as `[Python-only]` or `[PHP-only]`.
|
||||
|
||||
Nominatim indexes named (or numbered) features within the OpenStreetMap (OSM) dataset and a subset of other unnamed features (pubs, hotels, churches, etc).
|
||||
`https://nominatim.openstreetmap.org` implements the **Python frontend**.
|
||||
So users should refer to the **`[Python-only]`** comments.
|
||||
|
||||
Its API has the following endpoints for querying the data:
|
||||
This section describes the API V1 of the Nominatim web service. The
|
||||
service offers the following endpoints:
|
||||
|
||||
* __[/search](Search.md)__ - search OSM objects by name or type
|
||||
* __[/reverse](Reverse.md)__ - search OSM object by their location
|
||||
@@ -12,3 +18,6 @@ Its API has the following endpoints for querying the data:
|
||||
back in Nominatim in case the deletion was accidental
|
||||
* __/polygons__ - list of broken polygons detected by Nominatim
|
||||
* __[/details](Details.md)__ - show internal details for an object (for debugging only)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,76 +1,133 @@
|
||||
# Reverse Geocoding
|
||||
|
||||
Reverse geocoding generates an address from a latitude and longitude or from
|
||||
an OSM object.
|
||||
Reverse geocoding generates an address from a coordinate given as
|
||||
latitude and longitude.
|
||||
|
||||
## Parameters
|
||||
## How it works
|
||||
|
||||
The reverse geocoding API does not exactly compute the address for the
|
||||
coordinate it receives. It works by finding the closest suitable OSM object
|
||||
and returning its address information. This may occasionally lead to
|
||||
unexpected results.
|
||||
|
||||
First of all, Nominatim only includes OSM objects in
|
||||
its index that are suitable for searching. Small, unnamed paths for example
|
||||
are missing from the database and can therefore not be used for reverse
|
||||
geocoding either.
|
||||
|
||||
The other issue to be aware of is that the closest OSM object may not always
|
||||
have a similar enough address to the coordinate you were requesting. For
|
||||
example, in dense city areas it may belong to a completely different street.
|
||||
|
||||
## Endpoint
|
||||
|
||||
The main format of the reverse API is
|
||||
|
||||
```
|
||||
https://nominatim.openstreetmap.org/reverse?<query>
|
||||
https://nominatim.openstreetmap.org/reverse?lat=<value>&lon=<value>&<params>
|
||||
```
|
||||
|
||||
There are two ways how the requested location can be specified:
|
||||
where `lat` and `lon` are latitude and longitude of a coordinate in WGS84
|
||||
projection. The API returns exactly one result or an error when the coordinate
|
||||
is in an area with no OSM data coverage.
|
||||
|
||||
* `lat=<value>` `lon=<value>`
|
||||
|
||||
A geographic location to generate an address for. The coordiantes must be
|
||||
in WGS84 format.
|
||||
!!! danger "Deprecation warning"
|
||||
The reverse API used to allow address lookup for a single OSM object by
|
||||
its OSM id for `[PHP-only]`. The use is considered deprecated.
|
||||
Use the [Address Lookup API](Lookup.md) instead.
|
||||
|
||||
* `osm_type=[N|W|R]` `osm_id=<value>`
|
||||
!!! danger "Deprecation warning"
|
||||
The API can also be used with the URL
|
||||
`https://nominatim.openstreetmap.org/reverse.php`. This is now deprecated
|
||||
and will be removed in future versions.
|
||||
|
||||
A specific OSM node(N), way(W) or relation(R) to return an address for.
|
||||
|
||||
In both cases exactly one object is returned. The two input parameters cannot
|
||||
be used at the same time. Both accept the additional optional parameters listed
|
||||
below.
|
||||
## Parameters
|
||||
|
||||
This section lists additional parameters to further influence the output.
|
||||
|
||||
### Output format
|
||||
|
||||
* `format=[xml|json|jsonv2|geojson|geocodejson]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| format | one of: `xml`, `json`, `jsonv2`, `geojson`, `geocodejson` | `xml` |
|
||||
|
||||
See [Place Output Formats](Output.md) for details on each format. (Default: html)
|
||||
See [Place Output Formats](Output.md) for details on each format.
|
||||
|
||||
* `json_callback=<string>`
|
||||
|
||||
Wrap JSON output in a callback function ([JSONP](https://en.wikipedia.org/wiki/JSONP)) i.e. `<string>(<json>)`.
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| json_callback | function name | _unset_ |
|
||||
|
||||
When given, then JSON output will be wrapped in a callback function with
|
||||
the given name. See [JSONP](https://en.wikipedia.org/wiki/JSONP) for more
|
||||
information.
|
||||
|
||||
Only has an effect for JSON output formats.
|
||||
|
||||
|
||||
### Output details
|
||||
|
||||
* `addressdetails=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| addressdetails | 0 or 1 | 1 |
|
||||
|
||||
Include a breakdown of the address into elements. (Default: 1)
|
||||
When set to 1, include a breakdown of the address into elements.
|
||||
The exact content of the address breakdown depends on the output format.
|
||||
|
||||
!!! tip
|
||||
If you are interested in a stable classification of address categories
|
||||
(suburb, city, state, etc), have a look at the `geocodejson` format.
|
||||
All other formats return classifications according to OSM tagging.
|
||||
There is a much larger set of categories and they are not always consistent,
|
||||
which makes them very hard to work with.
|
||||
|
||||
|
||||
* `extratags=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| extratags | 0 or 1 | 0 |
|
||||
|
||||
Include additional information in the result if available,
|
||||
e.g. wikipedia link, opening hours. (Default: 0)
|
||||
When set to 1, the response include any additional information in the result
|
||||
that is available in the database, e.g. wikipedia link, opening hours.
|
||||
|
||||
|
||||
* `namedetails=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| namedetails | 0 or 1 | 0 |
|
||||
|
||||
Include a list of alternative names in the results. These may include
|
||||
language variants, references, operator and brand. (Default: 0)
|
||||
When set to 1, include a full list of names for the result. These may include
|
||||
language variants, older names, references and brand.
|
||||
|
||||
|
||||
### Language of results
|
||||
|
||||
* `accept-language=<browser language string>`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| accept-language | browser language string | content of "Accept-Language" HTTP header |
|
||||
|
||||
Preferred language order for showing search results, overrides the value
|
||||
specified in the "Accept-Language" HTTP header.
|
||||
Either use a standard RFC2616 accept-language string or a simple
|
||||
comma-separated list of language codes.
|
||||
Preferred language order for showing search results. This may either be
|
||||
a simple comma-separated list of language codes or have the same format
|
||||
as the ["Accept-Language" HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
|
||||
|
||||
### Result limitation
|
||||
!!! tip
|
||||
First-time users of Nominatim tend to be confused that they get different
|
||||
results when using Nominatim in the browser versus in a command-line tool
|
||||
like wget or curl. The command-line tools
|
||||
usually don't send any Accept-Language header, prompting Nominatim
|
||||
to show results in the local language. Browsers on the contrary always
|
||||
send the currently chosen browser language.
|
||||
|
||||
* `zoom=[0-18]`
|
||||
|
||||
Level of detail required for the address. Default: 18. This is a number that corresponds
|
||||
roughly to the zoom level used in map frameworks like Leaflet.js, Openlayers etc.
|
||||
### Result restriction
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| zoom | 0-18 | 18 |
|
||||
|
||||
Level of detail required for the address. This is a number that
|
||||
corresponds roughly to the zoom level used in XYZ tile sources in frameworks
|
||||
like Leaflet.js, Openlayers etc.
|
||||
In terms of address details the zoom levels are as follows:
|
||||
|
||||
zoom | address detail
|
||||
@@ -79,41 +136,81 @@ In terms of address details the zoom levels are as follows:
|
||||
5 | state
|
||||
8 | county
|
||||
10 | city
|
||||
14 | suburb
|
||||
12 | town / borough
|
||||
13 | village / suburb
|
||||
14 | neighbourhood
|
||||
15 | any settlement
|
||||
16 | major streets
|
||||
17 | major and minor streets
|
||||
18 | building
|
||||
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| layer | comma-separated list of: `address`, `poi`, `railway`, `natural`, `manmade` | _unset_ (no restriction) |
|
||||
|
||||
**`[Python-only]`**
|
||||
|
||||
The layer filter allows to select places by themes.
|
||||
|
||||
The `address` layer contains all places that make up an address:
|
||||
address points with house numbers, streets, inhabited places (suburbs, villages,
|
||||
cities, states etc.) and administrative boundaries.
|
||||
|
||||
The `poi` layer selects all point of interest. This includes classic points
|
||||
of interest like restaurants, shops, hotels but also less obvious features
|
||||
like recycling bins, guideposts or benches.
|
||||
|
||||
The `railway` layer includes railway infrastructure like tracks.
|
||||
Note that in Nominatim's standard configuration, only very few railway
|
||||
features are imported into the database.
|
||||
|
||||
The `natural` layer collects features like rivers, lakes and mountains while
|
||||
the `manmade` layer functions as a catch-all for features not covered by the
|
||||
other layers.
|
||||
|
||||
|
||||
### Polygon output
|
||||
|
||||
* `polygon_geojson=1`
|
||||
* `polygon_kml=1`
|
||||
* `polygon_svg=1`
|
||||
* `polygon_text=1`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| polygon_geojson | 0 or 1 | 0 |
|
||||
| polygon_kml | 0 or 1 | 0 |
|
||||
| polygon_svg | 0 or 1 | 0 |
|
||||
| polygon_text | 0 or 1 | 0 |
|
||||
|
||||
Output geometry of results as a GeoJSON, KML, SVG or WKT. Only one of these
|
||||
options can be used at a time. (Default: 0)
|
||||
Add the full geometry of the place to the result output. Output formats
|
||||
in GeoJSON, KML, SVG or WKT are supported. Only one of these
|
||||
options can be used at a time.
|
||||
|
||||
* `polygon_threshold=0.0`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| polygon_threshold | floating-point number | 0.0 |
|
||||
|
||||
Simplify the output geometry before returning. The parameter is the
|
||||
When one of the polygon_* outputs is chosen, return a simplified version
|
||||
of the output geometry. The parameter describes the
|
||||
tolerance in degrees with which the geometry may differ from the original
|
||||
geometry. Topology is preserved in the result. (Default: 0.0)
|
||||
geometry. Topology is preserved in the geometry.
|
||||
|
||||
|
||||
### Other
|
||||
|
||||
* `email=<valid email address>`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| email | valid email address | _unset_ |
|
||||
|
||||
If you are making large numbers of request please include an appropriate email
|
||||
address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
|
||||
address to identify your requests. See Nominatim's
|
||||
[Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
|
||||
|
||||
|
||||
* `debug=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| debug | 0 or 1 | 0 |
|
||||
|
||||
Output assorted developer debug information. Data on internals of Nominatim's
|
||||
"Search Loop" logic, and SQL queries. The output is (rough) HTML format.
|
||||
This overrides the specified machine readable format. (Default: 0)
|
||||
"search loop" logic, and SQL queries. The output is HTML format.
|
||||
This overrides the specified machine readable format.
|
||||
|
||||
|
||||
## Examples
|
||||
@@ -149,7 +246,7 @@ This overrides the specified machine readable format. (Default: 0)
|
||||
"licence":"Data © OpenStreetMap contributors, ODbL 1.0. https:\/\/www.openstreetmap.org\/copyright",
|
||||
"osm_type":"way",
|
||||
"osm_id":"280940520",
|
||||
"lat":"-34.4391708",
|
||||
"lat":"-34.4391708",
|
||||
"lon":"-58.7064573",
|
||||
"place_rank":"26",
|
||||
"category":"highway",
|
||||
|
||||
@@ -1,287 +1,446 @@
|
||||
# Search queries
|
||||
|
||||
The search API allows you to look up a location from a textual description.
|
||||
Nominatim supports structured as well as free-form search queries.
|
||||
The search API allows you to look up a location from a textual description
|
||||
or address. Nominatim supports structured and free-form search queries.
|
||||
|
||||
The search query may also contain
|
||||
[special phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
|
||||
which are translated into specific OpenStreetMap (OSM) tags (e.g. Pub => `amenity=pub`).
|
||||
Note that this only limits the items to be found, it's not suited to return complete
|
||||
lists of OSM objects of a specific type. For those use [Overpass API](https://overpass-api.de/).
|
||||
This can be used to narrow down the kind of objects to be returned.
|
||||
|
||||
## Parameters
|
||||
!!! note
|
||||
Special phrases are not suitable to query all objects of a certain type in an
|
||||
area. Nominatim will always just return a collection of the best matches. To
|
||||
download OSM data by object type, use the [Overpass API](https://overpass-api.de/).
|
||||
|
||||
The search API has the following two formats:
|
||||
## Endpoint
|
||||
|
||||
```
|
||||
https://nominatim.openstreetmap.org/search/<query>?<params>
|
||||
```
|
||||
|
||||
This format only accepts a free-form query string where the
|
||||
parts of the query are separated by slashes.
|
||||
The search API has the following format:
|
||||
|
||||
```
|
||||
https://nominatim.openstreetmap.org/search?<params>
|
||||
```
|
||||
|
||||
In this form, the query may be given through two different sets of parameters:
|
||||
!!! danger "Deprecation warning"
|
||||
The API can also be used with the URL
|
||||
`https://nominatim.openstreetmap.org/search.php`. This is now deprecated
|
||||
and will be removed in future versions.
|
||||
|
||||
* `q=<query>`
|
||||
The query term can be given in two different forms: free-form or structured.
|
||||
|
||||
Free-form query string to search for.
|
||||
Free-form queries are processed first left-to-right and then right-to-left if that fails. So you may search for
|
||||
[pilkington avenue, birmingham](//nominatim.openstreetmap.org/search?q=pilkington+avenue,birmingham) as well as for
|
||||
[birmingham, pilkington avenue](//nominatim.openstreetmap.org/search?q=birmingham,+pilkington+avenue).
|
||||
Commas are optional, but improve performance by reducing the complexity of the search.
|
||||
### Free-form query
|
||||
|
||||
| Parameter | Value |
|
||||
|-----------| ----- |
|
||||
| q | Free-form query string to search for |
|
||||
|
||||
* `street=<housenumber> <streetname>`
|
||||
* `city=<city>`
|
||||
* `county=<county>`
|
||||
* `state=<state>`
|
||||
* `country=<country>`
|
||||
* `postalcode=<postalcode>`
|
||||
In this form, the query can be unstructured.
|
||||
Free-form queries are processed first left-to-right and then right-to-left if that fails. So you may search for
|
||||
[pilkington avenue, birmingham](https://nominatim.openstreetmap.org/search?q=pilkington+avenue,birmingham) as well as for
|
||||
[birmingham, pilkington avenue](https://nominatim.openstreetmap.org/search?q=birmingham,+pilkington+avenue).
|
||||
Commas are optional, but improve performance by reducing the complexity of the search.
|
||||
|
||||
Alternative query string format split into several parameters for structured requests.
|
||||
Structured requests are faster but are less robust against alternative
|
||||
OSM tagging schemas. **Do not combine with** `q=<query>` **parameter**.
|
||||
The free-form may also contain special phrases to describe the type of
|
||||
place to be returned or a coordinate to search close to a position.
|
||||
|
||||
All three query forms accept the additional parameters listed below.
|
||||
### Structured query
|
||||
|
||||
| Parameter | Value |
|
||||
|----------- | ----- |
|
||||
| amenity | name and/or type of POI |
|
||||
| street | housenumber and streetname |
|
||||
| city | city |
|
||||
| county | county |
|
||||
| state | state |
|
||||
| country | country |
|
||||
| postalcode | postal code |
|
||||
|
||||
The structured form of the search query allows to lookup up an address
|
||||
that is already split into its components. Each parameter represents a field
|
||||
of the address. All parameters are optional. You should only use the ones
|
||||
that are relevant for the address you want to geocode.
|
||||
|
||||
!!! Attention
|
||||
Cannot be combined with the `q=<query>` parameter. Newer versions of
|
||||
the API will return an error if you do so. Older versions simply return
|
||||
unexpected results.
|
||||
|
||||
## Parameters
|
||||
|
||||
The following parameters can be used to further restrict the search and
|
||||
change the output. They are usable for both forms of the search query.
|
||||
|
||||
### Output format
|
||||
|
||||
* `format=[html|xml|json|jsonv2|geojson|geocodejson]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| format | one of: `xml`, `json`, `jsonv2`, `geojson`, `geocodejson` | `jsonv2` |
|
||||
|
||||
See [Place Output Formats](Output.md) for details on each format. (Default: html)
|
||||
See [Place Output Formats](Output.md) for details on each format.
|
||||
|
||||
* `json_callback=<string>`
|
||||
!!! note
|
||||
The Nominatim service at
|
||||
[https://nominatim.openstreetmap.org](https://nominatim.openstreetmap.org)
|
||||
has a different default behaviour for historical reasons. When the
|
||||
`format` parameter is omitted, the request will be forwarded to the Web UI.
|
||||
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| json_callback | function name | _unset_ |
|
||||
|
||||
When given, then JSON output will be wrapped in a callback function with
|
||||
the given name. See [JSONP](https://en.wikipedia.org/wiki/JSONP) for more
|
||||
information.
|
||||
|
||||
Wrap JSON output in a callback function ([JSONP](https://en.wikipedia.org/wiki/JSONP)) i.e. `<string>(<json>)`.
|
||||
Only has an effect for JSON output formats.
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| limit | number | 10 |
|
||||
|
||||
Limit the maximum number of returned results. Cannot be more than 40.
|
||||
Nominatim may decide to return less results than given, if additional
|
||||
results do not sufficiently match the query.
|
||||
|
||||
|
||||
### Output details
|
||||
|
||||
* `addressdetails=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| addressdetails | 0 or 1 | 0 |
|
||||
|
||||
Include a breakdown of the address into elements. (Default: 0)
|
||||
When set to 1, include a breakdown of the address into elements.
|
||||
The exact content of the address breakdown depends on the output format.
|
||||
|
||||
!!! tip
|
||||
If you are interested in a stable classification of address categories
|
||||
(suburb, city, state, etc), have a look at the `geocodejson` format.
|
||||
All other formats return classifications according to OSM tagging.
|
||||
There is a much larger set of categories and they are not always consistent,
|
||||
which makes them very hard to work with.
|
||||
|
||||
|
||||
* `extratags=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| extratags | 0 or 1 | 0 |
|
||||
|
||||
Include additional information in the result if available,
|
||||
e.g. wikipedia link, opening hours. (Default: 0)
|
||||
When set to 1, the response include any additional information in the result
|
||||
that is available in the database, e.g. wikipedia link, opening hours.
|
||||
|
||||
|
||||
* `namedetails=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| namedetails | 0 or 1 | 0 |
|
||||
|
||||
Include a list of alternative names in the results. These may include
|
||||
language variants, references, operator and brand. (Default: 0)
|
||||
When set to 1, include a full list of names for the result. These may include
|
||||
language variants, older names, references and brand.
|
||||
|
||||
|
||||
### Language of results
|
||||
|
||||
* `accept-language=<browser language string>`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| accept-language | browser language string | content of "Accept-Language" HTTP header |
|
||||
|
||||
Preferred language order for showing search results, overrides the value
|
||||
specified in the ["Accept-Language" HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
|
||||
Either use a standard RFC2616 accept-language string or a simple
|
||||
comma-separated list of language codes.
|
||||
Preferred language order for showing search results. This may either be
|
||||
a simple comma-separated list of language codes or have the same format
|
||||
as the ["Accept-Language" HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language).
|
||||
|
||||
### Result limitation
|
||||
!!! tip
|
||||
First-time users of Nominatim tend to be confused that they get different
|
||||
results when using Nominatim in the browser versus in a command-line tool
|
||||
like wget or curl. The command-line tools
|
||||
usually don't send any Accept-Language header, prompting Nominatim
|
||||
to show results in the local language. Browsers on the contrary always
|
||||
send the currently chosen browser language.
|
||||
|
||||
* `countrycodes=<countrycode>[,<countrycode>][,<countrycode>]...`
|
||||
### Result restriction
|
||||
|
||||
Limit search results to one or more countries. `<countrycode>` must be the
|
||||
[ISO 3166-1alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code,
|
||||
e.g. `gb` for the United Kingdom, `de` for Germany.
|
||||
There are two ways to influence the results. *Filters* exclude certain
|
||||
kinds of results completely. *Boost parameters* only change the order of the
|
||||
results and thus give a preference to some results over others.
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| countrycodes | comma-separated list of country codes | _unset_ |
|
||||
|
||||
Filter that limits the search results to one or more countries.
|
||||
The country code must be the
|
||||
[ISO 3166-1alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code
|
||||
of the country, e.g. `gb` for the United Kingdom, `de` for Germany.
|
||||
|
||||
Each place in Nominatim is assigned to one country code based
|
||||
on `admin_level=2` tags, in rare cases to none (for example in
|
||||
international waters outside any country).
|
||||
on OSM country boundaries. In rare cases a place may not be in any country
|
||||
at all, for example, when it is in international waters. These places are
|
||||
also excluded when the filter is set.
|
||||
|
||||
* `exclude_place_ids=<place_id,[place_id],[place_id]`
|
||||
!!! Note
|
||||
This parameter should not be confused with the 'country' parameter of
|
||||
the structured query. The 'country' parameter contains a search term
|
||||
and will be handled with some fuzziness. The `countrycodes` parameter
|
||||
is a hard filter and as such should be preferred. Having both parameters
|
||||
in the same query will work. If the parameters contradict each other,
|
||||
the search will come up empty.
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| layer | comma-separated list of: `address`, `poi`, `railway`, `natural`, `manmade` | _unset_ (no restriction) |
|
||||
|
||||
**`[Python-only]`**
|
||||
|
||||
The layer filter allows to select places by themes.
|
||||
|
||||
The `address` layer contains all places that make up an address:
|
||||
address points with house numbers, streets, inhabited places (suburbs, villages,
|
||||
cities, states tec.) and administrative boundaries.
|
||||
|
||||
The `poi` layer selects all point of interest. This includes classic POIs like
|
||||
restaurants, shops, hotels but also less obvious features like recycling bins,
|
||||
guideposts or benches.
|
||||
|
||||
The `railway` layer includes railway infrastructure like tracks.
|
||||
Note that in Nominatim's standard configuration, only very few railway
|
||||
features are imported into the database.
|
||||
|
||||
The `natural` layer collects features like rivers, lakes and mountains while
|
||||
the `manmade` layer functions as a catch-all for features not covered by the
|
||||
other layers.
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| featureType | one of: `country`, `state`, `city`, `settlement` | _unset_ |
|
||||
|
||||
The featureType allows to have a more fine-grained selection for places
|
||||
from the address layer. Results can be restricted to places that make up
|
||||
the 'state', 'country' or 'city' part of an address. A featureType of
|
||||
settlement selects any human inhabited feature from 'state' down to
|
||||
'neighbourhood'.
|
||||
|
||||
When featureType is set, then results are automatically restricted
|
||||
to the address layer (see above).
|
||||
|
||||
!!! tip
|
||||
Instead of using the featureType filters `country`, `state` or `city`,
|
||||
you can also use a structured query without the finer-grained parameters
|
||||
amenity or street.
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| exclude_place_ids | comma-separated list of place ids |
|
||||
|
||||
If you do not want certain OSM objects to appear in the search
|
||||
result, give a comma separated list of the `place_id`s you want to skip.
|
||||
This can be used to broaden search results. For example, if a previous
|
||||
query only returned a few results, then including those here would cause
|
||||
the search to return other, less accurate, matches (if possible).
|
||||
This can be used to retrieve additional search results. For example, if a
|
||||
previous query only returned a few results, then including those here would
|
||||
cause the search to return other, less accurate, matches (if possible).
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| viewbox | `<x1>,<y1>,<x2>,<y2>` | _unset_ |
|
||||
|
||||
* `limit=<integer>`
|
||||
Boost parameter which focuses the search on the given area.
|
||||
Any two corner points of the box are accepted as long as they make a proper
|
||||
box. `x` is longitude, `y` is latitude.
|
||||
|
||||
Limit the number of returned results. (Default: 10, Maximum: 50)
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| bounded | 0 or 1 | 0 |
|
||||
|
||||
When set to 1, then it turns the 'viewbox' parameter (see above) into
|
||||
a filter parameter, excluding any results outside the viewbox.
|
||||
|
||||
* `viewbox=<x1>,<y1>,<x2>,<y2>`
|
||||
|
||||
The preferred area to find search results. Any two corner points of the box
|
||||
are accepted in any order as long as they span a real box. `x` is longitude,
|
||||
`y` is latitude.
|
||||
|
||||
|
||||
* `bounded=[0|1]`
|
||||
|
||||
When a viewbox is given, restrict the result to items contained with that
|
||||
viewbox (see above). When `viewbox` and `bounded=1` are given, an amenity
|
||||
only search is allowed. In this case, give the special keyword for the
|
||||
amenity in square brackets, e.g. `[pub]`. (Default: 0)
|
||||
When `bounded=1` is given and the viewbox is small enough, then an amenity-only
|
||||
search is allowed. Give the special keyword for the amenity in square
|
||||
brackets, e.g. `[pub]` and a selection of objects of this type is returned.
|
||||
There is no guarantee that the result returns all objects in the area.
|
||||
|
||||
|
||||
### Polygon output
|
||||
|
||||
* `polygon_geojson=1`
|
||||
* `polygon_kml=1`
|
||||
* `polygon_svg=1`
|
||||
* `polygon_text=1`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| polygon_geojson | 0 or 1 | 0 |
|
||||
| polygon_kml | 0 or 1 | 0 |
|
||||
| polygon_svg | 0 or 1 | 0 |
|
||||
| polygon_text | 0 or 1 | 0 |
|
||||
|
||||
Output geometry of results as a GeoJSON, KML, SVG or WKT. Only one of these
|
||||
options can be used at a time. (Default: 0)
|
||||
Add the full geometry of the place to the result output. Output formats
|
||||
in GeoJSON, KML, SVG or WKT are supported. Only one of these
|
||||
options can be used at a time.
|
||||
|
||||
* `polygon_threshold=0.0`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| polygon_threshold | floating-point number | 0.0 |
|
||||
|
||||
Simplify the output geometry before returning. The parameter is the
|
||||
When one of the polygon_* outputs is chosen, return a simplified version
|
||||
of the output geometry. The parameter describes the
|
||||
tolerance in degrees with which the geometry may differ from the original
|
||||
geometry. Topology is preserved in the result. (Default: 0.0)
|
||||
geometry. Topology is preserved in the geometry.
|
||||
|
||||
### Other
|
||||
|
||||
* `email=<valid email address>`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| email | valid email address | _unset_ |
|
||||
|
||||
If you are making large numbers of request please include an appropriate email
|
||||
address to identify your requests. See Nominatim's [Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
|
||||
address to identify your requests. See Nominatim's
|
||||
[Usage Policy](https://operations.osmfoundation.org/policies/nominatim/) for more details.
|
||||
|
||||
* `dedupe=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| dedupe | 0 or 1 | 1 |
|
||||
|
||||
Sometimes you have several objects in OSM identifying the same place or
|
||||
object in reality. The simplest case is a street being split in many
|
||||
object in reality. The simplest case is a street being split into many
|
||||
different OSM ways due to different characteristics. Nominatim will
|
||||
attempt to detect such duplicates and only return one match unless
|
||||
this parameter is set to 0. (Default: 1)
|
||||
attempt to detect such duplicates and only return one match. Setting
|
||||
this parameter to 0 disables this deduplication mechanism and
|
||||
ensures that all results are returned.
|
||||
|
||||
|
||||
|
||||
* `debug=[0|1]`
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| debug | 0 or 1 | 0 |
|
||||
|
||||
Output assorted developer debug information. Data on internals of Nominatim's
|
||||
"Search Loop" logic, and SQL queries. The output is (rough) HTML format.
|
||||
This overrides the specified machine readable format. (Default: 0)
|
||||
|
||||
"search loop" logic, and SQL queries. The output is HTML format.
|
||||
This overrides the specified machine readable format.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
##### XML with kml polygon
|
||||
##### XML with KML polygon
|
||||
|
||||
* [https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_geojson=1&addressdetails=1](https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_geojson=1&addressdetails=1)
|
||||
* [https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_kml=1&addressdetails=1](https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_kml=1&addressdetails=1)
|
||||
|
||||
```xml
|
||||
<searchresults timestamp="Sat, 07 Nov 09 14:42:10 +0000" querystring="135 pilkington, avenue birmingham" polygon="true">
|
||||
<place
|
||||
place_id="1620612" osm_type="node" osm_id="452010817"
|
||||
boundingbox="52.548641204834,52.5488433837891,-1.81612110137939,-1.81592094898224"
|
||||
lat="52.5487429714954" lon="-1.81602098644987"
|
||||
display_name="135, Pilkington Avenue, Wylde Green, City of Birmingham, West Midlands (county), B72, United Kingdom"
|
||||
class="place" type="house">
|
||||
<geokml>
|
||||
<Polygon>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates>-1.816513,52.548756599999997 -1.816434,52.548747300000002 -1.816429,52.5487629 -1.8163717,52.548756099999999 -1.8163464,52.548834599999999 -1.8164599,52.548848100000001 -1.8164685,52.5488213 -1.8164913,52.548824000000003 -1.816513,52.548756599999997</coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</geokml>
|
||||
<house_number>135</house_number>
|
||||
<road>Pilkington Avenue</road>
|
||||
<village>Wylde Green</village>
|
||||
<town>Sutton Coldfield</town>
|
||||
<city>City of Birmingham</city>
|
||||
<county>West Midlands (county)</county>
|
||||
<postcode>B72</postcode>
|
||||
<country>United Kingdom</country>
|
||||
<country_code>gb</country_code>
|
||||
</place>
|
||||
</searchresults>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<searchresults timestamp="Tue, 08 Aug 2023 15:45:41 +00:00"
|
||||
attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright"
|
||||
querystring="135 pilkington avenue, birmingham"
|
||||
more_url="https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue%2C+birmingham&polygon_kml=1&addressdetails=1&limit=20&exclude_place_ids=125279639&format=xml"
|
||||
exclude_place_ids="125279639">
|
||||
<place place_id="125279639"
|
||||
osm_type="way"
|
||||
osm_id="90394480"
|
||||
lat="52.5487921"
|
||||
lon="-1.8164308"
|
||||
boundingbox="52.5487473,52.5488481,-1.8165130,-1.8163464"
|
||||
place_rank="30"
|
||||
address_rank="30"
|
||||
display_name="135, Pilkington Avenue, Maney, Sutton Coldfield, Wylde Green, Birmingham, West Midlands Combined Authority, England, B72 1LH, United Kingdom"
|
||||
class="building"
|
||||
type="residential"
|
||||
importance="9.999999994736442e-08">
|
||||
<geokml>
|
||||
<Polygon>
|
||||
<outerBoundaryIs>
|
||||
<LinearRing>
|
||||
<coordinates>-1.816513,52.5487566 -1.816434,52.5487473 -1.816429,52.5487629 -1.8163717,52.5487561 -1.8163464,52.5488346 -1.8164599,52.5488481 -1.8164685,52.5488213 -1.8164913,52.548824 -1.816513,52.5487566</coordinates>
|
||||
</LinearRing>
|
||||
</outerBoundaryIs>
|
||||
</Polygon>
|
||||
</geokml>
|
||||
<house_number>135</house_number>
|
||||
<road>Pilkington Avenue</road>
|
||||
<hamlet>Maney</hamlet>
|
||||
<town>Sutton Coldfield</town>
|
||||
<village>Wylde Green</village>
|
||||
<city>Birmingham</city>
|
||||
<ISO3166-2-lvl8>GB-BIR</ISO3166-2-lvl8>
|
||||
<state_district>West Midlands Combined Authority</state_district>
|
||||
<state>England</state>
|
||||
<ISO3166-2-lvl4>GB-ENG</ISO3166-2-lvl4>
|
||||
<postcode>B72 1LH</postcode>
|
||||
<country>United Kingdom</country>
|
||||
<country_code>gb</country_code>
|
||||
</place>
|
||||
</searchresults>
|
||||
```
|
||||
|
||||
##### JSON with SVG polygon
|
||||
|
||||
[https://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1](https://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1)
|
||||
[https://nominatim.openstreetmap.org/search?q=Unter%20den%20Linden%201%20Berlin&format=json&addressdetails=1&limit=1&polygon_svg=1](https://nominatim.openstreetmap.org/search?q=Unter%20den%20Linden%201%20Berlin&format=json&addressdetails=1&limit=1&polygon_svg=1)
|
||||
|
||||
```json
|
||||
{
|
||||
"address": {
|
||||
"city": "Berlin",
|
||||
"city_district": "Mitte",
|
||||
"construction": "Unter den Linden",
|
||||
"continent": "European Union",
|
||||
"country": "Deutschland",
|
||||
"country_code": "de",
|
||||
"house_number": "1",
|
||||
"neighbourhood": "Scheunenviertel",
|
||||
"postcode": "10117",
|
||||
"public_building": "Kommandantenhaus",
|
||||
"state": "Berlin",
|
||||
"suburb": "Mitte"
|
||||
},
|
||||
"boundingbox": [
|
||||
"52.5170783996582",
|
||||
"52.5173187255859",
|
||||
"13.3975105285645",
|
||||
"13.3981599807739"
|
||||
],
|
||||
"class": "amenity",
|
||||
"display_name": "Kommandantenhaus, 1, Unter den Linden, Scheunenviertel, Mitte, Berlin, 10117, Deutschland, European Union",
|
||||
"importance": 0.73606775332943,
|
||||
"lat": "52.51719785",
|
||||
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
|
||||
"lon": "13.3978352028938",
|
||||
"osm_id": "15976890",
|
||||
"osm_type": "way",
|
||||
"place_id": "30848715",
|
||||
"svg": "M 13.397511 -52.517283599999999 L 13.397829400000001 -52.517299800000004 13.398131599999999 -52.517315099999998 13.398159400000001 -52.517112099999999 13.3975388 -52.517080700000001 Z",
|
||||
"type": "public_building"
|
||||
}
|
||||
[
|
||||
{
|
||||
"address": {
|
||||
"ISO3166-2-lvl4": "DE-BE",
|
||||
"borough": "Mitte",
|
||||
"city": "Berlin",
|
||||
"country": "Deutschland",
|
||||
"country_code": "de",
|
||||
"historic": "Kommandantenhaus",
|
||||
"house_number": "1",
|
||||
"neighbourhood": "Friedrichswerder",
|
||||
"postcode": "10117",
|
||||
"road": "Unter den Linden",
|
||||
"suburb": "Mitte"
|
||||
},
|
||||
"boundingbox": [
|
||||
"52.5170798",
|
||||
"52.5173311",
|
||||
"13.3975116",
|
||||
"13.3981577"
|
||||
],
|
||||
"class": "historic",
|
||||
"display_name": "Kommandantenhaus, 1, Unter den Linden, Friedrichswerder, Mitte, Berlin, 10117, Deutschland",
|
||||
"importance": 0.8135042058306902,
|
||||
"lat": "52.51720765",
|
||||
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
|
||||
"lon": "13.397834399325466",
|
||||
"osm_id": 15976890,
|
||||
"osm_type": "way",
|
||||
"place_id": 108681845,
|
||||
"svg": "M 13.3975116 -52.5172905 L 13.397549 -52.5170798 13.397715 -52.5170906 13.3977122 -52.5171064 13.3977392 -52.5171086 13.3977417 -52.5170924 13.3979655 -52.5171069 13.3979623 -52.5171233 13.3979893 -52.5171248 13.3979922 -52.5171093 13.3981577 -52.5171203 13.398121 -52.5173311 13.3978115 -52.5173103 Z",
|
||||
"type": "house"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
##### JSON with address details
|
||||
|
||||
[https://nominatim.openstreetmap.org/?addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1](https://nominatim.openstreetmap.org/?addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1)
|
||||
[https://nominatim.openstreetmap.org/search?addressdetails=1&q=bakery+in+berlin+wedding&format=jsonv2&limit=1](https://nominatim.openstreetmap.org/search?addressdetails=1&q=bakery+in+berlin+wedding&format=jsonv2&limit=1)
|
||||
|
||||
```json
|
||||
{
|
||||
"address": {
|
||||
"bakery": "B\u00e4cker Kamps",
|
||||
"city_district": "Mitte",
|
||||
"continent": "European Union",
|
||||
"country": "Deutschland",
|
||||
"country_code": "de",
|
||||
"footway": "Bahnsteig U6",
|
||||
"neighbourhood": "Sprengelkiez",
|
||||
"postcode": "13353",
|
||||
"state": "Berlin",
|
||||
"suburb": "Wedding"
|
||||
},
|
||||
"boundingbox": [
|
||||
"52.5460929870605",
|
||||
"52.5460968017578",
|
||||
"13.3591794967651",
|
||||
"13.3591804504395"
|
||||
],
|
||||
"class": "shop",
|
||||
"display_name": "B\u00e4cker Kamps, Bahnsteig U6, Sprengelkiez, Wedding, Mitte, Berlin, 13353, Deutschland, European Union",
|
||||
"icon": "https://nominatim.openstreetmap.org/images/mapicons/shopping_bakery.p.20.png",
|
||||
"importance": 0.201,
|
||||
"lat": "52.5460941",
|
||||
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
|
||||
"lon": "13.35918",
|
||||
"osm_id": "317179427",
|
||||
"osm_type": "node",
|
||||
"place_id": "1453068",
|
||||
"type": "bakery"
|
||||
}
|
||||
[
|
||||
{
|
||||
"address": {
|
||||
"ISO3166-2-lvl4": "DE-BE",
|
||||
"borough": "Mitte",
|
||||
"city": "Berlin",
|
||||
"country": "Deutschland",
|
||||
"country_code": "de",
|
||||
"neighbourhood": "Sprengelkiez",
|
||||
"postcode": "13347",
|
||||
"road": "Lindower Straße",
|
||||
"shop": "Ditsch",
|
||||
"suburb": "Wedding"
|
||||
},
|
||||
"addresstype": "shop",
|
||||
"boundingbox": [
|
||||
"52.5427201",
|
||||
"52.5427654",
|
||||
"13.3668619",
|
||||
"13.3669442"
|
||||
],
|
||||
"category": "shop",
|
||||
"display_name": "Ditsch, Lindower Straße, Sprengelkiez, Wedding, Mitte, Berlin, 13347, Deutschland",
|
||||
"importance": 9.99999999995449e-06,
|
||||
"lat": "52.54274275",
|
||||
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
|
||||
"lon": "13.36690305710228",
|
||||
"name": "Ditsch",
|
||||
"osm_id": 437595031,
|
||||
"osm_type": "way",
|
||||
"place_id": 204751033,
|
||||
"place_rank": 30,
|
||||
"type": "bakery"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
##### GeoJSON
|
||||
|
||||
@@ -1,46 +1,67 @@
|
||||
# Status
|
||||
|
||||
Useful for checking if the service and database is running. The JSON output also shows
|
||||
Report on the state of the service and database. Useful for checking if the
|
||||
service is up and running. The JSON output also reports
|
||||
when the database was last updated.
|
||||
|
||||
## Endpoint
|
||||
|
||||
The status API has the following format:
|
||||
|
||||
```
|
||||
https://nominatim.openstreetmap.org/status
|
||||
```
|
||||
|
||||
!!! danger "Deprecation warning"
|
||||
The API can also be used with the URL
|
||||
`https://nominatim.openstreetmap.org/status.php`. This is now deprecated
|
||||
and will be removed in future versions.
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
* `format=[text|json]` (defaults to 'text')
|
||||
The status endpoint takes a single optional parameter:
|
||||
|
||||
| Parameter | Value | Default |
|
||||
|-----------| ----- | ------- |
|
||||
| format | one of: `text`, `json` | 'text' |
|
||||
|
||||
Selects the output format. See below.
|
||||
|
||||
|
||||
## Output
|
||||
|
||||
#### Text format
|
||||
|
||||
```
|
||||
https://nominatim.openstreetmap.org/status.php
|
||||
```
|
||||
When everything is okay, a status code 200 is returned and a simple message: `OK`
|
||||
|
||||
will return HTTP status code 200 and print `OK`.
|
||||
|
||||
On error it will return HTTP status code 500 and print a message, e.g.
|
||||
On error it will return HTTP status code 500 and print a detailed error message, e.g.
|
||||
`ERROR: Database connection failed`.
|
||||
|
||||
|
||||
|
||||
#### JSON format
|
||||
|
||||
```
|
||||
https://nominatim.openstreetmap.org/status.php?format=json
|
||||
```
|
||||
Always returns a HTTP code 200, when the status call could be executed.
|
||||
|
||||
will return HTTP code 200 and a structure
|
||||
On success a JSON dictionary with the following structure is returned:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": 0,
|
||||
"message": "OK",
|
||||
"data_updated": "2020-05-04T14:47:00+00:00"
|
||||
"data_updated": "2020-05-04T14:47:00+00:00",
|
||||
"software_version": "3.6.0-0",
|
||||
"database_version": "3.6.0-0"
|
||||
}
|
||||
```
|
||||
|
||||
On error will also return HTTP status code 200 and a structure with error
|
||||
code and message, e.g.
|
||||
The `software_version` field contains the version of Nominatim used to serve
|
||||
the API. The `database_version` field contains the version of the data format
|
||||
in the database.
|
||||
|
||||
On error will return a shorter JSON dictionary with the error message
|
||||
and status only, e.g.
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -48,13 +69,3 @@ code and message, e.g.
|
||||
"message": "Database connection failed"
|
||||
}
|
||||
```
|
||||
|
||||
Possible status codes are
|
||||
|
||||
| | message | notes |
|
||||
|-----|----------------------|---------------------------------------------------|
|
||||
| 700 | "No database" | connection failed |
|
||||
| 701 | "Module failed" | database could not load nominatim.so |
|
||||
| 702 | "Module call failed" | nominatim.so loaded but calling a function failed |
|
||||
| 703 | "Query failed" | test query against a database table failed |
|
||||
| 704 | "No value" | test query worked but returned no results |
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Extract markdown-formatted documentation from a source file
|
||||
#
|
||||
# Usage: bash2md.sh <infile> <outfile>
|
||||
|
||||
sed '/^#!/d;s:^#\( \|$\)::;s/.*#DOCS://' $1 > $2
|
||||
149
docs/customize/Country-Settings.md
Normal file
149
docs/customize/Country-Settings.md
Normal file
@@ -0,0 +1,149 @@
|
||||
# Customizing Per-Country Data
|
||||
|
||||
Whenever an OSM is imported into Nominatim, the object is first assigned
|
||||
a country. Nominatim can use this information to adapt various aspects of
|
||||
the address computation to the local customs of the country. This section
|
||||
explains how country assignment works and the principal per-country
|
||||
localizations.
|
||||
|
||||
## Country assignment
|
||||
|
||||
Countries are assigned on the basis of country data from the OpenStreetMap
|
||||
input data itself. Countries are expected to be tagged according to the
|
||||
[administrative boundary schema](https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative):
|
||||
a OSM relation with `boundary=administrative` and `admin_level=2`. Nominatim
|
||||
uses the country code to distinguish the countries.
|
||||
|
||||
If there is no country data available for a point, then Nominatim uses the
|
||||
fallback data imported from `data/country_osm_grid.sql.gz`. This was computed
|
||||
from OSM data as well but is guaranteed to cover all countries.
|
||||
|
||||
Some OSM objects may also be located outside any country, for example a buoy
|
||||
in the middle of the ocean. These object do not get any country assigned and
|
||||
get a default treatment when it comes to localized handling of data.
|
||||
|
||||
## Per-country settings
|
||||
|
||||
### Global country settings
|
||||
|
||||
The main place to configure settings per country is the file
|
||||
`settings/country_settings.yaml`. This file has one section per country that
|
||||
is recognised by Nominatim. Each section is tagged with the country code
|
||||
(in lower case) and contains the different localization information. Only
|
||||
countries which are listed in this file are taken into account for computations.
|
||||
|
||||
For example, the section for Andorra looks like this:
|
||||
|
||||
```
|
||||
partition: 35
|
||||
languages: ca
|
||||
names: !include country-names/ad.yaml
|
||||
postcode:
|
||||
pattern: "(ddd)"
|
||||
output: AD\1
|
||||
```
|
||||
|
||||
The individual settings are described below.
|
||||
|
||||
#### `partition`
|
||||
|
||||
Nominatim internally splits the data into multiple tables to improve
|
||||
performance. The partition number tells Nominatim into which table to put
|
||||
the country. This is purely internal management and has no effect on the
|
||||
output data.
|
||||
|
||||
The default is to have one partition per country.
|
||||
|
||||
#### `languages`
|
||||
|
||||
A comma-separated list of ISO-639 language codes of default languages in the
|
||||
country. These are the languages used in name tags without a language suffix.
|
||||
Note that this is not necessarily the same as the list of official languages
|
||||
in the country. There may be officially recognised languages in a country
|
||||
which are only ever used in name tags with the appropriate language suffixes.
|
||||
Conversely, a non-official language may appear a lot in the name tags, for
|
||||
example when used as an unofficial Lingua Franca.
|
||||
|
||||
List the languages in order of frequency of appearance with the most frequently
|
||||
used language first. It is not recommended to add languages when there are only
|
||||
very few occurrences.
|
||||
|
||||
If only one language is listed, then Nominatim will 'auto-complete' the
|
||||
language of names without an explicit language-suffix.
|
||||
|
||||
#### `names`
|
||||
|
||||
List of names of the country and its translations. These names are used as
|
||||
a baseline. It is always possible to search countries by the given names, no
|
||||
matter what other names are in the OSM data. They are also used as a fallback
|
||||
when a needed translation is not available.
|
||||
|
||||
!!! Note
|
||||
The list of names per country is currently fairly large because Nominatim
|
||||
supports translations in many languages per default. That is why the
|
||||
name lists have been separated out into extra files. You can find the
|
||||
name lists in the file `settings/country-names/<country code>.yaml`.
|
||||
The names section in the main country settings file only refers to these
|
||||
files via the special `!include` directive.
|
||||
|
||||
#### `postcode`
|
||||
|
||||
Describes the format of the postcode that is in use in the country.
|
||||
|
||||
When a country has no official postcodes, set this to no. Example:
|
||||
|
||||
```
|
||||
ae:
|
||||
postcode: no
|
||||
```
|
||||
|
||||
When a country has a postcode, you need to state the postcode pattern and
|
||||
the default output format. Example:
|
||||
|
||||
```
|
||||
bm:
|
||||
postcode:
|
||||
pattern: "(ll)[ -]?(dd)"
|
||||
output: \1 \2
|
||||
```
|
||||
|
||||
The **pattern** is a regular expression that describes the possible formats
|
||||
accepted as a postcode. The pattern follows the standard syntax for
|
||||
[regular expressions in Python](https://docs.python.org/3/library/re.html#regular-expression-syntax)
|
||||
with two extra shortcuts: `d` is a shortcut for a single digit([0-9])
|
||||
and `l` for a single ASCII letter ([A-Z]).
|
||||
|
||||
Use match groups to indicate groups in the postcode that may optionally be
|
||||
separated with a space or a hyphen.
|
||||
|
||||
For example, the postcode for Bermuda above always consists of two letters
|
||||
and two digits. They may optionally be separated by a space or hyphen. That
|
||||
means that Nominatim will consider `AB56`, `AB 56` and `AB-56` spelling variants
|
||||
for one and the same postcode.
|
||||
|
||||
Never add the country code in front of the postcode pattern. Nominatim will
|
||||
automatically accept variants with a country code prefix for all postcodes.
|
||||
|
||||
The **output** field is an optional field that describes what the canonical
|
||||
spelling of the postcode should be. The format is the
|
||||
[regular expression expand syntax](https://docs.python.org/3/library/re.html#re.Match.expand) referring back to the bracket groups in the pattern.
|
||||
|
||||
Most simple postcodes only have one spelling variant. In that case, the
|
||||
**output** can be omitted. The postcode will simply be used as is.
|
||||
|
||||
In the Bermuda example above, the canonical spelling would be to have a space
|
||||
between letters and digits.
|
||||
|
||||
!!! Warning
|
||||
When your postcode pattern covers multiple variants of the postcode, then
|
||||
you must explicitly state the canonical output or Nominatim will not
|
||||
handle the variations correctly.
|
||||
|
||||
### Other country-specific configuration
|
||||
|
||||
There are some other configuration files where you can set localized settings
|
||||
according to the assigned country. These are:
|
||||
|
||||
* [Place ranking configuration](Ranking.md)
|
||||
|
||||
Please see the linked documentation sections for more information.
|
||||
443
docs/customize/Import-Styles.md
Normal file
443
docs/customize/Import-Styles.md
Normal file
@@ -0,0 +1,443 @@
|
||||
## Configuring the Import
|
||||
|
||||
In the very first step of a Nominatim import, OSM data is loaded into the
|
||||
database. Nominatim uses [osm2pgsql](https://osm2pgsql.org) for this task.
|
||||
It comes with a [flex style](https://osm2pgsql.org/doc/manual.html#the-flex-output)
|
||||
specifically tailored to filter and convert OSM data into Nominatim's
|
||||
internal data representation.
|
||||
|
||||
There are a number of default configurations for the flex style which
|
||||
result in geocoding databases of different detail. The
|
||||
[Import section](../admin/Import.md#filtering-imported-data) explains
|
||||
these default configurations in detail.
|
||||
|
||||
You can also create your own custom style. Put the style file into your
|
||||
project directory and then set `NOMINATIM_IMPORT_STYLE` to the name of the file.
|
||||
It is always recommended to start with one of the standard styles and customize
|
||||
those. You find the standard styles under the name `import-<stylename>.lua`
|
||||
in the standard Nominatim configuration path (usually `/etc/nominatim` or
|
||||
`/usr/local/etc/nominatim`).
|
||||
|
||||
The remainder of the page describes how the flex style works and how to
|
||||
customize it.
|
||||
|
||||
### The `flex-base.lua` module
|
||||
|
||||
The core of Nominatim's flex import configuration is the `flex-base` module.
|
||||
It defines the table layout used by Nominatim and provides standard
|
||||
implementations for the import callbacks that make it easy to customize
|
||||
how OSM tags are used by Nominatim.
|
||||
|
||||
Every custom style should include this module to make sure that the correct
|
||||
tables are created. Thus start your custom style as follows:
|
||||
|
||||
``` lua
|
||||
local flex = require('flex-base')
|
||||
|
||||
```
|
||||
|
||||
The following sections explain how the module can be customized.
|
||||
|
||||
|
||||
### Changing the recognized tags
|
||||
|
||||
If you just want to change which OSM tags are recognized during import,
|
||||
then there are a number of convenience functions to set the tag lists used
|
||||
during the processing.
|
||||
|
||||
!!! warning
|
||||
There are no built-in defaults for the tag lists, so all the functions
|
||||
need to be called from your style script to fully process the data.
|
||||
Make sure you start from one of the default style and only modify
|
||||
the data you are interested in. You can also derive your style from an
|
||||
existing style by importing the appropriate module, e.g.
|
||||
`local flex = require('import-street')`.
|
||||
|
||||
Many of the following functions take _key match lists_. These lists can
|
||||
contain three kinds of strings to match against tag keys:
|
||||
A string that ends in an asterisk `*` is a prefix match and accordingly matches
|
||||
against any key that starts with the given string (minus the `*`).
|
||||
A suffix match can be defined similarly with a string that starts with a `*`.
|
||||
Any other string is matched exactly against tag keys.
|
||||
|
||||
|
||||
#### `set_main_tags()` - principal tags
|
||||
|
||||
If a principal or main tag is found on an OSM object, then the object
|
||||
is included in Nominatim's search index. A single object may also have
|
||||
multiple main tags. In that case, the object will be included multiple
|
||||
times in the index, once for each main tag.
|
||||
|
||||
The flex script distinguishes between four types of main tags:
|
||||
|
||||
* __always__: a main tag that is used unconditionally
|
||||
* __named__: consider this main tag only, if the object has a proper name
|
||||
(a reference is not enough, see below).
|
||||
* __named_with_key__: consider this main tag only, when the object has
|
||||
a proper name with a domain prefix. For example, if the main tag is
|
||||
`bridge=yes`, then it will only be added as an extra row, if there is
|
||||
a tag `bridge:name[:XXX]` for the same object. If this property is set,
|
||||
all other names that are not domain-specific are ignored.
|
||||
* __fallback__: use this main tag only, if there is no other main tag.
|
||||
Fallback always implied `named`, i.e. fallbacks are only tried for
|
||||
named objects.
|
||||
|
||||
The `set_main_tags()` function takes exactly one table parameter which
|
||||
defines the keys and key/value combinations to include and the kind of
|
||||
main tag. Each lua table key defines an OSM tag key. The value may
|
||||
be a string defining the kind of main key as described above. Then the tag will
|
||||
be considered a main tag for any possible value. To further restrict
|
||||
which values are acceptable, give a table with the permitted values
|
||||
and their kind of main tag. If the table contains a simple value without
|
||||
key, then this is used as default for values that are not listed.
|
||||
|
||||
!!! example
|
||||
``` lua
|
||||
local flex = require('import-full')
|
||||
|
||||
flex.set_main_tags{
|
||||
boundary = {administrative = 'named'},
|
||||
highway = {'always', street_lamp = 'named'},
|
||||
landuse = 'fallback'
|
||||
}
|
||||
```
|
||||
|
||||
In this example an object with a `boundary` tag will only be included
|
||||
when it has a value of `administrative`. Objects with `highway` tags are
|
||||
always included. However when the value is `street_lamp` then the object
|
||||
must have a name, too. With any other value, the object is included
|
||||
independently of the name. Finally, if a `landuse` tag is present then
|
||||
it will be used independely of the concrete value if neither boundary
|
||||
nor highway tags were found and the object is named.
|
||||
|
||||
|
||||
#### `set_prefilters()` - ignoring tags
|
||||
|
||||
Pre-filtering of tags allows to ignore them for any further processing.
|
||||
Thus pre-filtering takes precedence over any other tag processing. This is
|
||||
useful when some specific key/value combinations need to be excluded from
|
||||
processing. When tags are filtered, they may either be deleted completely
|
||||
or moved to `extratags`. Extra tags are saved with the object and returned
|
||||
to the user when requested, but are not used otherwise.
|
||||
|
||||
`set_prefilters()` takes a table with four optional fields:
|
||||
|
||||
* __delete_keys__ is a _key match list_ for tags that should be deleted
|
||||
* __delete_tags__ contains a table of tag keys pointing to a list of tag
|
||||
values. Tags with matching key/value pairs are deleted.
|
||||
* __extra_keys__ is a _key match list_ for tags which should be saved into
|
||||
extratags
|
||||
* __extra_tags__ contains a table of tag keys pointing to a list of tag
|
||||
values. Tags with matching key/value pairs are moved to extratags.
|
||||
|
||||
Key list may contain three kinds of strings:
|
||||
A string that ends in an asterisk `*` is a prefix match and accordingly matches
|
||||
against any key that starts with the given string (minus the `*`).
|
||||
A suffix match can be defined similarly with a string that starts with a `*`.
|
||||
Any other string is matched exactly against tag keys.
|
||||
|
||||
!!! example
|
||||
``` lua
|
||||
local flex = require('import-full')
|
||||
|
||||
flex.set_prefilters{
|
||||
delete_keys = {'source', 'source:*'},
|
||||
extra_tags = {amenity = {'yes', 'no'}}
|
||||
}
|
||||
flex.set_main_tags{
|
||||
amenity = 'always'
|
||||
}
|
||||
```
|
||||
|
||||
In this example any tags `source` and tags that begin with `source:` are
|
||||
deleted before any other processing is done. Getting rid of frequent tags
|
||||
this way can speed up the import.
|
||||
|
||||
Tags with `amenity=yes` or `amenity=no` are moved to extratags. Later
|
||||
all tags with an `amenity` key are made a main tag. This effectively means
|
||||
that Nominatim will use all amenity tags except for those with value
|
||||
yes and no.
|
||||
|
||||
#### `set_name_tags()` - defining names
|
||||
|
||||
The flex script distinguishes between two kinds of names:
|
||||
|
||||
* __main__: the primary names make an object fully searchable.
|
||||
Main tags of type _named_ will only cause the object to be included when
|
||||
such a primary name is present. Primary names are usually those found
|
||||
in the `name` tag and its variants.
|
||||
* __extra__: extra names are still added to the search index but they are
|
||||
alone not sufficient to make an object named.
|
||||
|
||||
`set_name_tags()` takes a table with two optional fields `main` and `extra`.
|
||||
They take _key match lists_ for main and extra names respectively.
|
||||
|
||||
!!! example
|
||||
``` lua
|
||||
local flex = require('flex-base')
|
||||
|
||||
flex.set_main_tags{highway = {traffic_light = 'named'}}
|
||||
flex.set_name_tags{main = {'name', 'name:*'},
|
||||
extra = {'ref'}
|
||||
}
|
||||
```
|
||||
|
||||
This example creates a search index over traffic lights but will
|
||||
only include those that have a common name and not those which just
|
||||
have some reference ID from the city.
|
||||
|
||||
#### `set_address_tags()` - defining address parts
|
||||
|
||||
Address tags will be used to build up the address of an object.
|
||||
|
||||
`set_address_tags()` takes a table with arbitrary fields pointing to
|
||||
_key match lists_. Two fields have a special meaning:
|
||||
|
||||
* __main__: defines
|
||||
the tags that make a full address object out of the OSM object. This
|
||||
is usually the housenumber or variants thereof. If a main address tag
|
||||
appears, then the object will always be included, if necessary with a
|
||||
fallback of `place=house`. If the key has a prefix of `addr:` or `is_in:`
|
||||
this will be stripped.
|
||||
|
||||
* __extra__: defines all supplementary tags for addresses, tags like `addr:street`, `addr:city` etc. If the key has a prefix of `addr:` or `is_in:` this will be stripped.
|
||||
|
||||
All other fields will be handled as summary fields. If a key matches the
|
||||
key match list, then its value will be added to the address tags with the
|
||||
name of the field as key. If multiple tags match, then an arbitrary one
|
||||
wins.
|
||||
|
||||
Country tags are handled slightly special. Only tags with a two-letter code
|
||||
are accepted, all other values are discarded.
|
||||
|
||||
!!! example
|
||||
``` lua
|
||||
local flex = require('import-full')
|
||||
|
||||
flex.set_address_tags{
|
||||
main = {'addr:housenumber'},
|
||||
extra = {'addr:*'},
|
||||
postcode = {'postal_code', 'postcode', 'addr:postcode'},
|
||||
country = {'country_code', 'ISO3166-1'}
|
||||
}
|
||||
```
|
||||
|
||||
In this example all tags which begin with `addr:` will be saved in
|
||||
the address tag list. If one of the tags is `addr:housenumber`, the
|
||||
object will fall back to be entered as a `place=house` in the database
|
||||
unless there is another interested main tag to be found.
|
||||
|
||||
Tags with keys `country_code` and `ISO3166-1` are saved with their
|
||||
value under `country` in the address tag list. The same thing happens
|
||||
to postcodes, they will always be saved under the key `postcode` thus
|
||||
normalizing the multitude of keys that are used in the OSM database.
|
||||
|
||||
|
||||
#### `set_unused_handling()` - processing remaining tags
|
||||
|
||||
This function defines what to do with tags that remain after all tags
|
||||
have been classified using the functions above. There are two ways in
|
||||
which the function can be used:
|
||||
|
||||
`set_unused_handling(delete_keys = ..., delete_tags = ...)` deletes all
|
||||
keys that match the descriptions in the parameters and moves all remaining
|
||||
tags into the extratags list.
|
||||
`set_unused_handling(extra_keys = ..., extra_tags = ...)` moves all tags
|
||||
matching the parameters into the extratags list and then deletes the remaining
|
||||
tags. For the format of the parameters see the description in `set_prefilters()`
|
||||
above.
|
||||
|
||||
!!! example
|
||||
``` lua
|
||||
local flex = require('import-full')
|
||||
|
||||
flex.set_address_tags{
|
||||
main = {'addr:housenumber'},
|
||||
extra = {'addr:*', 'tiger:county'}
|
||||
}
|
||||
flex.set_unused_handling{delete_keys = {'tiger:*'}}
|
||||
```
|
||||
|
||||
In this example all remaining tags except those beginning with `tiger:`
|
||||
are moved to the extratags list. Note that it is not possible to
|
||||
already delete the tiger tags with `set_prefilters()` because that
|
||||
would remove tiger:county before the address tags are processed.
|
||||
|
||||
### Customizing osm2pgsql callbacks
|
||||
|
||||
osm2pgsql expects the flex style to implement three callbacks, one process
|
||||
function per OSM type. If you want to implement special handling for
|
||||
certain OSM types, you can override the default implementations provided
|
||||
by the flex-base module.
|
||||
|
||||
#### Changing the relation types to be handled
|
||||
|
||||
The default scripts only allows relations of type `multipolygon`, `boundary`
|
||||
and `waterway`. To add other types relations, set `RELATION_TYPES` for
|
||||
the type to the kind of geometry that should be created. The following
|
||||
kinds of geometries can be used:
|
||||
|
||||
* __relation_as_multipolygon__ creates a (Multi)Polygon from the ways in
|
||||
the relation. If the ways do not form a valid area, then the object is
|
||||
silently discarded.
|
||||
* __relation_as_multiline__ creates a (Multi)LineString from the ways in
|
||||
the relations. Ways are combined as much as possible without any regards
|
||||
to their order in the relation.
|
||||
|
||||
!!! Example
|
||||
``` lua
|
||||
local flex = require('import-full')
|
||||
|
||||
flex.RELATION_TYPES['site'] = flex.relation_as_multipolygon
|
||||
```
|
||||
|
||||
With this line relations of `type=site` will be included in the index
|
||||
according to main tags found. This only works when the site relation
|
||||
resolves to a valid area. Nodes in the site relation are not part of the
|
||||
geometry.
|
||||
|
||||
|
||||
#### Adding additional logic to processing functions
|
||||
|
||||
The default processing functions are also exported by the flex-base module
|
||||
as `process_node`, `process_way` and `process_relation`. These can be used
|
||||
to implement your own processing functions with some additional processing
|
||||
logic.
|
||||
|
||||
!!! Example
|
||||
``` lua
|
||||
local flex = require('import-full')
|
||||
|
||||
function osm2pgsql.process_relation(object)
|
||||
if object.tags.boundary ~= 'administrative' or object.tags.admin_level ~= '2' then
|
||||
flex.process_relation(object)
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
This example discards all country-level boundaries and uses standard
|
||||
handling for everything else. This can be useful if you want to use
|
||||
your own custom country boundaries.
|
||||
|
||||
|
||||
### Customizing the main processing function
|
||||
|
||||
The main processing function of the flex style can be found in the function
|
||||
`process_tags`. This function is called for all OSM object kinds and is
|
||||
responsible for filtering the tags and writing out the rows into Postgresql.
|
||||
|
||||
!!! Example
|
||||
``` lua
|
||||
local flex = require('import-full')
|
||||
|
||||
local original_process_tags = flex.process_tags
|
||||
|
||||
function flex.process_tags(o)
|
||||
if o.object.tags.highway ~= nil and o.object.tags.access == 'no' then
|
||||
return
|
||||
end
|
||||
|
||||
original_process_tags(o)
|
||||
end
|
||||
```
|
||||
|
||||
This example shows the most simple customization of the process_tags function.
|
||||
It simply adds some additional processing before running the original code.
|
||||
To do that, first save the original function and then overwrite process_tags
|
||||
from the module. In this example all highways which are not accessible
|
||||
by anyone will be ignored.
|
||||
|
||||
|
||||
#### The `Place` class
|
||||
|
||||
The `process_tags` function receives a Lua object of `Place` type which comes
|
||||
with some handy functions to collect the data necessary for geocoding and
|
||||
writing it into the place table. Always use this object to fill the table.
|
||||
|
||||
The Place class has some attributes which you may access read-only:
|
||||
|
||||
* __object__ is the original OSM object data handed in by osm2pgsql
|
||||
* __admin_level__ is the content of the admin_level tag, parsed into an
|
||||
integer and normalized to a value between 0 and 15
|
||||
* __has_name__ is a boolean indicating if the object has a full name
|
||||
* __names__ is a table with the collected list of name tags
|
||||
* __address__ is a table with the collected list of address tags
|
||||
* __extratags__ is a table with the collected list of additional tags to save
|
||||
|
||||
There are a number of functions to fill these fields. All functions expect
|
||||
a table parameter with fields as indicated in the description.
|
||||
Many of these functions expect match functions which are described in detail
|
||||
further below.
|
||||
|
||||
* __delete{match=...}__ removes all tags that match the match function given
|
||||
in _match_.
|
||||
* __grab_extratags{match=...}__ moves all tags that match the match function
|
||||
given in _match_ into extratags. Returns the number of tags moved.
|
||||
* __clean{delete=..., extra=...}__ deletes all tags that match _delete_ and
|
||||
moves the ones that match _extra_ into extratags
|
||||
* __grab_address_parts{groups=...}__ moves matching tags into the address table.
|
||||
_groups_ must be a group match function. Tags of the group `main` and
|
||||
`extra` are added to the address table as is but with `addr:` and `is_in:`
|
||||
prefixes removed from the tag key. All other groups are added with the
|
||||
group name as key and the value from the tag. Multiple values of the same
|
||||
group overwrite each other. The function returns the number of tags saved
|
||||
from the main group.
|
||||
* __grab_main_parts{groups=...}__ moves matching tags into the name table.
|
||||
_groups_ must be a group match function. If a tags of the group `main` is
|
||||
present, the object will be marked as having a name. Tags of group `house`
|
||||
produce a fallback to `place=house`. This fallback is return by the function
|
||||
if present.
|
||||
|
||||
There are two functions to write a row into the place table. Both functions
|
||||
expect the main tag (key and value) for the row and then use the collected
|
||||
information from the name, address, extratags etc. fields to complete the row.
|
||||
They also have a boolean parameter `save_extra_mains` which defines how any
|
||||
unprocessed tags are handled: when True, the tags will be saved as extratags,
|
||||
when False, they will be simply discarded.
|
||||
|
||||
* __write_row(key, value, save_extra_mains)__ creates a new table row from
|
||||
the current state of the Place object.
|
||||
* __write_place(key, value, mtype, save_extra_mains)__ creates a new row
|
||||
conditionally. When value is nil, the function will attempt to look up the
|
||||
value in the object tags. If value is still nil or mtype is nil, the row
|
||||
is ignored. An mtype of `always` will then always write out the row,
|
||||
a mtype of `named` only, when the object has a full name. When mtype
|
||||
is `named_with_key`, the function checks for a domain name, i.e. a name
|
||||
tag prefixed with the name of the main key. Only if at least one is found,
|
||||
the row will be written. The names are replaced with the domain names found.
|
||||
|
||||
#### Match functions
|
||||
|
||||
The Place functions usually expect either a _match function_ or a
|
||||
_group match function_ to find the tags to apply their function to.
|
||||
|
||||
The __match function__ is a Lua function which takes two parameters,
|
||||
key and value, and returns a boolean to indicate that a tag matches. The
|
||||
flex-base module has a convenience function `tag_match()` to create such a
|
||||
function. It takes a table with two optional fields: `keys` takes a key match
|
||||
list (see above), `tags` takes a table with keys that point to a list of
|
||||
possible values, thus defining key/value matches.
|
||||
|
||||
The __group match function__ is a Lua function which also takes two parameters,
|
||||
key and value, and returns a string indicating to which group or type they
|
||||
belong to. The `tag_group()` can be used to create such a function. It expects
|
||||
a table where the group names are the keys and the values are a key match list.
|
||||
|
||||
|
||||
|
||||
### Using the gazetteer output of osm2pgsql
|
||||
|
||||
Nominatim still allows you to configure the gazetteer output to remain
|
||||
backwards compatible with older imports. It will be automatically used
|
||||
when the style file name ends in `.style`. For documentation of the
|
||||
old import style, please refer to the documentation of older releases
|
||||
of Nominatim. Do not use the gazetteer output for new imports. There is no
|
||||
guarantee that new versions of Nominatim are fully compatible with the
|
||||
gazetteer output.
|
||||
|
||||
### Changing the Style of Existing Databases
|
||||
|
||||
There is normally no issue changing the style of a database that is already
|
||||
imported and now kept up-to-date with change files. Just be aware that any
|
||||
change in the style applies to updates only. If you want to change the data
|
||||
that is already in the database, then a reimport is necessary.
|
||||
55
docs/customize/Importance.md
Normal file
55
docs/customize/Importance.md
Normal file
@@ -0,0 +1,55 @@
|
||||
## Importance
|
||||
|
||||
Search requests can yield multiple results which match equally well with
|
||||
the original query. In such case Nominatim needs to order the results
|
||||
according to a different criterion: importance. This is a measure for how
|
||||
likely it is that a user will search for a given place. This section explains
|
||||
the sources Nominatim uses for computing importance of a place and how to
|
||||
customize them.
|
||||
|
||||
### How importance is computed
|
||||
|
||||
The main value for importance is derived from page ranking values for Wikipedia
|
||||
pages for a place. For places that do not have their own
|
||||
Wikipedia page, a formula is used that derives a static importance from the
|
||||
place's [search rank](../customize/Ranking.md#search-rank).
|
||||
|
||||
In a second step, a secondary importance value is added which is meant to
|
||||
represent how well-known the general area is where the place is located. It
|
||||
functions as a tie-breaker between places with very similar primary
|
||||
importance values.
|
||||
|
||||
nominatim.org has preprocessed importance tables for the
|
||||
[primary Wikipedia rankings](https://nominatim.org/data/wikimedia-importance.sql.gz)
|
||||
and for [secondary importance](https://nominatim.org/data/wikimedia-secondary-importance.sql.gz)
|
||||
based on Wikipedia importance of the administrative areas.
|
||||
|
||||
The source code for creating these files is available in the Github projects
|
||||
[osm-search/wikipedia-wikidata](https://github.com/osm-search/wikipedia-wikidata)
|
||||
and
|
||||
[osm-search/secondary-importance](https://github.com/osm-search/secondary-importance).
|
||||
|
||||
### Customizing secondary importance
|
||||
|
||||
The secondary importance is implemented as a simple
|
||||
[Postgis raster](https://postgis.net/docs/raster.html) table, where Nominatim
|
||||
looks up the value for the coordinates of the centroid of a place. You can
|
||||
provide your own secondary importance raster in form of an SQL file named
|
||||
`secondary_importance.sql.gz` in your project directory.
|
||||
|
||||
The SQL file needs to drop and (re)create a table `secondary_importance` which
|
||||
must as a minimum contain a column `rast` of type `raster`. The raster must
|
||||
be in EPSG:4326 and contain 16bit unsigned ints
|
||||
(`raster_constraint_pixel_types(rast) = '{16BUI}'). Any other columns in the
|
||||
table will be ignored. You must furthermore create an index as follows:
|
||||
|
||||
```
|
||||
CREATE INDEX ON secondary_importance USING gist(ST_ConvexHull(gist))
|
||||
```
|
||||
|
||||
The following raster2pgsql command will create a table from a tiff file
|
||||
that conforms to the requirements:
|
||||
|
||||
```
|
||||
raster2pgsql -I -C -Y -d -t 128x128 input.tiff public.secondary_importance
|
||||
```
|
||||
22
docs/customize/Overview.md
Normal file
22
docs/customize/Overview.md
Normal file
@@ -0,0 +1,22 @@
|
||||
Nominatim comes with a predefined set of configuration options that should
|
||||
work for most standard installations. If you have special requirements, there
|
||||
are many places where the configuration can be adapted. This chapter describes
|
||||
the following configurable parts:
|
||||
|
||||
* [Global Settings](Settings.md) has a detailed description of all parameters that
|
||||
can be set in your local `.env` configuration
|
||||
* [Import styles](Import-Styles.md) explains how to write your own import style
|
||||
in order to control what kind of OSM data will be imported
|
||||
* [API Result Formatting](Result-Formatting.md) shows how to change the
|
||||
output of the Nominatim API
|
||||
* [Place ranking](Ranking.md) describes the configuration around classifing
|
||||
places in terms of their importance and their role in an address
|
||||
* [Tokenizers](Tokenizers.md) describes the configuration of the module
|
||||
responsible for analysing and indexing names
|
||||
* [Special Phrases](Special-Phrases.md) are common nouns or phrases that
|
||||
can be used in search to identify a class of places
|
||||
|
||||
There are also guides for adding the following external data:
|
||||
|
||||
* [US house numbers from the TIGER dataset](Tiger.md)
|
||||
* [External postcodes](Postcodes.md)
|
||||
37
docs/customize/Postcodes.md
Normal file
37
docs/customize/Postcodes.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# External postcode data
|
||||
|
||||
Nominatim creates a table of known postcode centroids during import. This table
|
||||
is used for searches of postcodes and for adding postcodes to places where the
|
||||
OSM data does not provide one. These postcode centroids are mainly computed
|
||||
from the OSM data itself. In addition, Nominatim supports reading postcode
|
||||
information from an external CSV file, to supplement the postcodes that are
|
||||
missing in OSM.
|
||||
|
||||
To enable external postcode support, simply put one CSV file per country into
|
||||
your project directory and name it `<CC>_postcodes.csv`. `<CC>` must be the
|
||||
two-letter country code for which to apply the file. The file may also be
|
||||
gzipped. Then it must be called `<CC>_postcodes.csv.gz`.
|
||||
|
||||
The CSV file must use commas as a delimiter and have a header line. Nominatim
|
||||
expects three columns to be present: `postcode`, `lat` and `lon`. All other
|
||||
columns are ignored. `lon` and `lat` must describe the x and y coordinates of the
|
||||
postcode centroids in WGS84.
|
||||
|
||||
The postcode files are loaded only when there is data for the given country
|
||||
in your database. For example, if there is a `us_postcodes.csv` file in your
|
||||
project directory but you import only an excerpt of Italy, then the US postcodes
|
||||
will simply be ignored.
|
||||
|
||||
As a rule, the external postcode data should be put into the project directory
|
||||
**before** starting the initial import. Still, you can add, remove and update the
|
||||
external postcode data at any time. Simply
|
||||
run:
|
||||
|
||||
```
|
||||
nominatim refresh --postcodes
|
||||
```
|
||||
|
||||
to make the changes visible in your database. Be aware, however, that the changes
|
||||
only have an immediate effect on searches for postcodes. Postcodes that were
|
||||
added to places are only updated, when they are reindexed. That usually happens
|
||||
only during replication updates.
|
||||
139
docs/customize/Ranking.md
Normal file
139
docs/customize/Ranking.md
Normal file
@@ -0,0 +1,139 @@
|
||||
# Place Ranking in Nominatim
|
||||
|
||||
Nominatim uses two metrics to rank a place: search rank and address rank.
|
||||
This chapter explains what place ranking means and how it can be customized.
|
||||
|
||||
## Search rank
|
||||
|
||||
The search rank describes the extent and importance of a place. It is used
|
||||
when ranking search results. Simply put, if there are two results for a
|
||||
search query which are otherwise equal, then the result with the _lower_
|
||||
search rank will be appear higher in the result list.
|
||||
|
||||
Search ranks are not so important these days because many well-known
|
||||
places use the Wikipedia importance ranking instead.
|
||||
|
||||
The following table gives an overview of the kind of features that Nominatim
|
||||
expects for each rank:
|
||||
|
||||
rank | typical place types | extent
|
||||
-------|---------------------------------|-------
|
||||
1-3 | oceans, continents | -
|
||||
4 | countries | -
|
||||
5-9 | states, regions, provinces | -
|
||||
10-12 | counties | -
|
||||
13-16 | cities, municipalities, islands | 15 km
|
||||
17-18 | towns, boroughs | 4 km
|
||||
19 | villages, suburbs | 2 km
|
||||
20 | hamlets, farms, neighbourhoods | 1 km
|
||||
21-25 | isolated dwellings, city blocks | 500 m
|
||||
|
||||
The extent column describes how far a feature is assumed to reach when it
|
||||
is mapped only as a point. Larger features like countries and states are usually
|
||||
available with their exact area in the OpenStreetMap data. That is why no extent
|
||||
is given.
|
||||
|
||||
## Address rank
|
||||
|
||||
The address rank describes where a place shows up in an address hierarchy.
|
||||
Usually only administrative boundaries and place nodes and areas are
|
||||
eligible to be part of an address. Places that should not appear in the
|
||||
address must have an address rank of 0.
|
||||
|
||||
The following table gives an overview how ranks are mapped to address parts:
|
||||
|
||||
rank | address part
|
||||
-------------|-------------
|
||||
1-3 | _unused_
|
||||
4 | country
|
||||
5-9 | state
|
||||
10-12 | county
|
||||
13-16 | city
|
||||
17-21 | suburb
|
||||
22-24 | neighbourhood
|
||||
25 | squares, farms, localities
|
||||
26-27 | street
|
||||
28-30 | POI/house number
|
||||
|
||||
The country rank 4 usually doesn't show up in the address parts of an object.
|
||||
The country is determined indirectly from the country code.
|
||||
|
||||
Ranks 5-24 can be assigned more or less freely. They make up the major part
|
||||
of the address.
|
||||
|
||||
Rank 25 is also an addressing rank but it is special because while it can be
|
||||
the parent to a POI with an addr:place of the same name, it cannot be a parent
|
||||
to streets. Use it for place features that are technically on the same level
|
||||
as a street (e.g. squares, city blocks) or for places that should not normally
|
||||
appear in an address unless explicitly tagged so (e.g place=locality which
|
||||
should be uninhabited and as such not addressable).
|
||||
|
||||
The street ranks 26 and 27 are handled slightly differently. Only one object
|
||||
from these ranks shows up in an address.
|
||||
|
||||
For POI level objects like shops, buildings or house numbers always use rank 30.
|
||||
Ranks 28 is reserved for house number interpolations. 29 is for internal use
|
||||
only.
|
||||
|
||||
## Rank configuration
|
||||
|
||||
Search and address ranks are assigned to a place when it is first imported
|
||||
into the database. There are a few hard-coded rules for the assignment:
|
||||
|
||||
* postcodes follow special rules according to their length
|
||||
* boundaries that are not areas and railway=rail are dropped completely
|
||||
* the following are always search rank 30 and address rank 0:
|
||||
* highway nodes
|
||||
* landuse that is not an area
|
||||
|
||||
Other than that, the ranks can be freely assigned via the JSON file according
|
||||
to their type and the country they are in. The name of the config file to be
|
||||
used can be changed with the setting `NOMINATIM_ADDRESS_LEVEL_CONFIG`.
|
||||
|
||||
The address level configuration must consist of an array of configuration
|
||||
entries, each containing a tag definition and an optional country array:
|
||||
|
||||
```
|
||||
[ {
|
||||
"tags" : {
|
||||
"place" : {
|
||||
"county" : 12,
|
||||
"city" : 16,
|
||||
},
|
||||
"landuse" : {
|
||||
"residential" : 22,
|
||||
"" : 30
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"countries" : [ "ca", "us" ],
|
||||
"tags" : {
|
||||
"boundary" : {
|
||||
"administrative8" : 18,
|
||||
"administrative9" : 20
|
||||
},
|
||||
"landuse" : {
|
||||
"residential" : [22, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
The `countries` field contains a list of countries (as ISO 3166-1 alpha 2 code)
|
||||
for which the definition applies. When the field is omitted, then the
|
||||
definition is used as a fallback, when nothing more specific for a given
|
||||
country exists.
|
||||
|
||||
`tags` contains the ranks for key/value pairs. The ranks can be either a
|
||||
single number, in which case they are the search and address rank, or an array
|
||||
of search and address rank (in that order). The value may be left empty.
|
||||
Then the rank is used when no more specific value is found for the given
|
||||
key.
|
||||
|
||||
Countries and key/value combination may appear in multiple definitions. Just
|
||||
make sure that each combination of country/key/value appears only once per
|
||||
file. Otherwise the import will fail with a UNIQUE INDEX constraint violation
|
||||
on import.
|
||||
|
||||
259
docs/customize/Result-Formatting.md
Normal file
259
docs/customize/Result-Formatting.md
Normal file
@@ -0,0 +1,259 @@
|
||||
# Changing the Appearance of Results in the Server API
|
||||
|
||||
The Nominatim Server API offers a number of formatting options that
|
||||
present search results in [different output formats](../api/Output.md).
|
||||
These results only contain a subset of all the information that Nominatim
|
||||
has about the result. This page explains how to adapt the result output
|
||||
or add additional result formatting.
|
||||
|
||||
## Defining custom result formatting
|
||||
|
||||
To change the result output, you need to place a file `api/v1/format.py`
|
||||
into your project directory. This file needs to define a single variable
|
||||
`dispatch` containing a [FormatDispatcher](#formatdispatcher). This class
|
||||
serves to collect the functions for formatting the different result types
|
||||
and offers helper functions to apply the formatters.
|
||||
|
||||
There are two ways to define the `dispatch` variable. If you want to reuse
|
||||
the default output formatting and just make some changes or add an additional
|
||||
format type, then import the dispatch object from the default API:
|
||||
|
||||
``` python
|
||||
from nominatim_api.v1.format import dispatch as dispatch
|
||||
```
|
||||
|
||||
If you prefer to define a completely new result output, then you can
|
||||
create an empty dispatcher object:
|
||||
|
||||
``` python
|
||||
from nominatim_api import FormatDispatcher
|
||||
|
||||
dispatch = FormatDispatcher()
|
||||
```
|
||||
|
||||
## The formatting function
|
||||
|
||||
The dispatcher organises the formatting functions by format and result type.
|
||||
The format corresponds to the `format` parameter of the API. It can contain
|
||||
one of the predefined format names or you can invent your own new format.
|
||||
|
||||
API calls return data classes or an array of a data class which represent
|
||||
the result. You need to make sure there are formatters defined for the
|
||||
following result types:
|
||||
|
||||
* StatusResult (single object, returned by `/status`)
|
||||
* DetailedResult (single object, returned by `/details`)
|
||||
* SearchResults (list of objects, returned by `/search`)
|
||||
* ReverseResults (list of objects, returned by `/reverse` and `/lookup`)
|
||||
* RawDataList (simple object, returned by `/deletable` and `/polygons`)
|
||||
|
||||
A formatter function has the following signature:
|
||||
|
||||
``` python
|
||||
def format_func(result: ResultType, options: Mapping[str, Any]) -> str
|
||||
```
|
||||
|
||||
The options dictionary contains additional information about the original
|
||||
query. See the [reference below](#options-for-different-result-types)
|
||||
about the possible options.
|
||||
|
||||
To set the result formatter for a certain result type and format, you need
|
||||
to write the format function and decorate it with the
|
||||
[`format_func`](#nominatim_api.FormatDispatcher.format_func)
|
||||
decorator.
|
||||
|
||||
For example, let us extend the result for the status call in text format
|
||||
and add the server URL. Such a formatter would look like this:
|
||||
|
||||
``` python
|
||||
from nominatim_api import StatusResult
|
||||
|
||||
@dispatch.format_func(StatusResult, 'text')
|
||||
def _format_status_text(result, _):
|
||||
header = 'Status for server nominatim.openstreetmap.org'
|
||||
if result.status:
|
||||
return f"{header}\n\nERROR: {result.message}"
|
||||
|
||||
return f"{header}\n\nOK"
|
||||
```
|
||||
|
||||
If your dispatcher is derived from the default one, then this definition
|
||||
will overwrite the original formatter function. This way it is possible
|
||||
to customize the output of selected results.
|
||||
|
||||
## Adding new formats
|
||||
|
||||
You may also define a completely different output format. This is as simple
|
||||
as adding formatting functions for all result types using the custom
|
||||
format name:
|
||||
|
||||
``` python
|
||||
from nominatim_api import StatusResult
|
||||
|
||||
@dispatch.format_func(StatusResult, 'chatty')
|
||||
def _format_status_text(result, _):
|
||||
if result.status:
|
||||
return f"The server is currently not running. {result.message}"
|
||||
|
||||
return "Good news! The server is running just fine."
|
||||
```
|
||||
|
||||
That's all. Nominatim will automatically pick up the new format name and
|
||||
will allow the user to use it. There is no need to implement formatter
|
||||
functions for all the result types, when you invent a new one. The
|
||||
available formats will be determined for each API endpoint separately.
|
||||
To find out which formats are available, you can use the `--list-formats`
|
||||
option of the CLI tool:
|
||||
|
||||
```
|
||||
me@machine:planet-project$ nominatim status --list-formats
|
||||
2024-08-16 19:54:00: Using project directory: /home/nominatim/planet-project
|
||||
text
|
||||
json
|
||||
chatty
|
||||
debug
|
||||
me@machine:planet-project$
|
||||
```
|
||||
|
||||
The `debug` format listed in the last line will always appear. It is a
|
||||
special format that enables debug output via the command line (the same
|
||||
as the `debug=1` parameter enables for the server API). To not clash
|
||||
with this built-in function, you shouldn't name your own format 'debug'.
|
||||
|
||||
### Content type of new formats
|
||||
|
||||
All responses will be returned with the content type application/json by
|
||||
default. If your format produces a different content type, you need
|
||||
to configure the content type with the `set_content_type()` function.
|
||||
|
||||
For example, the 'chatty' format above returns just simple text. So the
|
||||
content type should be set up as:
|
||||
|
||||
``` python
|
||||
from nominatim_api.server.content_types import CONTENT_TEXT
|
||||
|
||||
dispatch.set_content_type('chatty', CONTENT_TEXT)
|
||||
```
|
||||
|
||||
The `content_types` module used above provides constants for the most
|
||||
frequent content types. You set the content type to an arbitrary string,
|
||||
if the content type you need is not available.
|
||||
|
||||
## Formatting error messages
|
||||
|
||||
Any exception thrown during processing of a request is given to
|
||||
a special error formatting function. It takes the requested content type,
|
||||
the status code and the error message. It should return the error message
|
||||
in a form appropriate for the given content type.
|
||||
|
||||
You can overwrite the default formatting function with the decorator
|
||||
`error_format_func`:
|
||||
|
||||
``` python
|
||||
import nominatim_api.server.content_types as ct
|
||||
|
||||
@dispatch.error_format_func
|
||||
def _format_error(content_type: str, msg: str, status: int) -> str:
|
||||
if content_type == ct.CONTENT_XML:
|
||||
return f"""<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<message>{msg}</message>
|
||||
"""
|
||||
if content_type == ct.CONTENT_JSON:
|
||||
return f'"{msg}"'
|
||||
|
||||
return f"ERROR: {msg}"
|
||||
```
|
||||
|
||||
|
||||
## Debugging custom formatters
|
||||
|
||||
The easiest way to try out your custom formatter is by using the Nominatim
|
||||
CLI commands. Custom formats can be chosen with the `--format` parameter:
|
||||
|
||||
```
|
||||
me@machine:planet-project$ nominatim status --format chatty
|
||||
2024-08-16 19:54:00: Using project directory: /home/nominatim/planet-project
|
||||
Good news! The server is running just fine.
|
||||
me@machine:planet-project$
|
||||
```
|
||||
|
||||
They will also emit full error messages when there is a problem with the
|
||||
code you need to debug.
|
||||
|
||||
!!! danger
|
||||
In some cases, when you make an error with your import statement, the
|
||||
CLI will not give you an error but instead tell you, that the API
|
||||
commands are no longer available:
|
||||
|
||||
me@machine: nominatim status
|
||||
usage: nominatim [-h] [--version] {import,freeze,replication,special-phrases,add-data,index,refresh,admin} ...
|
||||
nominatim: error: argument subcommand: invalid choice: 'status'
|
||||
|
||||
This happens because the CLI tool is meant to still work when the
|
||||
nominatim-api package is not installed. Import errors involving
|
||||
`nominatim_api` are interpreted as "package not installed".
|
||||
|
||||
Use the help command to find out which is the offending import that
|
||||
could not be found:
|
||||
|
||||
me@machine: nominatim -h
|
||||
... [other help text] ...
|
||||
Nominatim API package not found (was looking for module: nominatim_api.xxx).
|
||||
|
||||
## Reference
|
||||
|
||||
### FormatDispatcher
|
||||
|
||||
::: nominatim_api.FormatDispatcher
|
||||
options:
|
||||
heading_level: 6
|
||||
group_by_category: False
|
||||
|
||||
### JsonWriter
|
||||
|
||||
::: nominatim_api.utils.json_writer.JsonWriter
|
||||
options:
|
||||
heading_level: 6
|
||||
group_by_category: False
|
||||
|
||||
### Options for different result types
|
||||
|
||||
This section lists the options that may be handed in with the different result
|
||||
types in the v1 version of the Nominatim API.
|
||||
|
||||
#### StatusResult
|
||||
|
||||
_None._
|
||||
|
||||
#### DetailedResult
|
||||
|
||||
| Option | Description |
|
||||
|-----------------|-------------|
|
||||
| locales | [Locale](../library/Result-Handling.md#locale) object for the requested language(s) |
|
||||
| group_hierarchy | Setting of [group_hierarchy](../api/Details.md#output-details) parameter |
|
||||
| icon_base_url | (optional) URL pointing to icons as set in [NOMINATIM_MAPICON_URL](Settings.md#nominatim_mapicon_url) |
|
||||
|
||||
#### SearchResults
|
||||
|
||||
| Option | Description |
|
||||
|-----------------|-------------|
|
||||
| query | Original query string |
|
||||
| more_url | URL for requesting additional results for the same query |
|
||||
| exclude_place_ids | List of place IDs already returned |
|
||||
| viewbox | Setting of [viewbox](../api/Search.md#result-restriction) parameter |
|
||||
| extratags | Setting of [extratags](../api/Search.md#output-details) parameter |
|
||||
| namedetails | Setting of [namedetails](../api/Search.md#output-details) parameter |
|
||||
| addressdetails | Setting of [addressdetails](../api/Search.md#output-details) parameter |
|
||||
|
||||
#### ReverseResults
|
||||
|
||||
| Option | Description |
|
||||
|-----------------|-------------|
|
||||
| query | Original query string |
|
||||
| extratags | Setting of [extratags](../api/Search.md#output-details) parameter |
|
||||
| namedetails | Setting of [namedetails](../api/Search.md#output-details) parameter |
|
||||
| addressdetails | Setting of [addressdetails](../api/Search.md#output-details) parameter |
|
||||
|
||||
#### RawDataList
|
||||
|
||||
_None._
|
||||
60
docs/customize/SQLite.md
Normal file
60
docs/customize/SQLite.md
Normal file
@@ -0,0 +1,60 @@
|
||||
A Nominatim database can be converted into an SQLite database and used as
|
||||
a read-only source for geocoding queries. This sections describes how to
|
||||
create and use an SQLite database.
|
||||
|
||||
!!! danger
|
||||
This feature is in an experimental state at the moment. Use at your own
|
||||
risk.
|
||||
|
||||
## Installing prerequisites
|
||||
|
||||
To use a SQLite database, you need to install:
|
||||
|
||||
* SQLite (>= 3.30)
|
||||
* Spatialite (> 5.0.0)
|
||||
* aiosqlite
|
||||
|
||||
On Ubuntu/Debian, you can run:
|
||||
|
||||
sudo apt install sqlite3 libsqlite3-mod-spatialite libspatialite7
|
||||
|
||||
Install the aiosqlite Python package in your virtual environment:
|
||||
|
||||
/srv/nominatim-venv/bin/pip install aiosqlite
|
||||
|
||||
## Creating a new SQLite database
|
||||
|
||||
Nominatim cannot import directly into SQLite database. Instead you have to
|
||||
first create a geocoding database in PostgreSQL by running a
|
||||
[regular Nominatim import](../admin/Import.md).
|
||||
|
||||
Once this is done, the database can be converted to SQLite with
|
||||
|
||||
nominatim convert -o mydb.sqlite
|
||||
|
||||
This will create a database where all geocoding functions are available.
|
||||
Depending on what functions you need, the database can be made smaller:
|
||||
|
||||
* `--without-reverse` omits indexes only needed for reverse geocoding
|
||||
* `--without-search` omit tables and indexes used for forward search
|
||||
* `--without-details` leaves out extra information only available in the
|
||||
details API
|
||||
|
||||
## Using an SQLite database
|
||||
|
||||
Once you have created the database, you can use it by simply pointing the
|
||||
database DSN to the SQLite file:
|
||||
|
||||
NOMINATIM_DATABASE_DSN=sqlite:dbname=mydb.sqlite
|
||||
|
||||
Please note that SQLite support is only available for the Python frontend. To
|
||||
use the test server with an SQLite database, you therefore need to switch
|
||||
the frontend engine:
|
||||
|
||||
nominatim serve --engine falcon
|
||||
|
||||
You need to install falcon or starlette for this, depending on which engine
|
||||
you choose.
|
||||
|
||||
The CLI query commands and the library interface already use the new Python
|
||||
frontend and therefore work right out of the box.
|
||||
751
docs/customize/Settings.md
Normal file
751
docs/customize/Settings.md
Normal file
@@ -0,0 +1,751 @@
|
||||
This section provides a reference of all configuration parameters that can
|
||||
be used with Nominatim.
|
||||
|
||||
# Configuring Nominatim
|
||||
|
||||
Nominatim uses [dotenv](https://github.com/theskumar/python-dotenv) to manage
|
||||
its configuration settings. There are two means to set configuration
|
||||
variables: through an `.env` configuration file or through an environment
|
||||
variable.
|
||||
|
||||
The `.env` configuration file needs to be placed into the
|
||||
[project directory](../admin/Import.md#creating-the-project-directory). It
|
||||
must contain configuration parameters in `<parameter>=<value>` format.
|
||||
Please refer to the dotenv documentation for details.
|
||||
|
||||
The configuration options may also be set in the form of shell environment
|
||||
variables. This is particularly useful, when you want to temporarily change
|
||||
a configuration option. For example, to force the replication serve to
|
||||
download the next change, you can temporarily disable the update interval:
|
||||
|
||||
NOMINATIM_REPLICATION_UPDATE_INTERVAL=0 nominatim replication --once
|
||||
|
||||
If a configuration option is defined through .env file and environment
|
||||
variable, then the latter takes precedence.
|
||||
|
||||
## Configuration Parameter Reference
|
||||
|
||||
### Import and Database Settings
|
||||
|
||||
#### NOMINATIM_DATABASE_DSN
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Database connection string |
|
||||
| **Format:** | string: `pgsql:<param1>=<value1>;<param2>=<value2>;...` |
|
||||
| **Default:** | pgsql:dbname=nominatim |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
|
||||
Sets the connection parameters for the Nominatim database. At a minimum
|
||||
the name of the database (`dbname`) is required. You can set any additional
|
||||
parameter that is understood by libpq. See the [Postgres documentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS) for a full list.
|
||||
|
||||
!!! note
|
||||
It is usually recommended not to set the password directly in this
|
||||
configuration parameter. Use a
|
||||
[password file](https://www.postgresql.org/docs/current/libpq-pgpass.html)
|
||||
instead.
|
||||
|
||||
|
||||
#### NOMINATIM_DATABASE_WEBUSER
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Database query user |
|
||||
| **Format:** | string |
|
||||
| **Default:** | www-data |
|
||||
| **After Changes:** | cannot be changed after import |
|
||||
|
||||
Defines the name of the database user that will run search queries. Usually
|
||||
this is the user under which the webserver is executed. When running Nominatim
|
||||
via php-fpm, you can also define a separate query user. The Postgres user
|
||||
needs to be set up before starting the import.
|
||||
|
||||
Nominatim grants minimal rights to this user to all tables that are needed
|
||||
for running geocoding queries.
|
||||
|
||||
|
||||
#### NOMINATIM_DATABASE_MODULE_PATH
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Directory where to find the PostgreSQL server module |
|
||||
| **Format:** | path |
|
||||
| **Default:** | _empty_ (use `<project_directory>/module`) |
|
||||
| **After Changes:** | run `nominatim refresh --functions` |
|
||||
| **Comment:** | Legacy tokenizer only |
|
||||
|
||||
Defines the directory in which the PostgreSQL server module `nominatim.so`
|
||||
is stored. The directory and module must be accessible by the PostgreSQL
|
||||
server.
|
||||
|
||||
For information on how to use this setting when working with external databases,
|
||||
see [Advanced Installations](../admin/Advanced-Installations.md).
|
||||
|
||||
The option is only used by the Legacy tokenizer and ignored otherwise.
|
||||
|
||||
|
||||
#### NOMINATIM_TOKENIZER
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Tokenizer used for normalizing and parsing queries and names |
|
||||
| **Format:** | string |
|
||||
| **Default:** | icu |
|
||||
| **After Changes:** | cannot be changed after import |
|
||||
|
||||
Sets the tokenizer type to use for the import. For more information on
|
||||
available tokenizers and how they are configured, see
|
||||
[Tokenizers](../customize/Tokenizers.md).
|
||||
|
||||
|
||||
#### NOMINATIM_TOKENIZER_CONFIG
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Configuration file for the tokenizer |
|
||||
| **Format:** | path |
|
||||
| **Default:** | _empty_ (default file depends on tokenizer) |
|
||||
| **After Changes:** | see documentation for each tokenizer |
|
||||
|
||||
Points to the file with additional configuration for the tokenizer.
|
||||
See the [Tokenizer](../customize/Tokenizers.md) descriptions for details
|
||||
on the file format.
|
||||
|
||||
If a relative path is given, then the file is searched first relative to the
|
||||
project directory and then in the global settings directory.
|
||||
|
||||
#### NOMINATIM_MAX_WORD_FREQUENCY
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Number of occurrences before a word is considered frequent |
|
||||
| **Format:** | int |
|
||||
| **Default:** | 50000 |
|
||||
| **After Changes:** | cannot be changed after import |
|
||||
| **Comment:** | Legacy tokenizer only |
|
||||
|
||||
The word frequency count is used by the Legacy tokenizer to automatically
|
||||
identify _stop words_. Any partial term that occurs more often then what
|
||||
is defined in this setting, is effectively ignored during search.
|
||||
|
||||
|
||||
#### NOMINATIM_LIMIT_REINDEXING
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Avoid invalidating large areas |
|
||||
| **Format:** | bool |
|
||||
| **Default:** | yes |
|
||||
|
||||
Nominatim computes the address of each place at indexing time. This has the
|
||||
advantage to make search faster but also means that more objects needs to
|
||||
be invalidated when the data changes. For example, changing the name of
|
||||
the state of Florida would require recomputing every single address point
|
||||
in the state to make the new name searchable in conjunction with addresses.
|
||||
|
||||
Setting this option to 'yes' means that Nominatim skips reindexing of contained
|
||||
objects when the area becomes too large.
|
||||
|
||||
|
||||
#### NOMINATIM_LANGUAGES
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Restrict search languages |
|
||||
| **Format:** | string: comma-separated list of language codes |
|
||||
| **Default:** | _empty_ |
|
||||
|
||||
Normally Nominatim will include all language variants of name:XX
|
||||
in the search index. Set this to a comma separated list of language
|
||||
codes, to restrict import to a subset of languages.
|
||||
|
||||
Currently only affects the initial import of country names and special phrases.
|
||||
|
||||
|
||||
#### NOMINATIM_TERM_NORMALIZATION
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Rules for normalizing terms for comparisons |
|
||||
| **Format:** | string: semicolon-separated list of ICU rules |
|
||||
| **Default:** | :: NFD (); [[:Nonspacing Mark:] [:Cf:]] >; :: lower (); [[:Punctuation:][:Space:]]+ > ' '; :: NFC (); |
|
||||
| **Comment:** | Legacy tokenizer only |
|
||||
|
||||
[Special phrases](Special-Phrases.md) have stricter matching requirements than
|
||||
normal search terms. They must appear exactly in the query after this term
|
||||
normalization has been applied.
|
||||
|
||||
Only has an effect on the Legacy tokenizer. For the ICU tokenizer the rules
|
||||
defined in the
|
||||
[normalization section](Tokenizers.md#normalization-and-transliteration)
|
||||
will be used.
|
||||
|
||||
|
||||
#### NOMINATIM_USE_US_TIGER_DATA
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Enable searching for Tiger house number data |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | no |
|
||||
| **After Changes:** | run `nominatim refresh --functions` |
|
||||
|
||||
When this setting is enabled, search and reverse queries also take data
|
||||
from [Tiger house number data](Tiger.md) into account.
|
||||
|
||||
|
||||
#### NOMINATIM_USE_AUX_LOCATION_DATA
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Enable searching in external house number tables |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | no |
|
||||
| **After Changes:** | run `nominatim refresh --functions` |
|
||||
| **Comment:** | Do not use. |
|
||||
|
||||
When this setting is enabled, search queries also take data from external
|
||||
house number tables into account.
|
||||
|
||||
*Warning:* This feature is currently unmaintained and should not be used.
|
||||
|
||||
|
||||
#### NOMINATIM_HTTP_PROXY
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Use HTTP proxy when downloading data |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | no |
|
||||
|
||||
When this setting is enabled and at least
|
||||
[NOMINATIM_HTTP_PROXY_HOST](#nominatim_http_proxy_host) and
|
||||
[NOMINATIM_HTTP_PROXY_PORT](#nominatim_http_proxy_port) are set, the
|
||||
configured proxy will be used, when downloading external data like
|
||||
replication diffs.
|
||||
|
||||
|
||||
#### NOMINATIM_HTTP_PROXY_HOST
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Host name of the proxy to use |
|
||||
| **Format:** | string |
|
||||
| **Default:** | _empty_ |
|
||||
|
||||
When [NOMINATIM_HTTP_PROXY](#nominatim_http_proxy) is enabled, this setting
|
||||
configures the proxy host name.
|
||||
|
||||
|
||||
#### NOMINATIM_HTTP_PROXY_PORT
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Port number of the proxy to use |
|
||||
| **Format:** | integer |
|
||||
| **Default:** | 3128 |
|
||||
|
||||
When [NOMINATIM_HTTP_PROXY](#nominatim_http_proxy) is enabled, this setting
|
||||
configures the port number to use with the proxy.
|
||||
|
||||
|
||||
#### NOMINATIM_HTTP_PROXY_LOGIN
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Username for proxies that require login |
|
||||
| **Format:** | string |
|
||||
| **Default:** | _empty_ |
|
||||
|
||||
When [NOMINATIM_HTTP_PROXY](#nominatim_http_proxy) is enabled, use this
|
||||
setting to define the username for proxies that require a login.
|
||||
|
||||
|
||||
#### NOMINATIM_HTTP_PROXY_PASSWORD
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Password for proxies that require login |
|
||||
| **Format:** | string |
|
||||
| **Default:** | _empty_ |
|
||||
|
||||
When [NOMINATIM_HTTP_PROXY](#nominatim_http_proxy) is enabled, use this
|
||||
setting to define the password for proxies that require a login.
|
||||
|
||||
|
||||
#### NOMINATIM_OSM2PGSQL_BINARY
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Location of the osm2pgsql binary |
|
||||
| **Format:** | path |
|
||||
| **Default:** | _empty_ (use binary shipped with Nominatim) |
|
||||
| **Comment:** | EXPERT ONLY |
|
||||
|
||||
Nominatim uses [osm2pgsql](https://osm2pgsql.org) to load the OSM data
|
||||
initially into the database. Nominatim comes bundled with a version of
|
||||
osm2pgsql that is guaranteed to be compatible. Use this setting to use
|
||||
a different binary instead. You should do this only when you know exactly
|
||||
what you are doing. If the osm2pgsql version is not compatible, then the
|
||||
result is undefined.
|
||||
|
||||
|
||||
#### NOMINATIM_WIKIPEDIA_DATA_PATH
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Directory with the wikipedia importance data |
|
||||
| **Format:** | path |
|
||||
| **Default:** | _empty_ (project directory) |
|
||||
|
||||
Set a custom location for the
|
||||
[wikipedia ranking file](../admin/Import.md#wikipediawikidata-rankings). When
|
||||
unset, Nominatim expects the data to be saved in the project directory.
|
||||
|
||||
#### NOMINATIM_ADDRESS_LEVEL_CONFIG
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Configuration file for rank assignments |
|
||||
| **Format:** | path |
|
||||
| **Default:** | address-levels.json |
|
||||
|
||||
The _address level configuration_ defines the rank assignments for places. See
|
||||
[Place Ranking](Ranking.md) for a detailed explanation what rank assignments
|
||||
are and what the configuration file must look like.
|
||||
|
||||
When a relative path is given, then the file is searched first relative to the
|
||||
project directory and then in the global settings directory.
|
||||
|
||||
|
||||
#### NOMINATIM_IMPORT_STYLE
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Configuration to use for the initial OSM data import |
|
||||
| **Format:** | string or path |
|
||||
| **Default:** | extratags |
|
||||
|
||||
The _style configuration_ describes which OSM objects and tags are taken
|
||||
into consideration for the search database. Nominatim comes with a set
|
||||
of pre-configured styles, that may be configured here.
|
||||
|
||||
You can also write your own custom style and point the setting to the file
|
||||
with the style. When a relative path is given, then the style file is searched
|
||||
first relative to the project directory and then in the global settings
|
||||
directory.
|
||||
|
||||
See [Import Styles](Import-Styles.md)
|
||||
for more information on the available internal styles and the format of the
|
||||
configuration file.
|
||||
|
||||
#### NOMINATIM_FLATNODE_FILE
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Location of osm2pgsql flatnode file |
|
||||
| **Format:** | path |
|
||||
| **Default:** | _empty_ (do not use a flatnote file) |
|
||||
| **After Changes:** | Only change when moving the file physically. |
|
||||
|
||||
The `osm2pgsql flatnode file` is file that efficiently stores geographic
|
||||
location for OSM nodes. For larger imports it can significantly speed up
|
||||
the import. When this option is unset, then osm2pgsql uses a PsotgreSQL table
|
||||
to store the locations.
|
||||
|
||||
When a relative path is given, then the flatnode file is created/searched
|
||||
relative to the project directory.
|
||||
|
||||
!!! warning
|
||||
|
||||
The flatnode file is not only used during the initial import but also
|
||||
when adding new data with `nominatim add-data` or `nominatim replication`.
|
||||
Make sure you keep the flatnode file around and this setting unmodified,
|
||||
if you plan to add more data or run regular updates.
|
||||
|
||||
|
||||
#### NOMINATIM_TABLESPACE_*
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Group of settings for distributing the database over tablespaces |
|
||||
| **Format:** | string |
|
||||
| **Default:** | _empty_ (do not use a table space) |
|
||||
| **After Changes:** | no effect after initial import |
|
||||
|
||||
Nominatim allows to distribute the search database over up to 10 different
|
||||
[PostgreSQL tablespaces](https://www.postgresql.org/docs/current/manage-ag-tablespaces.html).
|
||||
If you use this option, make sure that the tablespaces exist before starting
|
||||
the import.
|
||||
|
||||
The available tablespace groups are:
|
||||
|
||||
NOMINATIM_TABLESPACE_SEARCH_DATA
|
||||
: Data used by the geocoding frontend.
|
||||
|
||||
NOMINATIM_TABLESPACE_SEARCH_INDEX
|
||||
: Indexes used by the geocoding frontend.
|
||||
|
||||
NOMINATIM_TABLESPACE_OSM_DATA
|
||||
: Raw OSM data cache used for import and updates.
|
||||
|
||||
NOMINATIM_TABLESPACE_OSM_DATA
|
||||
: Indexes on the raw OSM data cache.
|
||||
|
||||
NOMINATIM_TABLESPACE_PLACE_DATA
|
||||
: Data table with the pre-filtered but still unprocessed OSM data.
|
||||
Used only during imports and updates.
|
||||
|
||||
NOMINATIM_TABLESPACE_PLACE_INDEX
|
||||
: Indexes on raw data table. Used only during imports and updates.
|
||||
|
||||
NOMINATIM_TABLESPACE_ADDRESS_DATA
|
||||
: Data tables used for computing search terms and addresses of places
|
||||
during import and updates.
|
||||
|
||||
NOMINATIM_TABLESPACE_ADDRESS_INDEX
|
||||
: Indexes on the data tables for search term and address computation.
|
||||
Used only for import and updates.
|
||||
|
||||
NOMINATIM_TABLESPACE_AUX_DATA
|
||||
: Auxiliary data tables for non-OSM data, e.g. for Tiger house number data.
|
||||
|
||||
NOMINATIM_TABLESPACE_AUX_INDEX
|
||||
: Indexes on auxiliary data tables.
|
||||
|
||||
|
||||
### Replication Update Settings
|
||||
|
||||
#### NOMINATIM_REPLICATION_URL
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Base URL of the replication service |
|
||||
| **Format:** | url |
|
||||
| **Default:** | https://planet.openstreetmap.org/replication/minute |
|
||||
| **After Changes:** | run `nominatim replication --init` |
|
||||
|
||||
Replication services deliver updates to OSM data. Use this setting to choose
|
||||
which replication service to use. See [Updates](../admin/Update.md) for more
|
||||
information on how to set up regular updates.
|
||||
|
||||
#### NOMINATIM_REPLICATION_MAX_DIFF
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Maximum amount of data to download per update cycle (in MB) |
|
||||
| **Format:** | integer |
|
||||
| **Default:** | 50 |
|
||||
| **After Changes:** | restart the replication process |
|
||||
|
||||
At each update cycle Nominatim downloads diffs until either no more diffs
|
||||
are available on the server (i.e. the database is up-to-date) or the limit
|
||||
given in this setting is exceeded. Nominatim guarantees to downloads at least
|
||||
one diff, if one is available, no matter how small the setting.
|
||||
|
||||
The default for this setting is fairly conservative because Nominatim keeps
|
||||
all data downloaded in one cycle in RAM. Using large values in a production
|
||||
server may interfere badly with the search frontend because it evicts data
|
||||
from RAM that is needed for speedy answers to incoming requests. It is usually
|
||||
a better idea to keep this setting lower and run multiple update cycles
|
||||
to catch up with updates.
|
||||
|
||||
When catching up in non-production mode, for example after the initial import,
|
||||
the setting can easily be changed temporarily on the command line:
|
||||
|
||||
NOMINATIM_REPLICATION_MAX_DIFF=3000 nominatim replication
|
||||
|
||||
|
||||
#### NOMINATIM_REPLICATION_UPDATE_INTERVAL
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Publication interval of the replication service (in seconds) |
|
||||
| **Format:** | integer |
|
||||
| **Default:** | 75 |
|
||||
| **After Changes:** | restart the replication process |
|
||||
|
||||
This setting determines when Nominatim will attempt to download again a new
|
||||
update. The time is computed from the publication date of the last diff
|
||||
downloaded. Setting this to a slightly higher value than the actual
|
||||
publication interval avoids unnecessary rechecks.
|
||||
|
||||
|
||||
#### NOMINATIM_REPLICATION_RECHECK_INTERVAL
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Wait time to recheck for a pending update (in seconds) |
|
||||
| **Format:** | integer |
|
||||
| **Default:** | 60 |
|
||||
| **After Changes:** | restart the replication process |
|
||||
|
||||
When replication updates are run in continuous mode (using `nominatim replication`),
|
||||
this setting determines how long Nominatim waits until it looks for updates
|
||||
again when updates were not available on the server.
|
||||
|
||||
Note that this is different from
|
||||
[NOMINATIM_REPLICATION_UPDATE_INTERVAL](#nominatim_replication_update_interval).
|
||||
Nominatim will never attempt to query for new updates for UPDATE_INTERVAL
|
||||
seconds after the current database date. Only after the update interval has
|
||||
passed it asks for new data. If then no new data is found, it waits for
|
||||
RECHECK_INTERVAL seconds before it attempts again.
|
||||
|
||||
### API Settings
|
||||
|
||||
#### NOMINATIM_CORS_NOACCESSCONTROL
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Send permissive CORS access headers |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | yes |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
|
||||
When this setting is enabled, API HTTP responses include the HTTP
|
||||
[CORS](https://en.wikipedia.org/wiki/CORS) headers
|
||||
`access-control-allow-origin: *` and `access-control-allow-methods: OPTIONS,GET`.
|
||||
|
||||
#### NOMINATIM_MAPICON_URL
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | URL prefix for static icon images |
|
||||
| **Format:** | url |
|
||||
| **Default:** | _empty_ |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
|
||||
When a mapicon URL is configured, then Nominatim includes an additional `icon`
|
||||
field in the responses, pointing to an appropriate icon for the place type.
|
||||
|
||||
Map icons used to be included in Nominatim itself but now have moved to the
|
||||
[nominatim-ui](https://github.com/osm-search/nominatim-ui/) project. If you
|
||||
want the URL to be included in API responses, make the `/mapicon`
|
||||
directory of the project available under a public URL and point this setting
|
||||
to the directory.
|
||||
|
||||
|
||||
#### NOMINATIM_DEFAULT_LANGUAGE
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Language of responses when no language is requested |
|
||||
| **Format:** | language code |
|
||||
| **Default:** | _empty_ (use the local language of the feature) |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
|
||||
Nominatim localizes the place names in responses when the corresponding
|
||||
translation is available. Users can request a custom language setting through
|
||||
the HTTP accept-languages header or through the explicit parameter
|
||||
[accept-languages](../api/Search.md#language-of-results). If neither is
|
||||
given, it falls back to this setting. If the setting is also empty, then
|
||||
the local languages (in OSM: the name tag without any language suffix) is
|
||||
used.
|
||||
|
||||
|
||||
#### NOMINATIM_SEARCH_BATCH_MODE
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Enable a special batch query mode |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | no |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
| **Comment:** | PHP frontend only |
|
||||
|
||||
|
||||
This feature is currently undocumented and potentially broken.
|
||||
|
||||
|
||||
#### NOMINATIM_SEARCH_NAME_ONLY_THRESHOLD
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Threshold for switching the search index lookup strategy |
|
||||
| **Format:** | integer |
|
||||
| **Default:** | 500 |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
| **Comment:** | PHP frontend only |
|
||||
|
||||
This setting defines the threshold over which a name is no longer considered
|
||||
as rare. When searching for places with rare names, only the name is used
|
||||
for place lookups. Otherwise the name and any address information is used.
|
||||
|
||||
This setting only has an effect after `nominatim refresh --word-counts` has
|
||||
been called to compute the word frequencies.
|
||||
|
||||
|
||||
#### NOMINATIM_LOOKUP_MAX_COUNT
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Maximum number of OSM ids accepted by /lookup |
|
||||
| **Format:** | integer |
|
||||
| **Default:** | 50 |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
|
||||
The /lookup point accepts list of ids to look up address details for. This
|
||||
setting restricts the number of places a user may look up with a single
|
||||
request.
|
||||
|
||||
|
||||
#### NOMINATIM_POLYGON_OUTPUT_MAX_TYPES
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Number of different geometry formats that may be returned |
|
||||
| **Format:** | integer |
|
||||
| **Default:** | 1 |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
|
||||
Nominatim supports returning full geometries of places. The geometries may
|
||||
be requested in different formats with one of the
|
||||
[`polygon_*` parameters](../api/Search.md#polygon-output). Use this
|
||||
setting to restrict the number of geometry types that may be requested
|
||||
with a single query.
|
||||
|
||||
Setting this parameter to 0 disables polygon output completely.
|
||||
|
||||
|
||||
#### NOMINATIM_SEARCH_WITHIN_COUNTRIES
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Disable search for elements that are not in the country grid |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | no |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
| **Comment:** | PHP frontend only |
|
||||
|
||||
Enable to search elements just within countries.
|
||||
|
||||
When enabled, if, despite not finding a point within the static grid of countries, it
|
||||
finds a geometry of a region, do not return the geometry.
|
||||
Return "Unable to geocode" instead.
|
||||
|
||||
|
||||
#### NOMINATIM_SERVE_LEGACY_URLS
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Enable serving via URLs with a .php suffix |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | yes |
|
||||
| **Comment:** | Python frontend only |
|
||||
|
||||
When enabled, then endpoints are reachable as `/<name>` as well as `/<name>.php`.
|
||||
This can be useful when you want to be backwards-compatible with previous
|
||||
versions of Nominatim.
|
||||
|
||||
|
||||
#### NOMINATIM_API_POOL_SIZE
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Number of parallel database connections per worker |
|
||||
| **Format:** | number |
|
||||
| **Default:** | 10 |
|
||||
| **Comment:** | Python frontend only |
|
||||
|
||||
Sets the maximum number of database connections available for a single instance
|
||||
of Nominatim. When configuring the maximum number of connections that your
|
||||
PostgreSQL database can handle, you need at least
|
||||
`NOMINATIM_API_POOL_SIZE` * `<number of configured workers>` connections.
|
||||
For configuring the number of workers, refer to the section about
|
||||
[Deploying the Python frontend](../admin/Deployment-Python.md).
|
||||
|
||||
#### NOMINATIM_QUERY_TIMEOUT
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Timeout for SQL queries to the database |
|
||||
| **Format:** | number (seconds) |
|
||||
| **Default:** | 10 |
|
||||
| **Comment:** | Python frontend only |
|
||||
|
||||
When this timeout is set, then all SQL queries that run longer than the
|
||||
specified numbers of seconds will be cancelled and the user receives a
|
||||
timeout exceptions. Users of the API see a 503 HTTP error.
|
||||
|
||||
The timeout does ont apply when using the
|
||||
[low-level DB access](../library/Low-Level-DB-Access.md)
|
||||
of the library. A timeout can be manually set, if required.
|
||||
|
||||
|
||||
#### NOMINATIM_REQUEST_TIMEOUT
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Timeout for search queries |
|
||||
| **Format:** | number (seconds) |
|
||||
| **Default:** | 60 |
|
||||
| **Comment:** | Python frontend only |
|
||||
|
||||
When this timeout is set, a search query will finish sending queries
|
||||
to the database after the timeout has passed and immediately return the
|
||||
results gathered so far.
|
||||
|
||||
Note that under high load you may observe that users receive different results
|
||||
than usual without seeing an error. This may cause some confusion.
|
||||
|
||||
### Logging Settings
|
||||
|
||||
#### NOMINATIM_LOG_DB
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Log requests into the database |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | no |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
|
||||
Enable logging requests into a database table with this setting. The logs
|
||||
can be found in the table `new_query_log`.
|
||||
|
||||
When using this logging method, it is advisable to set up a job that
|
||||
regularly clears out old logging information. Nominatim will not do that
|
||||
on its own.
|
||||
|
||||
Can be used as the same time as NOMINATIM_LOG_FILE.
|
||||
|
||||
#### NOMINATIM_LOG_FILE
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Log requests into a file |
|
||||
| **Format:** | path |
|
||||
| **Default:** | _empty_ (logging disabled) |
|
||||
| **After Changes:** | run `nominatim refresh --website` |
|
||||
|
||||
Enable logging of requests into a file with this setting by setting the log
|
||||
file where to log to. A relative file name is assumed to be relative to
|
||||
the project directory.
|
||||
|
||||
|
||||
The entries in the log file have the following format:
|
||||
|
||||
<request time> <execution time in s> <number of results> <type> "<query string>"
|
||||
|
||||
Request time is the time when the request was started. The execution time is
|
||||
given in seconds and corresponds to the time the query took executing in PHP.
|
||||
type contains the name of the endpoint used.
|
||||
|
||||
Can be used as the same time as NOMINATIM_LOG_DB.
|
||||
|
||||
#### NOMINATIM_DEBUG_SQL
|
||||
|
||||
| Summary | |
|
||||
| -------------- | --------------------------------------------------- |
|
||||
| **Description:** | Enable printing of raw SQL by SQLAlchemy |
|
||||
| **Format:** | boolean |
|
||||
| **Default:** | no |
|
||||
| **Comment:** | **For developers only.** |
|
||||
|
||||
This settings enables
|
||||
[SQL debugging](https://docs.sqlalchemy.org/en/20/core/engines.html#dbengine-logging)
|
||||
by SQLAlchemy. This can be helpful when debugging some bugs with internal
|
||||
query handling. It should only be used together with the CLI query functions.
|
||||
Enabling it for server mode may have unintended consequences. Use the `debug`
|
||||
parameter instead, which prints information on how the search is executed
|
||||
including SQL statements.
|
||||
49
docs/customize/Special-Phrases.md
Normal file
49
docs/customize/Special-Phrases.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Special phrases
|
||||
|
||||
## Importing OSM user-maintained special phrases
|
||||
|
||||
As described in the [Import section](../admin/Import.md), it is possible to
|
||||
import special phrases from the wiki with the following command:
|
||||
|
||||
```sh
|
||||
nominatim special-phrases --import-from-wiki
|
||||
```
|
||||
|
||||
## Importing custom special phrases
|
||||
|
||||
Special phrases may also be imported from any custom CSV file. The file needs
|
||||
to have a header line, use comma as delimiter and define the following
|
||||
columns:
|
||||
|
||||
* **phrase**: the keyword to look for
|
||||
* **class**: key of the main tag of the place to find
|
||||
(see [principal tags in import style](Import-Styles.md#set_main_tags-principal-tags)
|
||||
* **type**: value of the main tag
|
||||
* **operator**: type of special phrase, may be one of:
|
||||
* *in*: place is within the place defined by the search term (e.g. "_Hotels in_ Berlin")
|
||||
* *near*: place is near the place defined by the search term (e.g. "_bus stops near_ Big Ben")
|
||||
* *named*: special phrase is a classifier (e.g. "_hotel_ California")
|
||||
* *-*: unspecified, can be any of the above
|
||||
|
||||
If the file contains any other columns, then they are silently ignored
|
||||
|
||||
To import the CSV file, use the following command:
|
||||
|
||||
```sh
|
||||
nominatim special-phrases --import-from-csv <csv file>
|
||||
```
|
||||
|
||||
Note that the two previous import commands will update the phrases from your database.
|
||||
This means that if you import some phrases from a CSV file, only the phrases
|
||||
present in the CSV file will be kept in the database. All other phrases will
|
||||
be removed.
|
||||
|
||||
If you want to only add new phrases and not update the other ones you can add
|
||||
the argument `--no-replace` to the import command. For example:
|
||||
|
||||
```sh
|
||||
nominatim special-phrases --import-from-csv <csv file> --no-replace
|
||||
```
|
||||
|
||||
This will add the phrases present in the CSV file into the database without
|
||||
removing the other ones.
|
||||
28
docs/customize/Tiger.md
Normal file
28
docs/customize/Tiger.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Installing TIGER housenumber data for the US
|
||||
|
||||
Nominatim is able to use the official [TIGER](https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html)
|
||||
address set to complement the OSM house number data in the US. You can add
|
||||
TIGER data to your own Nominatim instance by following these steps. The
|
||||
entire US adds about 10GB to your database.
|
||||
|
||||
1. Get preprocessed TIGER data:
|
||||
|
||||
cd $PROJECT_DIR
|
||||
wget https://nominatim.org/data/tiger-nominatim-preprocessed-latest.csv.tar.gz
|
||||
|
||||
2. Import the data into your Nominatim database:
|
||||
|
||||
nominatim add-data --tiger-data tiger-nominatim-preprocessed-latest.csv.tar.gz
|
||||
|
||||
3. Enable use of the Tiger data in your existing `.env` file by adding:
|
||||
|
||||
echo NOMINATIM_USE_US_TIGER_DATA=yes >> .env
|
||||
|
||||
4. Apply the new settings:
|
||||
|
||||
nominatim refresh --functions --website
|
||||
|
||||
|
||||
See the [TIGER-data project](https://github.com/osm-search/TIGER-data) for more
|
||||
information on how the data got preprocessed.
|
||||
|
||||
410
docs/customize/Tokenizers.md
Normal file
410
docs/customize/Tokenizers.md
Normal file
@@ -0,0 +1,410 @@
|
||||
# Tokenizers
|
||||
|
||||
The tokenizer module in Nominatim is responsible for analysing the names given
|
||||
to OSM objects and the terms of an incoming query in order to make sure, they
|
||||
can be matched appropriately.
|
||||
|
||||
Nominatim offers different tokenizer modules, which behave differently and have
|
||||
different configuration options. This sections describes the tokenizers and how
|
||||
they can be configured.
|
||||
|
||||
!!! important
|
||||
The use of a tokenizer is tied to a database installation. You need to choose
|
||||
and configure the tokenizer before starting the initial import. Once the import
|
||||
is done, you cannot switch to another tokenizer anymore. Reconfiguring the
|
||||
chosen tokenizer is very limited as well. See the comments in each tokenizer
|
||||
section.
|
||||
|
||||
## Legacy tokenizer
|
||||
|
||||
!!! danger
|
||||
The Legacy tokenizer is deprecated and will be removed in Nominatim 5.0.
|
||||
If you still use a database with the legacy tokenizer, you must reimport
|
||||
it using the ICU tokenizer below.
|
||||
|
||||
The legacy tokenizer implements the analysis algorithms of older Nominatim
|
||||
versions. It uses a special Postgresql module to normalize names and queries.
|
||||
This tokenizer is automatically installed and used when upgrading an older
|
||||
database. It should not be used for new installations anymore.
|
||||
|
||||
### Compiling the PostgreSQL module
|
||||
|
||||
The tokeinzer needs a special C module for PostgreSQL which is not compiled
|
||||
by default. If you need the legacy tokenizer, compile Nominatim as follows:
|
||||
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DBUILD_MODULE=on
|
||||
make
|
||||
```
|
||||
|
||||
### Enabling the tokenizer
|
||||
|
||||
To enable the tokenizer add the following line to your project configuration:
|
||||
|
||||
```
|
||||
NOMINATIM_TOKENIZER=legacy
|
||||
```
|
||||
|
||||
The Postgresql module for the tokenizer is available in the `module` directory
|
||||
and also installed with the remainder of the software under
|
||||
`lib/nominatim/module/nominatim.so`. You can specify a custom location for
|
||||
the module with
|
||||
|
||||
```
|
||||
NOMINATIM_DATABASE_MODULE_PATH=<path to directory where nominatim.so resides>
|
||||
```
|
||||
|
||||
This is in particular useful when the database runs on a different server.
|
||||
See [Advanced installations](../admin/Advanced-Installations.md#using-an-external-postgresql-database) for details.
|
||||
|
||||
There are no other configuration options for the legacy tokenizer. All
|
||||
normalization functions are hard-coded.
|
||||
|
||||
## ICU tokenizer
|
||||
|
||||
The ICU tokenizer uses the [ICU library](http://site.icu-project.org/) to
|
||||
normalize names and queries. It also offers configurable decomposition and
|
||||
abbreviation handling.
|
||||
This tokenizer is currently the default.
|
||||
|
||||
To enable the tokenizer add the following line to your project configuration:
|
||||
|
||||
```
|
||||
NOMINATIM_TOKENIZER=icu
|
||||
```
|
||||
|
||||
### How it works
|
||||
|
||||
On import the tokenizer processes names in the following three stages:
|
||||
|
||||
1. During the **Sanitizer step** incoming names are cleaned up and converted to
|
||||
**full names**. This step can be used to regularize spelling, split multi-name
|
||||
tags into their parts and tag names with additional attributes. See the
|
||||
[Sanitizers section](#sanitizers) below for available cleaning routines.
|
||||
2. The **Normalization** part removes all information from the full names
|
||||
that are not relevant for search.
|
||||
3. The **Token analysis** step takes the normalized full names and creates
|
||||
all transliterated variants under which the name should be searchable.
|
||||
See the [Token analysis](#token-analysis) section below for more
|
||||
information.
|
||||
|
||||
During query time, only normalization and transliteration are relevant.
|
||||
An incoming query is first split into name chunks (this usually means splitting
|
||||
the string at the commas) and the each part is normalised and transliterated.
|
||||
The result is used to look up places in the search index.
|
||||
|
||||
### Configuration
|
||||
|
||||
The ICU tokenizer is configured using a YAML file which can be configured using
|
||||
`NOMINATIM_TOKENIZER_CONFIG`. The configuration is read on import and then
|
||||
saved as part of the internal database status. Later changes to the variable
|
||||
have no effect.
|
||||
|
||||
Here is an example configuration file:
|
||||
|
||||
``` yaml
|
||||
normalization:
|
||||
- ":: lower ()"
|
||||
- "ß > 'ss'" # German szet is unambiguously equal to double ss
|
||||
transliteration:
|
||||
- !include /etc/nominatim/icu-rules/extended-unicode-to-asccii.yaml
|
||||
- ":: Ascii ()"
|
||||
sanitizers:
|
||||
- step: split-name-list
|
||||
token-analysis:
|
||||
- analyzer: generic
|
||||
variants:
|
||||
- !include icu-rules/variants-ca.yaml
|
||||
- words:
|
||||
- road -> rd
|
||||
- bridge -> bdge,br,brdg,bri,brg
|
||||
mutations:
|
||||
- pattern: 'ä'
|
||||
replacements: ['ä', 'ae']
|
||||
```
|
||||
|
||||
The configuration file contains four sections:
|
||||
`normalization`, `transliteration`, `sanitizers` and `token-analysis`.
|
||||
|
||||
#### Normalization and Transliteration
|
||||
|
||||
The normalization and transliteration sections each define a set of
|
||||
ICU rules that are applied to the names.
|
||||
|
||||
The **normalization** rules are applied after sanitation. They should remove
|
||||
any information that is not relevant for search at all. Usual rules to be
|
||||
applied here are: lower-casing, removing of special characters, cleanup of
|
||||
spaces.
|
||||
|
||||
The **transliteration** rules are applied at the end of the tokenization
|
||||
process to transfer the name into an ASCII representation. Transliteration can
|
||||
be useful to allow for further fuzzy matching, especially between different
|
||||
scripts.
|
||||
|
||||
Each section must contain a list of
|
||||
[ICU transformation rules](https://unicode-org.github.io/icu/userguide/transforms/general/rules.html).
|
||||
The rules are applied in the order in which they appear in the file.
|
||||
You can also include additional rules from external yaml file using the
|
||||
`!include` tag. The included file must contain a valid YAML list of ICU rules
|
||||
and may again include other files.
|
||||
|
||||
!!! warning
|
||||
The ICU rule syntax contains special characters that conflict with the
|
||||
YAML syntax. You should therefore always enclose the ICU rules in
|
||||
double-quotes.
|
||||
|
||||
#### Sanitizers
|
||||
|
||||
The sanitizers section defines an ordered list of functions that are applied
|
||||
to the name and address tags before they are further processed by the tokenizer.
|
||||
They allows to clean up the tagging and bring it to a standardized form more
|
||||
suitable for building the search index.
|
||||
|
||||
!!! hint
|
||||
Sanitizers only have an effect on how the search index is built. They
|
||||
do not change the information about each place that is saved in the
|
||||
database. In particular, they have no influence on how the results are
|
||||
displayed. The returned results always show the original information as
|
||||
stored in the OpenStreetMap database.
|
||||
|
||||
Each entry contains information of a sanitizer to be applied. It has a
|
||||
mandatory parameter `step` which gives the name of the sanitizer. Depending
|
||||
on the type, it may have additional parameters to configure its operation.
|
||||
|
||||
The order of the list matters. The sanitizers are applied exactly in the order
|
||||
that is configured. Each sanitizer works on the results of the previous one.
|
||||
|
||||
The following is a list of sanitizers that are shipped with Nominatim.
|
||||
|
||||
##### split-name-list
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.split_name_list
|
||||
options:
|
||||
members: False
|
||||
heading_level: 6
|
||||
docstring_section_style: spacy
|
||||
|
||||
##### strip-brace-terms
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.strip_brace_terms
|
||||
options:
|
||||
members: False
|
||||
heading_level: 6
|
||||
docstring_section_style: spacy
|
||||
|
||||
##### tag-analyzer-by-language
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.tag_analyzer_by_language
|
||||
options:
|
||||
members: False
|
||||
heading_level: 6
|
||||
docstring_section_style: spacy
|
||||
|
||||
##### clean-housenumbers
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.clean_housenumbers
|
||||
options:
|
||||
members: False
|
||||
heading_level: 6
|
||||
docstring_section_style: spacy
|
||||
|
||||
##### clean-postcodes
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.clean_postcodes
|
||||
options:
|
||||
members: False
|
||||
heading_level: 6
|
||||
docstring_section_style: spacy
|
||||
|
||||
##### clean-tiger-tags
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.clean_tiger_tags
|
||||
options:
|
||||
members: False
|
||||
heading_level: 6
|
||||
docstring_section_style: spacy
|
||||
|
||||
#### delete-tags
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.delete_tags
|
||||
options:
|
||||
members: False
|
||||
heading_level: 6
|
||||
docstring_section_style: spacy
|
||||
|
||||
#### tag-japanese
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.tag_japanese
|
||||
options:
|
||||
members: False
|
||||
heading_level: 6
|
||||
docstring_section_style: spacy
|
||||
|
||||
#### Token Analysis
|
||||
|
||||
Token analyzers take a full name and transform it into one or more normalized
|
||||
form that are then saved in the search index. In its simplest form, the
|
||||
analyzer only applies the transliteration rules. More complex analyzers
|
||||
create additional spelling variants of a name. This is useful to handle
|
||||
decomposition and abbreviation.
|
||||
|
||||
The ICU tokenizer may use different analyzers for different names. To select
|
||||
the analyzer to be used, the name must be tagged with the `analyzer` attribute
|
||||
by a sanitizer (see for example the
|
||||
[tag-analyzer-by-language sanitizer](#tag-analyzer-by-language)).
|
||||
|
||||
The token-analysis section contains the list of configured analyzers. Each
|
||||
analyzer must have an `id` parameter that uniquely identifies the analyzer.
|
||||
The only exception is the default analyzer that is used when no special
|
||||
analyzer was selected. There are analysers with special ids:
|
||||
|
||||
* '@housenumber'. If an analyzer with that name is present, it is used
|
||||
for normalization of house numbers.
|
||||
* '@potcode'. If an analyzer with that name is present, it is used
|
||||
for normalization of postcodes.
|
||||
|
||||
Different analyzer implementations may exist. To select the implementation,
|
||||
the `analyzer` parameter must be set. The different implementations are
|
||||
described in the following.
|
||||
|
||||
##### Generic token analyzer
|
||||
|
||||
The generic analyzer `generic` is able to create variants from a list of given
|
||||
abbreviation and decomposition replacements and introduce spelling variations.
|
||||
|
||||
###### Variants
|
||||
|
||||
The optional 'variants' section defines lists of replacements which create alternative
|
||||
spellings of a name. To create the variants, a name is scanned from left to
|
||||
right and the longest matching replacement is applied until the end of the
|
||||
string is reached.
|
||||
|
||||
The variants section must contain a list of replacement groups. Each group
|
||||
defines a set of properties that describes where the replacements are
|
||||
applicable. In addition, the word section defines the list of replacements
|
||||
to be made. The basic replacement description is of the form:
|
||||
|
||||
```
|
||||
<source>[,<source>[...]] => <target>[,<target>[...]]
|
||||
```
|
||||
|
||||
The left side contains one or more `source` terms to be replaced. The right side
|
||||
lists one or more replacements. Each source is replaced with each replacement
|
||||
term.
|
||||
|
||||
!!! tip
|
||||
The source and target terms are internally normalized using the
|
||||
normalization rules given in the configuration. This ensures that the
|
||||
strings match as expected. In fact, it is better to use unnormalized
|
||||
words in the configuration because then it is possible to change the
|
||||
rules for normalization later without having to adapt the variant rules.
|
||||
|
||||
###### Decomposition
|
||||
|
||||
In its standard form, only full words match against the source. There
|
||||
is a special notation to match the prefix and suffix of a word:
|
||||
|
||||
``` yaml
|
||||
- ~strasse => str # matches "strasse" as full word and in suffix position
|
||||
- hinter~ => hntr # matches "hinter" as full word and in prefix position
|
||||
```
|
||||
|
||||
There is no facility to match a string in the middle of the word. The suffix
|
||||
and prefix notation automatically trigger the decomposition mode: two variants
|
||||
are created for each replacement, one with the replacement attached to the word
|
||||
and one separate. So in above example, the tokenization of "hauptstrasse" will
|
||||
create the variants "hauptstr" and "haupt str". Similarly, the name "rote strasse"
|
||||
triggers the variants "rote str" and "rotestr". By having decomposition work
|
||||
both ways, it is sufficient to create the variants at index time. The variant
|
||||
rules are not applied at query time.
|
||||
|
||||
To avoid automatic decomposition, use the '|' notation:
|
||||
|
||||
``` yaml
|
||||
- ~strasse |=> str
|
||||
```
|
||||
|
||||
simply changes "hauptstrasse" to "hauptstr" and "rote strasse" to "rote str".
|
||||
|
||||
###### Initial and final terms
|
||||
|
||||
It is also possible to restrict replacements to the beginning and end of a
|
||||
name:
|
||||
|
||||
``` yaml
|
||||
- ^south => s # matches only at the beginning of the name
|
||||
- road$ => rd # matches only at the end of the name
|
||||
```
|
||||
|
||||
So the first example would trigger a replacement for "south 45th street" but
|
||||
not for "the south beach restaurant".
|
||||
|
||||
###### Replacements vs. variants
|
||||
|
||||
The replacement syntax `source => target` works as a pure replacement. It changes
|
||||
the name instead of creating a variant. To create an additional version, you'd
|
||||
have to write `source => source,target`. As this is a frequent case, there is
|
||||
a shortcut notation for it:
|
||||
|
||||
```
|
||||
<source>[,<source>[...]] -> <target>[,<target>[...]]
|
||||
```
|
||||
|
||||
The simple arrow causes an additional variant to be added. Note that
|
||||
decomposition has an effect here on the source as well. So a rule
|
||||
|
||||
``` yaml
|
||||
- "~strasse -> str"
|
||||
```
|
||||
|
||||
means that for a word like `hauptstrasse` four variants are created:
|
||||
`hauptstrasse`, `haupt strasse`, `hauptstr` and `haupt str`.
|
||||
|
||||
###### Mutations
|
||||
|
||||
The 'mutation' section in the configuration describes an additional set of
|
||||
replacements to be applied after the variants have been computed.
|
||||
|
||||
Each mutation is described by two parameters: `pattern` and `replacements`.
|
||||
The pattern must contain a single regular expression to search for in the
|
||||
variant name. The regular expressions need to follow the syntax for
|
||||
[Python regular expressions](file:///usr/share/doc/python3-doc/html/library/re.html#regular-expression-syntax).
|
||||
Capturing groups are not permitted.
|
||||
`replacements` must contain a list of strings that the pattern
|
||||
should be replaced with. Each occurrence of the pattern is replaced with
|
||||
all given replacements. Be mindful of combinatorial explosion of variants.
|
||||
|
||||
###### Modes
|
||||
|
||||
The generic analyser supports a special mode `variant-only`. When configured
|
||||
then it consumes the input token and emits only variants (if any exist). Enable
|
||||
the mode by adding:
|
||||
|
||||
```
|
||||
mode: variant-only
|
||||
```
|
||||
|
||||
to the analyser configuration.
|
||||
|
||||
##### Housenumber token analyzer
|
||||
|
||||
The analyzer `housenumbers` is purpose-made to analyze house numbers. It
|
||||
creates variants with optional spaces between numbers and letters. Thus,
|
||||
house numbers of the form '3 a', '3A', '3-A' etc. are all considered equivalent.
|
||||
|
||||
The analyzer cannot be customized.
|
||||
|
||||
##### Postcode token analyzer
|
||||
|
||||
The analyzer `postcodes` is pupose-made to analyze postcodes. It supports
|
||||
a 'lookup' variant of the token, which produces variants with optional
|
||||
spaces. Use together with the clean-postcodes sanitizer.
|
||||
|
||||
The analyzer cannot be customized.
|
||||
|
||||
### Reconfiguration
|
||||
|
||||
Changing the configuration after the import is currently not possible, although
|
||||
this feature may be added at a later time.
|
||||
@@ -1,4 +0,0 @@
|
||||
# Additional Data Sources
|
||||
|
||||
This guide explains how data sources other than OpenStreetMap mentioned in
|
||||
the install instructions got obtained and converted.
|
||||
167
docs/develop/Database-Layout.md
Normal file
167
docs/develop/Database-Layout.md
Normal file
@@ -0,0 +1,167 @@
|
||||
# Database Layout
|
||||
|
||||
### Import tables
|
||||
|
||||
OSM data is initially imported using [osm2pgsql](https://osm2pgsql.org).
|
||||
Nominatim uses its own data output style 'gazetteer', which differs from the
|
||||
output style created for map rendering.
|
||||
|
||||
The import process creates the following tables:
|
||||
|
||||

|
||||
|
||||
The `planet_osm_*` tables are the usual backing tables for OSM data. Note
|
||||
that Nominatim uses them to look up special relations and to find nodes on
|
||||
ways.
|
||||
|
||||
The gazetteer style produces a single table `place` as output with the following
|
||||
columns:
|
||||
|
||||
* `osm_type` - kind of OSM object (**N** - node, **W** - way, **R** - relation)
|
||||
* `osm_id` - original OSM ID
|
||||
* `class` - key of principal tag defining the object type
|
||||
* `type` - value of principal tag defining the object type
|
||||
* `name` - collection of tags that contain a name or reference
|
||||
* `admin_level` - numerical value of the tagged administrative level
|
||||
* `address` - collection of tags defining the address of an object
|
||||
* `extratags` - collection of additional interesting tags that are not
|
||||
directly relevant for searching
|
||||
* `geometry` - geometry of the object (in WGS84)
|
||||
|
||||
A single OSM object may appear multiple times in this table when it is tagged
|
||||
with multiple tags that may constitute a principal tag. Take for example a
|
||||
motorway bridge. In OSM, this would be a way which is tagged with
|
||||
`highway=motorway` and `bridge=yes`. This way would appear in the `place` table
|
||||
once with `class` of `highway` and once with a `class` of `bridge`. Thus the
|
||||
*unique key* for `place` is (`osm_type`, `osm_id`, `class`).
|
||||
|
||||
How raw OSM tags are mapped to the columns in the place table is to a certain
|
||||
degree configurable. See [Customizing Import Styles](../customize/Import-Styles.md)
|
||||
for more information.
|
||||
|
||||
### Search tables
|
||||
|
||||
The following tables carry all information needed to do the search:
|
||||
|
||||

|
||||
|
||||
The **placex** table is the central table that saves all information about the
|
||||
searchable places in Nominatim. The basic columns are the same as for the
|
||||
place table and have the same meaning. The placex tables adds the following
|
||||
additional columns:
|
||||
|
||||
* `place_id` - the internal unique ID to identify the place
|
||||
* `partition` - the id to use with partitioned tables (see below)
|
||||
* `geometry_sector` - a location hash used for geographically close ordering
|
||||
* `parent_place_id` - the next higher place in the address hierarchy, only
|
||||
relevant for POI-type places (with rank 30)
|
||||
* `linked_place_id` - place ID of the place this object has been merged with.
|
||||
When this ID is set, then the place is invisible for search.
|
||||
* `importance` - measure how well known the place is
|
||||
* `rank_search`, `rank_address` - search and address rank (see [Customizing ranking](../customize/Ranking.md)
|
||||
* `wikipedia` - the wikipedia page used for computing the importance of the place
|
||||
* `country_code` - the country the place is located in
|
||||
* `housenumber` - normalized housenumber, if the place has one
|
||||
* `postcode` - computed postcode for the place
|
||||
* `indexed_status` - processing status of the place (0 - ready, 1 - freshly inserted, 2 - needs updating, 100 - needs deletion)
|
||||
* `indexed_date` - timestamp when the place was processed last
|
||||
* `centroid` - a point feature for the place
|
||||
|
||||
The **location_property_osmline** table is a special table for
|
||||
[address interpolations](https://wiki.openstreetmap.org/wiki/Addresses#Using_interpolation).
|
||||
The columns have the same meaning and use as the columns with the same name in
|
||||
the placex table. Only three columns are special:
|
||||
|
||||
* `startnumber` and `endnumber` - beginning and end of the number range
|
||||
for the interpolation
|
||||
* `interpolationtype` - a string `odd`, `even` or `all` to indicate
|
||||
the interval between the numbers
|
||||
|
||||
Address interpolations are always ways in OSM, which is why there is no column
|
||||
`osm_type`.
|
||||
|
||||
The **location_postcode** table holds computed centroids of all postcodes that
|
||||
can be found in the OSM data. The meaning of the columns is again the same
|
||||
as that of the placex table.
|
||||
|
||||
Every place needs an address, a set of surrounding places that describe the
|
||||
location of the place. The set of address places is made up of OSM places
|
||||
themselves. The **place_addressline** table cross-references for each place
|
||||
all the places that make up its address. Two columns define the address
|
||||
relation:
|
||||
|
||||
* `place_id` - reference to the place being addressed
|
||||
* `address_place_id` - reference to the place serving as an address part
|
||||
|
||||
The most of the columns cache information from the placex entry of the address
|
||||
part. The exceptions are:
|
||||
|
||||
* `fromarea` - is true if the address part has an area geometry and can
|
||||
therefore be considered preceise
|
||||
* `isaddress` - is true if the address part should show up in the address
|
||||
output. Sometimes there are multiple places competing for for same address
|
||||
type (e.g. multiple cities) and this field resolves the tie.
|
||||
|
||||
The **search_name** table contains the search index proper. It saves for each
|
||||
place the terms with which the place can be found. The terms are split into
|
||||
the name itself and all terms that make up the address. The table mirrors some
|
||||
of the columns from placex for faster lookup.
|
||||
|
||||
Search terms are not saved as strings. Each term is assigned an integer and those
|
||||
integers are saved in the name and address vectors of the search_name table. The
|
||||
**word** table serves as the lookup table from string to such a word ID. The
|
||||
exact content of the word table depends on the [tokenizer](Tokenizers.md) used.
|
||||
|
||||
## Address computation tables
|
||||
|
||||
Next to the main search tables, there is a set of secondary helper tables used
|
||||
to compute the address relations between places. These tables are partitioned.
|
||||
Each country is assigned a partition number in the country_name table (see
|
||||
below) and the data is then split between a set of tables, one for each
|
||||
partition. Note that Nominatim still manually manages partitioned tables.
|
||||
Native support for partitions in PostgreSQL only became usable with version 13.
|
||||
It will be a little while before Nominatim drops support for older versions.
|
||||
|
||||

|
||||
|
||||
The **search_name_X** tables are used to look up streets that appear in the
|
||||
`addr:street` tag.
|
||||
|
||||
The **location_area_large_X** tables are used to look up larger areas
|
||||
(administrative boundaries and place nodes) either through their geographic
|
||||
closeness or through `addr:*` entries.
|
||||
|
||||
The **location_road_X** tables are used to find the closest street for a
|
||||
dependent place.
|
||||
|
||||
All three table cache specific information from the placex table for their
|
||||
selected subset of places:
|
||||
|
||||
* `keywords` and `name_vector` contain lists of term ids (from the word table)
|
||||
that the full name of the place should match against
|
||||
* `isguess` is true for places that are not described by an area
|
||||
|
||||
All other columns reflect their counterpart in the placex table.
|
||||
|
||||
## Static data tables
|
||||
|
||||
Nominatim also creates a number of static tables at import:
|
||||
|
||||
* `nominatim_properties` saves settings that must not be changed after
|
||||
import
|
||||
* `address_levels` save the rank information from the
|
||||
[ranking configuration](../customize/Ranking.md)
|
||||
* `country_name` contains a fallback of names for all countries, their
|
||||
default languages and saves the assignment of countries to partitions.
|
||||
* `country_osm_grid` provides a fallback for country geometries
|
||||
|
||||
## Auxiliary data tables
|
||||
|
||||
Finally there are some table for auxiliary data:
|
||||
|
||||
* `location_property_tiger` - saves housenumber from the Tiger import. Its
|
||||
layout is similar to that of `location_propoerty_osmline`.
|
||||
* `place_class_*` tables are helper tables to facilitate lookup of POIs
|
||||
by their class and type. They exist because it is not possible to create
|
||||
combined indexes with geometries.
|
||||
|
||||
178
docs/develop/Development-Environment.md
Normal file
178
docs/develop/Development-Environment.md
Normal file
@@ -0,0 +1,178 @@
|
||||
# Setting up Nominatim for Development
|
||||
|
||||
This chapter gives an overview how to set up Nominatim for development
|
||||
and how to run tests.
|
||||
|
||||
!!! Important
|
||||
This guide assumes you develop under the latest version of Debian/Ubuntu.
|
||||
You can of course also use your favourite distribution. You just might have
|
||||
to adapt the commands below slightly, in particular the commands for
|
||||
installing additional software.
|
||||
|
||||
## Installing Nominatim
|
||||
|
||||
The first step is to install Nominatim itself. Please follow the installation
|
||||
instructions in the [Admin section](../admin/Installation.md). You don't need
|
||||
to set up a webserver for development, the webserver that can be started
|
||||
via `nominatim serve` is sufficient.
|
||||
|
||||
If you want to run Nominatim in a VM via Vagrant, use the default `ubuntu24` setup.
|
||||
Vagrant's libvirt provider runs out-of-the-box under Ubuntu. You also need to
|
||||
install an NFS daemon to enable directory sharing between host and guest. The
|
||||
following packages should get you started:
|
||||
|
||||
sudo apt install vagrant vagrant-libvirt libvirt-daemon nfs-kernel-server
|
||||
|
||||
## Prerequisites for testing and documentation
|
||||
|
||||
The Nominatim test suite consists of behavioural tests (using behave) and
|
||||
unit tests (using PHPUnit for PHP code and pytest for Python code).
|
||||
It has the following additional requirements:
|
||||
|
||||
* [behave test framework](https://behave.readthedocs.io) >= 1.2.6
|
||||
* [phpunit](https://phpunit.de) (9.5 is known to work)
|
||||
* [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
|
||||
* [Pylint](https://pylint.org/) (CI always runs the latest version from pip)
|
||||
* [mypy](http://mypy-lang.org/) (plus typing information for external libs)
|
||||
* [Python Typing Extensions](https://github.com/python/typing_extensions) (for Python < 3.9)
|
||||
* [pytest](https://pytest.org)
|
||||
* [pytest-asyncio](https://pytest-asyncio.readthedocs.io)
|
||||
|
||||
For testing the Python search frontend, you need to install extra dependencies
|
||||
depending on your choice of webserver framework:
|
||||
|
||||
* [httpx](https://www.python-httpx.org/) (Starlette only)
|
||||
* [asgi-lifespan](https://github.com/florimondmanca/asgi-lifespan) (Starlette only)
|
||||
|
||||
The documentation is built with mkdocs:
|
||||
|
||||
* [mkdocs](https://www.mkdocs.org/) >= 1.1.2
|
||||
* [mkdocstrings](https://mkdocstrings.github.io/) >= 0.25
|
||||
* [mkdocs-material](https://squidfunk.github.io/mkdocs-material/)
|
||||
* [mkdocs-gen-files](https://oprypin.github.io/mkdocs-gen-files/)
|
||||
|
||||
Please be aware that tests always run against the globally installed
|
||||
osm2pgsql, so you need to have this set up. If you want to test against
|
||||
the vendored version of osm2pgsql, you need to set the PATH accordingly.
|
||||
|
||||
### Installing prerequisites on Ubuntu/Debian
|
||||
|
||||
The Python tools should always be run with the most recent version.
|
||||
In particular, pylint tends to have a lot of breaking changes between versions.
|
||||
The easiest way, to handle these Python dependencies is to run your
|
||||
development from within a virtual environment.
|
||||
|
||||
```sh
|
||||
sudo apt install libsqlite3-mod-spatialite php-cli
|
||||
```
|
||||
|
||||
To set up the virtual environment with all necessary packages run:
|
||||
|
||||
```sh
|
||||
virtualenv ~/nominatim-dev-venv
|
||||
~/nominatim-dev-venv/bin/pip install\
|
||||
psutil psycopg[binary] PyICU SQLAlchemy \
|
||||
python-dotenv jinja2 pyYAML datrie behave \
|
||||
mkdocs mkdocstrings mkdocs-gen-files pytest pytest-asyncio pylint \
|
||||
types-jinja2 types-markupsafe types-psutil types-psycopg2 \
|
||||
types-pygments types-pyyaml types-requests types-ujson \
|
||||
types-urllib3 typing-extensions unicorn falcon starlette \
|
||||
uvicorn mypy osmium aiosqlite
|
||||
```
|
||||
|
||||
Now enter the virtual environment whenever you want to develop:
|
||||
|
||||
```sh
|
||||
. ~/nominatim-dev-venv/bin/activate
|
||||
```
|
||||
|
||||
For installing the PHP development tools, run:
|
||||
|
||||
```sh
|
||||
sudo apt install php-cgi phpunit php-codesniffer
|
||||
```
|
||||
|
||||
If your distribution does not have PHPUnit 7.3+, you can install it (as well
|
||||
as CodeSniffer) via composer:
|
||||
|
||||
```
|
||||
sudo apt-get install composer
|
||||
composer global require "squizlabs/php_codesniffer=*"
|
||||
composer global require "phpunit/phpunit=8.*"
|
||||
```
|
||||
|
||||
The binaries are found in `.config/composer/vendor/bin`. You need to add this
|
||||
to your PATH:
|
||||
|
||||
```
|
||||
echo 'export PATH=~/.config/composer/vendor/bin:$PATH' > ~/.profile
|
||||
```
|
||||
|
||||
### Running Nominatim during development
|
||||
|
||||
The source code for Nominatim can be found in the `src` directory and can
|
||||
be run in-place. The source directory features a special script
|
||||
`nominatim-cli.py` which does the same as the installed 'nominatim' binary
|
||||
but executes against the code in the source tree. For example:
|
||||
|
||||
```
|
||||
me@machine:~$ cd Nominatim
|
||||
me@machine:~Nominatim$ ./nominatim-cli.py --version
|
||||
Nominatim version 4.4.99-1
|
||||
```
|
||||
|
||||
Make sure you have activated the virtual environment holding all
|
||||
necessary dependencies.
|
||||
|
||||
## Executing Tests
|
||||
|
||||
All tests are located in the `/test` directory.
|
||||
|
||||
To run all tests, run make from the source root:
|
||||
|
||||
```sh
|
||||
make tests
|
||||
```
|
||||
|
||||
There are also make targets for executing only parts of the test suite.
|
||||
For example to run linting only use:
|
||||
|
||||
```sh
|
||||
make lint
|
||||
```
|
||||
|
||||
The possible testing targets are: mypy, lint, pytest, bdd.
|
||||
|
||||
For more information about the structure of the tests and how to change and
|
||||
extend the test suite, see the [Testing chapter](Testing.md).
|
||||
|
||||
## Documentation Pages
|
||||
|
||||
The [Nominatim documentation](https://nominatim.org/release-docs/develop/) is
|
||||
built using the [MkDocs](https://www.mkdocs.org/) static site generation
|
||||
framework. The master branch is automatically deployed every night on
|
||||
[https://nominatim.org/release-docs/develop/](https://nominatim.org/release-docs/develop/)
|
||||
|
||||
To build the documentation run
|
||||
|
||||
```
|
||||
make doc
|
||||
```
|
||||
|
||||
|
||||
For local testing, you can start webserver:
|
||||
|
||||
```
|
||||
build> make serve-doc
|
||||
[server:296] Serving on http://127.0.0.1:8000
|
||||
[handlers:62] Start watching changes
|
||||
```
|
||||
|
||||
If you develop inside a Vagrant virtual machine, use a port that is forwarded
|
||||
to your host:
|
||||
|
||||
```
|
||||
build> mkdocs serve --dev-addr 0.0.0.0:8088
|
||||
[server:296] Serving on http://0.0.0.0:8088
|
||||
[handlers:62] Start watching changes
|
||||
```
|
||||
@@ -1,36 +0,0 @@
|
||||
# Documentation Pages
|
||||
|
||||
The [Nominatim documentation](https://nominatim.org/release-docs/develop/) is built using the [MkDocs](https://www.mkdocs.org/) static site generation framework. The master branch is automatically deployed every night on under [https://nominatim.org/release-docs/develop/](https://nominatim.org/release-docs/develop/)
|
||||
|
||||
To preview local changes, first install MkDocs
|
||||
|
||||
```
|
||||
pip3 install --user mkdocs
|
||||
```
|
||||
|
||||
|
||||
Then go to the build directory and run
|
||||
|
||||
```
|
||||
make doc
|
||||
INFO - Cleaning site directory
|
||||
INFO - Building documentation to directory: /home/vagrant/build/site-html
|
||||
```
|
||||
|
||||
This runs `mkdocs build` plus extra transformation of some files and adds
|
||||
symlinks (see `CMakeLists.txt` for the exact steps).
|
||||
|
||||
Now you can start webserver for local testing
|
||||
|
||||
```
|
||||
build> mkdocs serve
|
||||
[server:296] Serving on http://127.0.0.1:8000
|
||||
[handlers:62] Start watching changes
|
||||
```
|
||||
|
||||
If you develop inside a Vagrant virtual machine:
|
||||
|
||||
* add port forwarding to your Vagrantfile,
|
||||
e.g. `config.vm.network "forwarded_port", guest: 8000, host: 8000`
|
||||
* use `mkdocs serve --dev-addr 0.0.0.0:8000` because the default localhost
|
||||
IP does not get forwarded.
|
||||
220
docs/develop/ICU-Tokenizer-Modules.md
Normal file
220
docs/develop/ICU-Tokenizer-Modules.md
Normal file
@@ -0,0 +1,220 @@
|
||||
# Writing custom sanitizer and token analysis modules for the ICU tokenizer
|
||||
|
||||
The [ICU tokenizer](../customize/Tokenizers.md#icu-tokenizer) provides a
|
||||
highly customizable method to pre-process and normalize the name information
|
||||
of the input data before it is added to the search index. It comes with a
|
||||
selection of sanitizers and token analyzers which you can use to adapt your
|
||||
installation to your needs. If the provided modules are not enough, you can
|
||||
also provide your own implementations. This section describes the API
|
||||
of sanitizers and token analysis.
|
||||
|
||||
!!! warning
|
||||
This API is currently in early alpha status. While this API is meant to
|
||||
be a public API on which other sanitizers and token analyzers may be
|
||||
implemented, it is not guaranteed to be stable at the moment.
|
||||
|
||||
|
||||
## Using non-standard sanitizers and token analyzers
|
||||
|
||||
Sanitizer names (in the `step` property) and token analysis names (in the
|
||||
`analyzer`) may refer to externally supplied modules. There are two ways
|
||||
to include external modules: through a library or from the project directory.
|
||||
|
||||
To include a module from a library, use the absolute import path as name and
|
||||
make sure the library can be found in your PYTHONPATH.
|
||||
|
||||
To use a custom module without creating a library, you can put the module
|
||||
somewhere in your project directory and then use the relative path to the
|
||||
file. Include the whole name of the file including the `.py` ending.
|
||||
|
||||
## Custom sanitizer modules
|
||||
|
||||
A sanitizer module must export a single factory function `create` with the
|
||||
following signature:
|
||||
|
||||
``` python
|
||||
def create(config: SanitizerConfig) -> Callable[[ProcessInfo], None]
|
||||
```
|
||||
|
||||
The function receives the custom configuration for the sanitizer and must
|
||||
return a callable (function or class) that transforms the name and address
|
||||
terms of a place. When a place is processed, then a `ProcessInfo` object
|
||||
is created from the information that was queried from the database. This
|
||||
object is sequentially handed to each configured sanitizer, so that each
|
||||
sanitizer receives the result of processing from the previous sanitizer.
|
||||
After the last sanitizer is finished, the resulting name and address lists
|
||||
are forwarded to the token analysis module.
|
||||
|
||||
Sanitizer functions are instantiated once and then called for each place
|
||||
that is imported or updated. They don't need to be thread-safe.
|
||||
If multi-threading is used, each thread creates their own instance of
|
||||
the function.
|
||||
|
||||
### Sanitizer configuration
|
||||
|
||||
::: nominatim_db.tokenizer.sanitizers.config.SanitizerConfig
|
||||
options:
|
||||
heading_level: 6
|
||||
|
||||
### The main filter function of the sanitizer
|
||||
|
||||
The filter function receives a single object of type `ProcessInfo`
|
||||
which has with three members:
|
||||
|
||||
* `place: PlaceInfo`: read-only information about the place being processed.
|
||||
See PlaceInfo below.
|
||||
* `names: List[PlaceName]`: The current list of names for the place.
|
||||
* `address: List[PlaceName]`: The current list of address names for the place.
|
||||
|
||||
While the `place` member is provided for information only, the `names` and
|
||||
`address` lists are meant to be manipulated by the sanitizer. It may add and
|
||||
remove entries, change information within a single entry (for example by
|
||||
adding extra attributes) or completely replace the list with a different one.
|
||||
|
||||
#### PlaceInfo - information about the place
|
||||
|
||||
::: nominatim_db.data.place_info.PlaceInfo
|
||||
options:
|
||||
heading_level: 6
|
||||
|
||||
|
||||
#### PlaceName - extended naming information
|
||||
|
||||
::: nominatim_db.data.place_name.PlaceName
|
||||
options:
|
||||
heading_level: 6
|
||||
|
||||
|
||||
### Example: Filter for US street prefixes
|
||||
|
||||
The following sanitizer removes the directional prefixes from street names
|
||||
in the US:
|
||||
|
||||
``` python
|
||||
import re
|
||||
|
||||
def _filter_function(obj):
|
||||
if obj.place.country_code == 'us' \
|
||||
and obj.place.rank_address >= 26 and obj.place.rank_address <= 27:
|
||||
for name in obj.names:
|
||||
name.name = re.sub(r'^(north|south|west|east) ',
|
||||
'',
|
||||
name.name,
|
||||
flags=re.IGNORECASE)
|
||||
|
||||
def create(config):
|
||||
return _filter_function
|
||||
```
|
||||
|
||||
This is the most simple form of a sanitizer module. If defines a single
|
||||
filter function and implements the required `create()` function by returning
|
||||
the filter.
|
||||
|
||||
The filter function first checks if the object is interesting for the
|
||||
sanitizer. Namely it checks if the place is in the US (through `country_code`)
|
||||
and it the place is a street (a `rank_address` of 26 or 27). If the
|
||||
conditions are met, then it goes through all available names and
|
||||
removes any leading directional prefix using a simple regular expression.
|
||||
|
||||
Save the source code in a file in your project directory, for example as
|
||||
`us_streets.py`. Then you can use the sanitizer in your `icu_tokenizer.yaml`:
|
||||
|
||||
``` yaml
|
||||
...
|
||||
sanitizers:
|
||||
- step: us_streets.py
|
||||
...
|
||||
```
|
||||
|
||||
!!! warning
|
||||
This example is just a simplified show case on how to create a sanitizer.
|
||||
It is not really read for real-world use: while the sanitizer would
|
||||
correctly transform `West 5th Street` into `5th Street`. it would also
|
||||
shorten a simple `North Street` to `Street`.
|
||||
|
||||
For more sanitizer examples, have a look at the sanitizers provided by Nominatim.
|
||||
They can be found in the directory
|
||||
[`nominatim/tokenizer/sanitizers`](https://github.com/osm-search/Nominatim/tree/master/nominatim/tokenizer/sanitizers).
|
||||
|
||||
|
||||
## Custom token analysis module
|
||||
|
||||
::: nominatim_db.tokenizer.token_analysis.base.AnalysisModule
|
||||
options:
|
||||
heading_level: 6
|
||||
|
||||
|
||||
::: nominatim_db.tokenizer.token_analysis.base.Analyzer
|
||||
options:
|
||||
heading_level: 6
|
||||
|
||||
### Example: Creating acronym variants for long names
|
||||
|
||||
The following example of a token analysis module creates acronyms from
|
||||
very long names and adds them as a variant:
|
||||
|
||||
``` python
|
||||
class AcronymMaker:
|
||||
""" This class is the actual analyzer.
|
||||
"""
|
||||
def __init__(self, norm, trans):
|
||||
self.norm = norm
|
||||
self.trans = trans
|
||||
|
||||
|
||||
def get_canonical_id(self, name):
|
||||
# In simple cases, the normalized name can be used as a canonical id.
|
||||
return self.norm.transliterate(name.name).strip()
|
||||
|
||||
|
||||
def compute_variants(self, name):
|
||||
# The transliterated form of the name always makes up a variant.
|
||||
variants = [self.trans.transliterate(name)]
|
||||
|
||||
# Only create acronyms from very long words.
|
||||
if len(name) > 20:
|
||||
# Take the first letter from each word to form the acronym.
|
||||
acronym = ''.join(w[0] for w in name.split())
|
||||
# If that leds to an acronym with at least three letters,
|
||||
# add the resulting acronym as a variant.
|
||||
if len(acronym) > 2:
|
||||
# Never forget to transliterate the variants before returning them.
|
||||
variants.append(self.trans.transliterate(acronym))
|
||||
|
||||
return variants
|
||||
|
||||
# The following two functions are the module interface.
|
||||
|
||||
def configure(rules, normalizer, transliterator):
|
||||
# There is no configuration to parse and no data to set up.
|
||||
# Just return an empty configuration.
|
||||
return None
|
||||
|
||||
|
||||
def create(normalizer, transliterator, config):
|
||||
# Return a new instance of our token analysis class above.
|
||||
return AcronymMaker(normalizer, transliterator)
|
||||
```
|
||||
|
||||
Given the name `Trans-Siberian Railway`, the code above would return the full
|
||||
name `Trans-Siberian Railway` and the acronym `TSR` as variant, so that
|
||||
searching would work for both.
|
||||
|
||||
## Sanitizers vs. Token analysis - what to use for variants?
|
||||
|
||||
It is not always clear when to implement variations in the sanitizer and
|
||||
when to write a token analysis module. Just take the acronym example
|
||||
above: it would also have been possible to write a sanitizer which adds the
|
||||
acronym as an additional name to the name list. The result would have been
|
||||
similar. So which should be used when?
|
||||
|
||||
The most important thing to keep in mind is that variants created by the
|
||||
token analysis are only saved in the word lookup table. They do not need
|
||||
extra space in the search index. If there are many spelling variations, this
|
||||
can mean quite a significant amount of space is saved.
|
||||
|
||||
When creating additional names with a sanitizer, these names are completely
|
||||
independent. In particular, they can be fed into different token analysis
|
||||
modules. This gives a much greater flexibility but at the price that the
|
||||
additional names increase the size of the search index.
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
# OSM Data Import
|
||||
|
||||
OSM data is initially imported using osm2pgsql. Nominatim uses its own data
|
||||
output style 'gazetteer', which differs from the output style created for
|
||||
map rendering.
|
||||
|
||||
## Database Layout
|
||||
|
||||
The gazetteer style produces a single table `place` with the following rows:
|
||||
|
||||
* `osm_type` - kind of OSM object (**N** - node, **W** - way, **R** - relation)
|
||||
* `osm_id` - original OSM ID
|
||||
* `class` - key of principal tag defining the object type
|
||||
* `type` - value of principal tag defining the object type
|
||||
* `name` - collection of tags that contain a name or reference
|
||||
* `admin_level` - numerical value of the tagged administrative level
|
||||
* `address` - collection of tags defining the address of an object
|
||||
* `extratags` - collection of additional interesting tags that are not
|
||||
directly relevant for searching
|
||||
* `geometry` - geometry of the object (in WGS84)
|
||||
|
||||
A single OSM object may appear multiple times in this table when it is tagged
|
||||
with multiple tags that may constitute a principal tag. Take for example a
|
||||
motorway bridge. In OSM, this would be a way which is tagged with
|
||||
`highway=motorway` and `bridge=yes`. This way would appear in the `place` table
|
||||
once with `class` of `highway` and once with a `class` of `bridge`. Thus the
|
||||
*unique key* for `place` is (`osm_type`, `osm_id`, `class`).
|
||||
|
||||
## Configuring the Import
|
||||
|
||||
How tags are interpreted and assigned to the different `place` columns can be
|
||||
configured via the import style configuration file (`CONST_Import_style`). This
|
||||
is a JSON file which contains a list of rules which are matched against every
|
||||
tag of every object and then assign the tag its specific role.
|
||||
|
||||
### Configuration Rules
|
||||
|
||||
A single rule looks like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"keys" : ["key1", "key2", ...],
|
||||
"values" : {
|
||||
"value1" : "prop",
|
||||
"value2" : "prop1,prop2"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
A rule first defines a list of keys to apply the rule to. This is always a list
|
||||
of strings. The string may have four forms. An empty string matches against
|
||||
any key. A string that ends in an asterisk `*` is a prefix match and accordingly
|
||||
matches against any key that starts with the given string (minus the `*`). A
|
||||
suffix match can be defined similarly with a string that starts with a `*`. Any
|
||||
other string constitutes an exact match.
|
||||
|
||||
The second part of the rules defines a list of values and the properties that
|
||||
apply to a successful match. Value strings may be either empty, which
|
||||
means that they match any value, or describe an exact match. Prefix
|
||||
or suffix matching of values is not possible.
|
||||
|
||||
For a rule to match, it has to find a valid combination of keys and values. The
|
||||
resulting property is that of the matched values.
|
||||
|
||||
The rules in a configuration file are processed sequentially and the first
|
||||
match for each tag wins.
|
||||
|
||||
A rule where key and value are the empty string is special. This defines the
|
||||
fallback when none of the rules match. The fallback is always used as a last
|
||||
resort when nothing else matches, no matter where the rule appears in the file.
|
||||
Defining multiple fallback rules is not allowed. What happens in this case,
|
||||
is undefined.
|
||||
|
||||
### Tag Properties
|
||||
|
||||
One or more of the following properties may be given for each tag:
|
||||
|
||||
* `main`
|
||||
|
||||
A principal tag. A new row will be added for the object with key and value
|
||||
as `class` and `type`.
|
||||
|
||||
* `with_name`
|
||||
|
||||
When the tag is a principal tag (`main` property set): only really add a new
|
||||
row, if there is any name tag found (a reference tag is not sufficient, see
|
||||
below).
|
||||
|
||||
* `with_name_key`
|
||||
|
||||
When the tag is a principal tag (`main` property set): only really add a new
|
||||
row, if there is also a name tag that matches the key of the principal tag.
|
||||
For example, if the main tag is `bridge=yes`, then it will only be added as
|
||||
an extra row, if there is a tag `bridge:name[:XXX]` for the same object.
|
||||
If this property is set, all other names that are not domain-specific are
|
||||
ignored.
|
||||
|
||||
* `fallback`
|
||||
|
||||
When the tag is a principal tag (`main` property set): only really add a new
|
||||
row, when no other principal tags for this object have been found. Only one
|
||||
fallback tag can win for an object.
|
||||
|
||||
* `operator`
|
||||
|
||||
When the tag is a principal tag (`main` property set): also include the
|
||||
`operator` tag in the list of names. This is a special construct for an
|
||||
out-dated tagging practise in OSM. Fuel stations and chain restaurants
|
||||
in particular used to have the name of the chain tagged as `operator`.
|
||||
These days the chain can be more commonly found in the `brand` tag but
|
||||
there is still enough old data around to warrant this special case.
|
||||
|
||||
* `name`
|
||||
|
||||
Add tag to the list of names.
|
||||
|
||||
* `ref`
|
||||
|
||||
Add tag to the list of names as a reference. At the moment this only means
|
||||
that the object is not considered to be named for `with_name`.
|
||||
|
||||
* `address`
|
||||
|
||||
Add tag to the list of address tags. If the tag starts with `addr:` or
|
||||
`is_in:`, then this prefix is cut off before adding it to the list.
|
||||
|
||||
* `postcode`
|
||||
|
||||
Add the value as a postcode to the address tags. If multiple tags are
|
||||
candidate for postcodes, one wins out and the others are dropped.
|
||||
|
||||
* `country`
|
||||
|
||||
Add the value as a country code to the address tags. The value must be a
|
||||
two letter country code, otherwise it is ignored. If there are multiple
|
||||
tags that match, then one wins out and the others are dropped.
|
||||
|
||||
* `house`
|
||||
|
||||
If no principle tags can be found for the object, still add the object with
|
||||
`class`=`place` and `type`=`house`. Use this for address nodes that have no
|
||||
other function.
|
||||
|
||||
* `interpolation`
|
||||
|
||||
Add this object as an address interpolation (appears as `class`=`place` and
|
||||
`type`=`houses` in the database).
|
||||
|
||||
* `extra`
|
||||
|
||||
Add tag to the list of extra tags.
|
||||
|
||||
* `skip`
|
||||
|
||||
Skip the tag completely. Useful when a custom default fallback is defined
|
||||
or to define exceptions to rules.
|
||||
|
||||
A rule can define as many of these properties for one match as it likes. For
|
||||
example, if the property is `"main,extra"` then the tag will open a new row
|
||||
but also have the tag appear in the list of extra tags.
|
||||
|
||||
There are a number of pre-defined styles in the `settings/` directory. It is
|
||||
advisable to start from one of these styles when defining your own.
|
||||
|
||||
### Changing the Style of Existing Databases
|
||||
|
||||
There is normally no issue changing the style of a database that is already
|
||||
imported and now kept up-to-date with change files. Just be aware that any
|
||||
change in the style applies to updates only. If you want to change the data
|
||||
that is already in the database, then a reimport is necessary.
|
||||
152
docs/develop/Indexing.md
Normal file
152
docs/develop/Indexing.md
Normal file
@@ -0,0 +1,152 @@
|
||||
# Indexing Places
|
||||
|
||||
In Nominatim, the word __indexing__ refers to the process that takes the raw
|
||||
OpenStreetMap data from the place table, enriches it with address information
|
||||
and creates the search indexes. This section explains the basic data flow.
|
||||
|
||||
|
||||
## Initial import
|
||||
|
||||
After osm2pgsql has loaded the raw OSM data into the place table,
|
||||
the data is copied to the final search tables placex and location_property_osmline.
|
||||
While they are copied, some basic properties are added:
|
||||
|
||||
* country_code, geometry_sector and partition
|
||||
* initial search and address rank
|
||||
|
||||
In addition the column `indexed_status` is set to `1` marking the place as one
|
||||
that needs to be indexed.
|
||||
|
||||
All this happens in the triggers `placex_insert` and `osmline_insert`.
|
||||
|
||||
## Indexing
|
||||
|
||||
The main work horse of the data import is the indexing step, where Nominatim
|
||||
takes every place from the placex and location_property_osmline tables where
|
||||
the indexed_status != 0 and computes the search terms and the address parts
|
||||
of the place.
|
||||
|
||||
The indexing happens in three major steps:
|
||||
|
||||
1. **Data preparation** - The indexer gets the data for the place to be indexed
|
||||
from the database.
|
||||
|
||||
2. **Search name processing** - The prepared data is given to the
|
||||
tokenizer which computes the search terms from the names
|
||||
and potentially other information.
|
||||
|
||||
3. **Address processing** - The indexer then hands the prepared data and the
|
||||
tokenizer information back to the database via an `INSERT` statement which
|
||||
also sets the indexed_status to `0`. This triggers the update triggers
|
||||
`placex_update`/`osmline_update` which do the work of computing address
|
||||
parts and filling all the search tables.
|
||||
|
||||
When computing the address terms of a place, Nominatim relies on the processed
|
||||
search names of all the address parts. That is why places are processed in rank
|
||||
order, from smallest rank to largest. To ensure correct handling of linked
|
||||
place nodes, administrative boundaries are processed before all other places.
|
||||
|
||||
Apart from these restrictions, each place can be indexed independently
|
||||
from the others. This allows a large degree of parallelization during the indexing.
|
||||
It also means that the indexing process can be interrupted at any time and
|
||||
will simply pick up where it left of when restarted.
|
||||
|
||||
### Data preparation
|
||||
|
||||
The data preparation step computes and retrieves all data for a place that
|
||||
might be needed for the next step of processing the search name. That includes
|
||||
|
||||
* location information (country code)
|
||||
* place classification (class, type, ranks)
|
||||
* names (including names of linked places)
|
||||
* address information (`addr:*` tags)
|
||||
|
||||
Data preparation is implemented in pl/PgSQL mostly in the functions
|
||||
`placex_indexing_prepare()` and `get_interpolation_address()`.
|
||||
|
||||
#### `addr:*` tag inheritance
|
||||
|
||||
Nominatim has limited support for inheriting address tags from a building
|
||||
to POIs inside the building. This only works when the address tags are on the
|
||||
building outline. Any rank 30 object inside such a building or on its outline
|
||||
inherits all address tags when it does not have any address tags of its own.
|
||||
|
||||
The inheritance is computed in the data preparation step.
|
||||
|
||||
### Search name processing
|
||||
|
||||
The prepared place information is handed to the tokenizer next. This is a
|
||||
Python module responsible for processing the names from both name and address
|
||||
terms and building up the word index from them. The process is explained in
|
||||
more detail in the [Tokenizer chapter](Tokenizers.md).
|
||||
|
||||
### Address processing
|
||||
|
||||
Finally, the preprocessed place information and the results of the search name
|
||||
processing are written back to the database. At this point the update trigger
|
||||
of the placex/location_property_osmline tables take over and fill all the
|
||||
dependent tables. This makes up the most work-intensive part of the indexing.
|
||||
|
||||
Nominatim distinguishes between dependent and independent places.
|
||||
**Dependent places** are all places on rank 30: house numbers, POIs etc. These
|
||||
places don't have a full address of their own. Instead they are attached to
|
||||
a parent street or place and use the information of the parent for searching
|
||||
and displaying information. Everything else are **independent places**: streets,
|
||||
parks, water bodies, suburbs, cities, states etc. They receive a full address
|
||||
on their own.
|
||||
|
||||
The address processing for both types of places is very different.
|
||||
|
||||
#### Independent places
|
||||
|
||||
To compute the address of an independent place Nominatim searches for all
|
||||
places that cover the place to compute the address for at least partially.
|
||||
For places with an area, that area is used to check for coverage. For place
|
||||
nodes an artificial square area is computed according to the rank of
|
||||
the place. The lower the rank the lager the area. The `location_area_large_X`
|
||||
tables are there to facilitate the lookup. All places that can function as
|
||||
the address of another place are saved in those tables.
|
||||
|
||||
`addr:*` and `isin:*` tags are taken into account to compute the address, too.
|
||||
Nominatim will give preference to places with the same name as in these tags
|
||||
when looking for places in the vicinity. If there are no matching place names
|
||||
at all, then the tags are at least added to the search index. That means that
|
||||
the names will not be shown in the result as the 'address' of the place, but
|
||||
searching by them still works.
|
||||
|
||||
Independent places are always added to the global search index `search_name`.
|
||||
|
||||
#### Dependent places
|
||||
|
||||
Dependent places skip the full address computation for performance reasons.
|
||||
Instead they just find a parent place to attach themselves to.
|
||||
|
||||

|
||||
|
||||
By default a POI
|
||||
or house number will be attached to the closest street. That can be any major
|
||||
or minor street indexed by Nominatim. In the default configuration that means
|
||||
that it can attach itself to a footway but only when it has a name.
|
||||
|
||||
When the dependent place has an `addr:street` tag, then Nominatim will first
|
||||
try to find a street with the same name before falling back to the closest
|
||||
street.
|
||||
|
||||
There are also addresses in OSM, where the housenumber does not belong
|
||||
to a street at all. These have an `addr:place` tag. For these places, Nominatim
|
||||
tries to find a place with the given name in the indexed places with an
|
||||
address rank between 16 and 25. If none is found, then the dependent place
|
||||
is attached to the closest place in that category and the addr:place name is
|
||||
added as *unlisted* place, which indicates to Nominatim that it needs to add
|
||||
it to the address output, no matter what. This special case is necessary to
|
||||
cover addresses that don't really refer to an existing object.
|
||||
|
||||
When an address has both the `addr:street` and `addr:place` tag, then Nominatim
|
||||
assumes that the `addr:place` tag in fact should be the city part of the address
|
||||
and give the POI the usual street number address.
|
||||
|
||||
Dependent places are only added to the global search index `search_name` when
|
||||
they have either a name themselves or when they have address tags that are not
|
||||
covered by the places that make up their address. The latter ensures that
|
||||
addresses are always searchable by those address tags.
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
# Postcodes in Nominatim
|
||||
|
||||
The blog post
|
||||
[Nominatim and Postcodes](https://www.openstreetmap.org/user/lonvia/diary/43143)
|
||||
describes the handling implemented since Nominatim 3.1.
|
||||
|
||||
Postcode centroids (aka 'calculated postcodes') are generated by looking at all
|
||||
postcodes of a country, grouping them and calculating the geometric centroid.
|
||||
There is currently no logic to deal with extreme outliers (typos or other
|
||||
mistakes in OSM data). There is also no check if a postcodes adheres to a
|
||||
country's format, e.g. if Swiss postcodes are 4 digits.
|
||||
|
||||
|
||||
## Regular updating calculated postcodes
|
||||
|
||||
The script to rerun the calculation is
|
||||
`build/utils/update.php --calculate-postcodes`
|
||||
and runs once per night on nominatim.openstreetmap.org.
|
||||
|
||||
|
||||
## Finding places that share a specific postcode
|
||||
|
||||
In the Nominatim database run
|
||||
|
||||
```sql
|
||||
SELECT address->'postcode' as pc,
|
||||
osm_type, osm_id, class, type,
|
||||
st_x(centroid) as lon, st_y(centroid) as lat
|
||||
FROM placex
|
||||
WHERE country_code='fr'
|
||||
AND upper(trim (both ' ' from address->'postcode')) = '33210';
|
||||
```
|
||||
|
||||
Alternatively on [Overpass](https://overpass-turbo.eu/) run the following query
|
||||
|
||||
```
|
||||
[out:json][timeout:250];
|
||||
area["name"="France"]->.boundaryarea;
|
||||
(
|
||||
nwr(area.boundaryarea)["addr:postcode"="33210"];
|
||||
);
|
||||
out body;
|
||||
>;
|
||||
out skel qt;
|
||||
```
|
||||
@@ -1,90 +0,0 @@
|
||||
# Place Ranking in Nominatim
|
||||
|
||||
Nominatim uses two metrics to rank a place: search rank and address rank.
|
||||
Both can be assigned a value between 0 and 30. They serve slightly
|
||||
different purposes, which are explained in this chapter.
|
||||
|
||||
## Search rank
|
||||
|
||||
The search rank describes the extent and importance of a place. It is used
|
||||
when ranking search result. Simply put, if there are two results for a
|
||||
search query which are otherwise equal, then the result with the _lower_
|
||||
search rank will be appear higher in the result list.
|
||||
|
||||
Search ranks are not so important these days because many well-known
|
||||
places use the Wikipedia importance ranking instead.
|
||||
|
||||
## Address rank
|
||||
|
||||
The address rank describes where a place shows up in an address hierarchy.
|
||||
Usually only administrative boundaries and place nodes and areas are
|
||||
eligible to be part of an address. All other objects have an address rank
|
||||
of 0.
|
||||
|
||||
Note that the search rank of a place plays a role in the address computation
|
||||
as well. When collecting the places that should make up the address parts
|
||||
then only places are taken into account that have a lower address rank than
|
||||
the search rank of the base object.
|
||||
|
||||
## Rank configuration
|
||||
|
||||
Search and address ranks are assigned to a place when it is first imported
|
||||
into the database. There are a few hard-coded rules for the assignment:
|
||||
|
||||
* postcodes follow special rules according to their length
|
||||
* boundaries that are not areas and railway=rail are dropped completely
|
||||
* the following are always search rank 30 and address rank 0:
|
||||
* highway nodes
|
||||
* landuse that is not an area
|
||||
|
||||
Other than that, the ranks can be freely assigned via the JSON file
|
||||
defined with `CONST_Address_Level_Config` according to their type and
|
||||
the country they are in.
|
||||
|
||||
The address level configuration must consist of an array of configuration
|
||||
entries, each containing a tag definition and an optional country array:
|
||||
|
||||
```
|
||||
[ {
|
||||
"tags" : {
|
||||
"place" : {
|
||||
"county" : 12,
|
||||
"city" : 16,
|
||||
},
|
||||
"landuse" : {
|
||||
"residential" : 22,
|
||||
"" : 30
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"countries" : [ "ca", "us" ],
|
||||
"tags" : {
|
||||
"boundary" : {
|
||||
"administrative8" : 18,
|
||||
"administrative9" : 20
|
||||
},
|
||||
"landuse" : {
|
||||
"residential" : [22, 0]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
The `countries` field contains a list of countries (as ISO 3166-1 alpha 2 code)
|
||||
for which the definition applies. When the field is omitted, then the
|
||||
definition is used as a fallback, when nothing more specific for a given
|
||||
country exists.
|
||||
|
||||
`tags` contains the ranks for key/value pairs. The ranks can be either a
|
||||
single number, in which case they are the search and address rank, or an array
|
||||
of search and address rank (in that order). The value may be left empty.
|
||||
Then the rank is used when no more specific value is found for the given
|
||||
key.
|
||||
|
||||
Countries and key/value combination may appear in multiple definitions. Just
|
||||
make sure that each combination of counrty/key/value appears only once per
|
||||
file. Otherwise the import will fail with a UNIQUE INDEX constraint violation
|
||||
on import.
|
||||
|
||||
139
docs/develop/Testing.md
Normal file
139
docs/develop/Testing.md
Normal file
@@ -0,0 +1,139 @@
|
||||
# Nominatim Test Suite
|
||||
|
||||
This chapter describes the tests in the `/test` directory, how they are
|
||||
structured and how to extend them. For a quick introduction on how to run
|
||||
the tests, see the [Development setup chapter](Development-Environment.md).
|
||||
|
||||
## Overall structure
|
||||
|
||||
There are two kind of tests in this test suite. There are functional tests
|
||||
which test the API interface using a BDD test framework and there are unit
|
||||
tests for specific PHP functions.
|
||||
|
||||
This test directory is structured as follows:
|
||||
|
||||
```
|
||||
-+- bdd Functional API tests
|
||||
| \
|
||||
| +- steps Step implementations for test descriptions
|
||||
| +- osm2pgsql Tests for data import via osm2pgsql
|
||||
| +- db Tests for internal data processing on import and update
|
||||
| +- api Tests for API endpoints (search, reverse, etc.)
|
||||
|
|
||||
+- php PHP unit tests
|
||||
+- python Python unit tests
|
||||
+- testdb Base data for generating API test database
|
||||
+- testdata Additional test data used by unit tests
|
||||
```
|
||||
|
||||
## PHP Unit Tests (`test/php`)
|
||||
|
||||
Unit tests for PHP code can be found in the `php/` directory. They test selected
|
||||
PHP functions. Very low coverage.
|
||||
|
||||
To execute the test suite run
|
||||
|
||||
cd test/php
|
||||
UNIT_TEST_DSN='pgsql:dbname=nominatim_unit_tests' phpunit ../
|
||||
|
||||
It will read phpunit.xml which points to the library, test path, bootstrap
|
||||
strip and sets other parameters.
|
||||
|
||||
It will use (and destroy) a local database 'nominatim_unit_tests'. You can set
|
||||
a different connection string with e.g. UNIT_TEST_DSN='pgsql:dbname=foo_unit_tests'.
|
||||
|
||||
## Python Unit Tests (`test/python`)
|
||||
|
||||
Unit tests for Python code can be found in the `python/` directory. The goal is
|
||||
to have complete coverage of the Python library in `nominatim`.
|
||||
|
||||
To execute the tests run
|
||||
|
||||
py.test-3 test/python
|
||||
|
||||
or
|
||||
|
||||
pytest test/python
|
||||
|
||||
The name of the pytest binary depends on your installation.
|
||||
|
||||
## BDD Functional Tests (`test/bdd`)
|
||||
|
||||
Functional tests are written as BDD instructions. For more information on
|
||||
the philosophy of BDD testing, see the
|
||||
[Behave manual](http://pythonhosted.org/behave/philosophy.html).
|
||||
|
||||
The following explanation assume that the reader is familiar with the BDD
|
||||
notations of features, scenarios and steps.
|
||||
|
||||
All possible steps can be found in the `steps` directory and should ideally
|
||||
be documented.
|
||||
|
||||
### General Usage
|
||||
|
||||
To run the functional tests, do
|
||||
|
||||
cd test/bdd
|
||||
behave
|
||||
|
||||
The tests can be configured with a set of environment variables (`behave -D key=val`):
|
||||
|
||||
* `TEMPLATE_DB` - name of template database used as a skeleton for
|
||||
the test databases (db tests)
|
||||
* `TEST_DB` - name of test database (db tests)
|
||||
* `API_TEST_DB` - name of the database containing the API test data (api tests)
|
||||
* `API_TEST_FILE` - OSM file to be imported into the API test database (api tests)
|
||||
* `API_ENGINE` - webframe to use for running search queries, same values as
|
||||
`nominatim serve --engine` parameter
|
||||
* `DB_HOST` - (optional) hostname of database host
|
||||
* `DB_PORT` - (optional) port of database on host
|
||||
* `DB_USER` - (optional) username of database login
|
||||
* `DB_PASS` - (optional) password for database login
|
||||
* `SERVER_MODULE_PATH` - (optional) path on the Postgres server to Nominatim
|
||||
module shared library file (only needed for legacy tokenizer)
|
||||
* `REMOVE_TEMPLATE` - if true, the template and API database will not be reused
|
||||
during the next run. Reusing the base templates speeds
|
||||
up tests considerably but might lead to outdated errors
|
||||
for some changes in the database layout.
|
||||
* `KEEP_TEST_DB` - if true, the test database will not be dropped after a test
|
||||
is finished. Should only be used if one single scenario is
|
||||
run, otherwise the result is undefined.
|
||||
|
||||
Logging can be defined through command line parameters of behave itself. Check
|
||||
out `behave --help` for details. Also have a look at the 'work-in-progress'
|
||||
feature of behave which comes in handy when writing new tests.
|
||||
|
||||
### API Tests (`test/bdd/api`)
|
||||
|
||||
These tests are meant to test the different API endpoints and their parameters.
|
||||
They require to import several datasets into a test database. This is normally
|
||||
done automatically during setup of the test. The API test database is then
|
||||
kept around and reused in subsequent runs of behave. Use `behave -DREMOVE_TEMPLATE`
|
||||
to force a reimport of the database.
|
||||
|
||||
The official test dataset is saved in the file `test/testdb/apidb-test-data.pbf`
|
||||
and compromises the following data:
|
||||
|
||||
* Geofabrik extract of Liechtenstein
|
||||
* extract of Autauga country, Alabama, US (for tests against Tiger data)
|
||||
* additional data from `test/testdb/additional_api_test.data.osm`
|
||||
|
||||
API tests should only be testing the functionality of the website PHP code.
|
||||
Most tests should be formulated as BDD DB creation tests (see below) instead.
|
||||
|
||||
### DB Creation Tests (`test/bdd/db`)
|
||||
|
||||
These tests check the import and update of the Nominatim database. They do not
|
||||
test the correctness of osm2pgsql. Each test will write some data into the `place`
|
||||
table (and optionally the `planet_osm_*` tables if required) and then run
|
||||
Nominatim's processing functions on that.
|
||||
|
||||
These tests need to create their own test databases. By default they will be
|
||||
called `test_template_nominatim` and `test_nominatim`. Names can be changed with
|
||||
the environment variables `TEMPLATE_DB` and `TEST_DB`. The user running the tests
|
||||
needs superuser rights for postgres.
|
||||
|
||||
### Import Tests (`test/bdd/osm2pgsql`)
|
||||
|
||||
These tests check that data is imported correctly into the place table. They
|
||||
use the same template database as the DB Creation tests, so the same remarks apply.
|
||||
354
docs/develop/Tokenizers.md
Normal file
354
docs/develop/Tokenizers.md
Normal file
@@ -0,0 +1,354 @@
|
||||
# Tokenizers
|
||||
|
||||
The tokenizer is the component of Nominatim that is responsible for
|
||||
analysing names of OSM objects and queries. Nominatim provides different
|
||||
tokenizers that use different strategies for normalisation. This page describes
|
||||
how tokenizers are expected to work and the public API that needs to be
|
||||
implemented when creating a new tokenizer. For information on how to configure
|
||||
a specific tokenizer for a database see the
|
||||
[tokenizer chapter in the Customization Guide](../customize/Tokenizers.md).
|
||||
|
||||
## Generic Architecture
|
||||
|
||||
### About Search Tokens
|
||||
|
||||
Search in Nominatim is organised around search tokens. Such a token represents
|
||||
string that can be part of the search query. Tokens are used so that the search
|
||||
index does not need to be organised around strings. Instead the database saves
|
||||
for each place which tokens match this place's name, address, house number etc.
|
||||
To be able to distinguish between these different types of information stored
|
||||
with the place, a search token also always has a certain type: name, house number,
|
||||
postcode etc.
|
||||
|
||||
During search an incoming query is transformed into a ordered list of such
|
||||
search tokens (or rather many lists, see below) and this list is then converted
|
||||
into a database query to find the right place.
|
||||
|
||||
It is the core task of the tokenizer to create, manage and assign the search
|
||||
tokens. The tokenizer is involved in two distinct operations:
|
||||
|
||||
* __at import time__: scanning names of OSM objects, normalizing them and
|
||||
building up the list of search tokens.
|
||||
* __at query time__: scanning the query and returning the appropriate search
|
||||
tokens.
|
||||
|
||||
|
||||
### Importing
|
||||
|
||||
The indexer is responsible to enrich an OSM object (or place) with all data
|
||||
required for geocoding. It is split into two parts: the controller collects
|
||||
the places that require updating, enriches the place information as required
|
||||
and hands the place to Postgresql. The collector is part of the Nominatim
|
||||
library written in Python. Within Postgresql, the `placex_update`
|
||||
trigger is responsible to fill out all secondary tables with extra geocoding
|
||||
information. This part is written in PL/pgSQL.
|
||||
|
||||
The tokenizer is involved in both parts. When the indexer prepares a place,
|
||||
it hands it over to the tokenizer to inspect the names and create all the
|
||||
search tokens applicable for the place. This usually involves updating the
|
||||
tokenizer's internal token lists and creating a list of all token IDs for
|
||||
the specific place. This list is later needed in the PL/pgSQL part where the
|
||||
indexer needs to add the token IDs to the appropriate search tables. To be
|
||||
able to communicate the list between the Python part and the pl/pgSQL trigger,
|
||||
the `placex` table contains a special JSONB column `token_info` which is there
|
||||
for the exclusive use of the tokenizer.
|
||||
|
||||
The Python part of the tokenizer returns a structured information about the
|
||||
tokens of a place to the indexer which converts it to JSON and inserts it into
|
||||
the `token_info` column. The content of the column is then handed to the PL/pqSQL
|
||||
callbacks of the tokenizer which extracts the required information. Usually
|
||||
the tokenizer then removes all information from the `token_info` structure,
|
||||
so that no information is ever persistently saved in the table. All information
|
||||
that went in should have been processed after all and put into secondary tables.
|
||||
This is however not a hard requirement. If the tokenizer needs to store
|
||||
additional information about a place permanently, it may do so in the
|
||||
`token_info` column. It just may never execute searches over it and
|
||||
consequently not create any special indexes on it.
|
||||
|
||||
### Querying
|
||||
|
||||
At query time, Nominatim builds up multiple _interpretations_ of the search
|
||||
query. Each of these interpretations is tried against the database in order
|
||||
of the likelihood with which they match to the search query. The first
|
||||
interpretation that yields results wins.
|
||||
|
||||
The interpretations are encapsulated in the `SearchDescription` class. An
|
||||
instance of this class is created by applying a sequence of
|
||||
_search tokens_ to an initially empty SearchDescription. It is the
|
||||
responsibility of the tokenizer to parse the search query and derive all
|
||||
possible sequences of search tokens. To that end the tokenizer needs to parse
|
||||
the search query and look up matching words in its own data structures.
|
||||
|
||||
## Tokenizer API
|
||||
|
||||
The following section describes the functions that need to be implemented
|
||||
for a custom tokenizer implementation.
|
||||
|
||||
!!! warning
|
||||
This API is currently in early alpha status. While this API is meant to
|
||||
be a public API on which other tokenizers may be implemented, the API is
|
||||
far away from being stable at the moment.
|
||||
|
||||
### Directory Structure
|
||||
|
||||
Nominatim expects two files for a tokenizer:
|
||||
|
||||
* `nominatim/tokenizer/<NAME>_tokenizer.py` containing the Python part of the
|
||||
implementation
|
||||
* `lib-php/tokenizer/<NAME>_tokenizer.php` with the PHP part of the
|
||||
implementation
|
||||
|
||||
where `<NAME>` is a unique name for the tokenizer consisting of only lower-case
|
||||
letters, digits and underscore. A tokenizer also needs to install some SQL
|
||||
functions. By convention, these should be placed in `lib-sql/tokenizer`.
|
||||
|
||||
If the tokenizer has a default configuration file, this should be saved in
|
||||
the `settings/<NAME>_tokenizer.<SUFFIX>`.
|
||||
|
||||
### Configuration and Persistence
|
||||
|
||||
Tokenizers may define custom settings for their configuration. All settings
|
||||
must be prefixed with `NOMINATIM_TOKENIZER_`. Settings may be transient or
|
||||
persistent. Transient settings are loaded from the configuration file when
|
||||
Nominatim is started and may thus be changed at any time. Persistent settings
|
||||
are tied to a database installation and must only be read during installation
|
||||
time. If they are needed for the runtime then they must be saved into the
|
||||
`nominatim_properties` table and later loaded from there.
|
||||
|
||||
### The Python module
|
||||
|
||||
The Python module is expect to export a single factory function:
|
||||
|
||||
```python
|
||||
def create(dsn: str, data_dir: Path) -> AbstractTokenizer
|
||||
```
|
||||
|
||||
The `dsn` parameter contains the DSN of the Nominatim database. The `data_dir`
|
||||
is a directory in the project directory that the tokenizer may use to save
|
||||
database-specific data. The function must return the instance of the tokenizer
|
||||
class as defined below.
|
||||
|
||||
### Python Tokenizer Class
|
||||
|
||||
All tokenizers must inherit from `nominatim_db.tokenizer.base.AbstractTokenizer`
|
||||
and implement the abstract functions defined there.
|
||||
|
||||
::: nominatim_db.tokenizer.base.AbstractTokenizer
|
||||
options:
|
||||
heading_level: 6
|
||||
|
||||
### Python Analyzer Class
|
||||
|
||||
::: nominatim_db.tokenizer.base.AbstractAnalyzer
|
||||
options:
|
||||
heading_level: 6
|
||||
|
||||
### PL/pgSQL Functions
|
||||
|
||||
The tokenizer must provide access functions for the `token_info` column
|
||||
to the indexer which extracts the necessary information for the global
|
||||
search tables. If the tokenizer needs additional SQL functions for private
|
||||
use, then these functions must be prefixed with `token_` in order to ensure
|
||||
that there are no naming conflicts with the SQL indexer code.
|
||||
|
||||
The following functions are expected:
|
||||
|
||||
```sql
|
||||
FUNCTION token_get_name_search_tokens(info JSONB) RETURNS INTEGER[]
|
||||
```
|
||||
|
||||
Return an array of token IDs of search terms that should match
|
||||
the name(s) for the given place. These tokens are used to look up the place
|
||||
by name and, where the place functions as part of an address for another place,
|
||||
by address. Must return NULL when the place has no name.
|
||||
|
||||
```sql
|
||||
FUNCTION token_get_name_match_tokens(info JSONB) RETURNS INTEGER[]
|
||||
```
|
||||
|
||||
Return an array of token IDs of full names of the place that should be used
|
||||
to match addresses. The list of match tokens is usually more strict than
|
||||
search tokens as it is used to find a match between two OSM tag values which
|
||||
are expected to contain matching full names. Partial terms should not be
|
||||
used for match tokens. Must return NULL when the place has no name.
|
||||
|
||||
```sql
|
||||
FUNCTION token_get_housenumber_search_tokens(info JSONB) RETURNS INTEGER[]
|
||||
```
|
||||
|
||||
Return an array of token IDs of house number tokens that apply to the place.
|
||||
Note that a place may have multiple house numbers, for example when apartments
|
||||
each have their own number. Must be NULL when the place has no house numbers.
|
||||
|
||||
```sql
|
||||
FUNCTION token_normalized_housenumber(info JSONB) RETURNS TEXT
|
||||
```
|
||||
|
||||
Return the house number(s) in the normalized form that can be matched against
|
||||
a house number token text. If a place has multiple house numbers they must
|
||||
be listed with a semicolon as delimiter. Must be NULL when the place has no
|
||||
house numbers.
|
||||
|
||||
```sql
|
||||
FUNCTION token_is_street_address(info JSONB) RETURNS BOOLEAN
|
||||
```
|
||||
|
||||
Return true if this is an object that should be parented against a street.
|
||||
Only relevant for objects with address rank 30.
|
||||
|
||||
```sql
|
||||
FUNCTION token_has_addr_street(info JSONB) RETURNS BOOLEAN
|
||||
```
|
||||
|
||||
Return true if there are street names to match against for finding the
|
||||
parent of the object.
|
||||
|
||||
|
||||
```sql
|
||||
FUNCTION token_has_addr_place(info JSONB) RETURNS BOOLEAN
|
||||
```
|
||||
|
||||
Return true if there are place names to match against for finding the
|
||||
parent of the object.
|
||||
|
||||
```sql
|
||||
FUNCTION token_matches_street(info JSONB, street_tokens INTEGER[]) RETURNS BOOLEAN
|
||||
```
|
||||
|
||||
Check if the given tokens (previously saved from `token_get_name_match_tokens()`)
|
||||
match against the `addr:street` tag name. Must return either NULL or FALSE
|
||||
when the place has no `addr:street` tag.
|
||||
|
||||
```sql
|
||||
FUNCTION token_matches_place(info JSONB, place_tokens INTEGER[]) RETURNS BOOLEAN
|
||||
```
|
||||
|
||||
Check if the given tokens (previously saved from `token_get_name_match_tokens()`)
|
||||
match against the `addr:place` tag name. Must return either NULL or FALSE
|
||||
when the place has no `addr:place` tag.
|
||||
|
||||
|
||||
```sql
|
||||
FUNCTION token_addr_place_search_tokens(info JSONB) RETURNS INTEGER[]
|
||||
```
|
||||
|
||||
Return the search token IDs extracted from the `addr:place` tag. These tokens
|
||||
are used for searches by address when no matching place can be found in the
|
||||
database. Must be NULL when the place has no `addr:place` tag.
|
||||
|
||||
```sql
|
||||
FUNCTION token_get_address_keys(info JSONB) RETURNS SETOF TEXT
|
||||
```
|
||||
|
||||
Return the set of keys for which address information is provided. This
|
||||
should correspond to the list of (relevant) `addr:*` tags with the `addr:`
|
||||
prefix removed or the keys used in the `address` dictionary of the place info.
|
||||
|
||||
```sql
|
||||
FUNCTION token_get_address_search_tokens(info JSONB, key TEXT) RETURNS INTEGER[]
|
||||
```
|
||||
|
||||
Return the array of search tokens for the given address part. `key` can be
|
||||
expected to be one of those returned with `token_get_address_keys()`. The
|
||||
search tokens are added to the address search vector of the place, when no
|
||||
corresponding OSM object could be found for the given address part from which
|
||||
to copy the name information.
|
||||
|
||||
```sql
|
||||
FUNCTION token_matches_address(info JSONB, key TEXT, tokens INTEGER[])
|
||||
```
|
||||
|
||||
Check if the given tokens match against the address part `key`.
|
||||
|
||||
__Warning:__ the tokens that are handed in are the lists previously saved
|
||||
from `token_get_name_search_tokens()`, _not_ from the match token list. This
|
||||
is an historical oddity which will be fixed at some point in the future.
|
||||
Currently, tokenizers are encouraged to make sure that matching works against
|
||||
both the search token list and the match token list.
|
||||
|
||||
```sql
|
||||
FUNCTION token_get_postcode(info JSONB) RETURNS TEXT
|
||||
```
|
||||
|
||||
Return the postcode for the object, if any exists. The postcode must be in
|
||||
the form that should also be presented to the end-user.
|
||||
|
||||
```sql
|
||||
FUNCTION token_strip_info(info JSONB) RETURNS JSONB
|
||||
```
|
||||
|
||||
Return the part of the `token_info` field that should be stored in the database
|
||||
permanently. The indexer calls this function when all processing is done and
|
||||
replaces the content of the `token_info` column with the returned value before
|
||||
the trigger stores the information in the database. May return NULL if no
|
||||
information should be stored permanently.
|
||||
|
||||
### PHP Tokenizer class
|
||||
|
||||
The PHP tokenizer class is instantiated once per request and responsible for
|
||||
analyzing the incoming query. Multiple requests may be in flight in
|
||||
parallel.
|
||||
|
||||
The class is expected to be found under the
|
||||
name of `\Nominatim\Tokenizer`. To find the class the PHP code includes the file
|
||||
`tokenizer/tokenizer.php` in the project directory. This file must be created
|
||||
when the tokenizer is first set up on import. The file should initialize any
|
||||
configuration variables by setting PHP constants and then require the file
|
||||
with the actual implementation of the tokenizer.
|
||||
|
||||
The tokenizer class must implement the following functions:
|
||||
|
||||
```php
|
||||
public function __construct(object &$oDB)
|
||||
```
|
||||
|
||||
The constructor of the class receives a database connection that can be used
|
||||
to query persistent data in the database.
|
||||
|
||||
```php
|
||||
public function checkStatus()
|
||||
```
|
||||
|
||||
Check that the tokenizer can access its persistent data structures. If there
|
||||
is an issue, throw an `\Exception`.
|
||||
|
||||
```php
|
||||
public function normalizeString(string $sTerm) : string
|
||||
```
|
||||
|
||||
Normalize string to a form to be used for comparisons when reordering results.
|
||||
Nominatim reweighs results how well the final display string matches the actual
|
||||
query. Before comparing result and query, names and query are normalised against
|
||||
this function. The tokenizer can thus remove all properties that should not be
|
||||
taken into account for reweighing, e.g. special characters or case.
|
||||
|
||||
```php
|
||||
public function tokensForSpecialTerm(string $sTerm) : array
|
||||
```
|
||||
|
||||
Return the list of special term tokens that match the given term.
|
||||
|
||||
```php
|
||||
public function extractTokensFromPhrases(array &$aPhrases) : TokenList
|
||||
```
|
||||
|
||||
Parse the given phrases, splitting them into word lists and retrieve the
|
||||
matching tokens.
|
||||
|
||||
The phrase array may take on two forms. In unstructured searches (using `q=`
|
||||
parameter) the search query is split at the commas and the elements are
|
||||
put into a sorted list. For structured searches the phrase array is an
|
||||
associative array where the key designates the type of the term (street, city,
|
||||
county etc.) The tokenizer may ignore the phrase type at this stage in parsing.
|
||||
Matching phrase type and appropriate search token type will be done later
|
||||
when the SearchDescription is built.
|
||||
|
||||
For each phrase in the list of phrases, the function must analyse the phrase
|
||||
string and then call `setWordSets()` to communicate the result of the analysis.
|
||||
A word set is a list of strings, where each string refers to a search token.
|
||||
A phrase may have multiple interpretations. Therefore a list of word sets is
|
||||
usually attached to the phrase. The search tokens themselves are returned
|
||||
by the function in an associative array, where the key corresponds to the
|
||||
strings given in the word sets. The value is a list of search tokens. Thus
|
||||
a single string in the list of word sets may refer to multiple search tokens.
|
||||
|
||||
35
docs/develop/address-tables.plantuml
Normal file
35
docs/develop/address-tables.plantuml
Normal file
@@ -0,0 +1,35 @@
|
||||
@startuml
|
||||
skinparam monochrome true
|
||||
skinparam ObjectFontStyle bold
|
||||
|
||||
map search_name_X {
|
||||
place_id => BIGINT
|
||||
address_rank => SMALLINT
|
||||
name_vector => INT[]
|
||||
centroid => GEOMETRY
|
||||
}
|
||||
|
||||
map location_area_large_X {
|
||||
place_id => BIGINT
|
||||
keywords => INT[]
|
||||
partition => SMALLINT
|
||||
rank_search => SMALLINT
|
||||
rank_address => SMALLINT
|
||||
country_code => VARCHR(2)
|
||||
isguess => BOOLEAN
|
||||
postcode => TEXT
|
||||
centroid => POINT
|
||||
geometry => GEOMETRY
|
||||
}
|
||||
|
||||
map location_road_X {
|
||||
place_id => BIGINT
|
||||
partition => SMALLINT
|
||||
country_code => VARCHR(2)
|
||||
geometry => GEOMETRY
|
||||
}
|
||||
|
||||
search_name_X -[hidden]> location_area_large_X
|
||||
location_area_large_X -[hidden]> location_road_X
|
||||
|
||||
@enduml
|
||||
47
docs/develop/address-tables.svg
Normal file
47
docs/develop/address-tables.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 11 KiB |
34
docs/develop/data-sources.md
Normal file
34
docs/develop/data-sources.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Additional Data Sources
|
||||
|
||||
This guide explains how data sources other than OpenStreetMap mentioned in
|
||||
the install instructions got obtained and converted.
|
||||
|
||||
## Country grid
|
||||
|
||||
Nominatim uses pre-generated country borders data. In case one imports only
|
||||
a subset of a country. And to assign each place a partition. Nominatim
|
||||
database tables are split into partitions for performance.
|
||||
|
||||
More details in [osm-search/country-grid-data](https://github.com/osm-search/country-grid-data).
|
||||
|
||||
## US Census TIGER
|
||||
|
||||
For the United States you can choose to import additional street-level data.
|
||||
The data isn't mixed into OSM data but queried as fallback when no OSM
|
||||
result can be found.
|
||||
|
||||
More details in [osm-search/TIGER-data](https://github.com/osm-search/TIGER-data).
|
||||
|
||||
## GB postcodes
|
||||
|
||||
For Great Britain you can choose to import Royalmail postcode centroids.
|
||||
|
||||
More details in [osm-search/gb-postcode-data](https://github.com/osm-search/gb-postcode-data).
|
||||
|
||||
|
||||
## Wikipedia & Wikidata rankings
|
||||
|
||||
Nominatim can import "importance" data of place names. This greatly
|
||||
improves ranking of results.
|
||||
|
||||
More details in [osm-search/wikipedia-wikidata](https://github.com/osm-search/wikipedia-wikidata).
|
||||
44
docs/develop/osm2pgsql-tables.plantuml
Normal file
44
docs/develop/osm2pgsql-tables.plantuml
Normal file
@@ -0,0 +1,44 @@
|
||||
@startuml
|
||||
skinparam monochrome true
|
||||
skinparam ObjectFontStyle bold
|
||||
|
||||
map planet_osm_nodes #eee {
|
||||
id => BIGINT
|
||||
lat => INT
|
||||
lon => INT
|
||||
}
|
||||
|
||||
map planet_osm_ways #eee {
|
||||
id => BIGINT
|
||||
nodes => BIGINT[]
|
||||
tags => TEXT[]
|
||||
}
|
||||
|
||||
map planet_osm_rels #eee {
|
||||
id => BIGINT
|
||||
parts => BIGINT[]
|
||||
members => TEXT[]
|
||||
tags => TEXT[]
|
||||
way_off => SMALLINT
|
||||
rel_off => SMALLINT
|
||||
}
|
||||
|
||||
map place {
|
||||
osm_type => CHAR(1)
|
||||
osm_id => BIGINT
|
||||
class => TEXT
|
||||
type => TEXT
|
||||
name => HSTORE
|
||||
address => HSTORE
|
||||
extratags => HSTORE
|
||||
admin_level => SMALLINT
|
||||
geometry => GEOMETRY
|
||||
}
|
||||
|
||||
planet_osm_nodes -[hidden]> planet_osm_ways
|
||||
planet_osm_ways -[hidden]> planet_osm_rels
|
||||
planet_osm_ways -[hidden]-> place
|
||||
|
||||
planet_osm_nodes::id <- planet_osm_ways::nodes
|
||||
|
||||
@enduml
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user