Skip to content

Commit 0ec5c18

Browse files
committed
update import README and tag script
1 parent 3dd5381 commit 0ec5c18

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

importer/README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
Import program and scripts.
1+
# Import program and scripts.
22

3-
Import program is using moodified libosmscout library that can be installed
4-
by `install_deps.sh` script.
3+
Import program is using Nominatim database and filters the data using boundary
4+
given in GeoJSON file.
55

6-
To generate larger amount of missing tags for the input map stylesheet
7-
and whitelist, the scripts under `scripts/tags` (from main directory
8-
of the project) can be used.
6+
The boundary file can be generated from POLY files as provided by Geofabrik or
7+
given in hierarchy folder of OSM Scout Server (see
8+
https://github.com/rinigus/osmscout-server/tree/master/scripts/import/hierarchy).
9+
As a converter, [poly2geojson](https://github.com/frafra/poly2geojson/) can be
10+
used.
911

10-
Used:
12+
Data can be filtered using data/priority.list and data/skip.list files. Those
13+
list OSM tags in the form where tag type and its value are merged using `_`. Out
14+
of the lists, the priority one gives locations that would be kept in the
15+
database even without names associated with them for reverse geocoding. The
16+
"skip" list allows to specify locations that would be dropped by location type.
17+
18+
To generate larger amount of tags for the priority list, the scripts
19+
under `scripts/tags` (from main directory of the project) can be used.
20+
21+
## Used
1122

1223
- Nominatim Docker https://github.com/mediagis/nominatim-docker/
13-
- For testing: Nominatim-UI https://github.com/osm-search/nominatim-ui
24+
- For testing: Nominatim-UI https://github.com/osm-search/nominatim-ui
25+
- poly2geojson: https://github.com/frafra/poly2geojson

scripts/tags/generate_mapstyle.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
db = sqlite3.connect('taginfo-db.db')
66
c = db.cursor()
77

8-
mapost = ""
9-
whitelist = ""
8+
prioritylist = ""
109

1110
keyvals = []
1211
for r in c.execute("select key,value from tags where key='shop' order by count_all desc limit 50"):
@@ -22,13 +21,8 @@
2221
for r in keyvals:
2322
key, value = r
2423

25-
mapost += ' TYPE ' + key + '_' + value + '\n'
26-
mapost += ' = NODE AREA ("%s"=="%s")\n' % (key, value)
27-
mapost += ' {Name, NameAlt}\n ADDRESS POI\n GROUP ' + key + '\n\n'
24+
prioritylist += key + '_' + value + '\n'
2825

29-
whitelist += key + '_' + value + '\n'
30-
31-
print(mapost)
32-
print(whitelist)
26+
print(prioritylist)
3327

3428

0 commit comments

Comments
 (0)