pelias-openstreetmap 5.11.2 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +4 -0
- package/.github/workflows/push.yml +23 -29
- package/package.json +3 -4
- package/stream/tag_mapper.js +20 -3
- package/.circleci/config.yml +0 -12
package/.dockerignore
CHANGED
|
@@ -7,10 +7,10 @@ jobs:
|
|
|
7
7
|
matrix:
|
|
8
8
|
os:
|
|
9
9
|
- ubuntu-20.04
|
|
10
|
-
- macos-10.15
|
|
11
10
|
node-version:
|
|
12
|
-
- 10.x
|
|
13
11
|
- 12.x
|
|
12
|
+
- 14.x
|
|
13
|
+
- 16.x
|
|
14
14
|
steps:
|
|
15
15
|
- uses: actions/checkout@v2
|
|
16
16
|
- name: 'Install node.js ${{ matrix.node-version }}'
|
|
@@ -20,42 +20,36 @@ jobs:
|
|
|
20
20
|
- name: Run unit tests
|
|
21
21
|
run: |
|
|
22
22
|
npm install
|
|
23
|
-
npm run
|
|
24
|
-
functional-tests:
|
|
25
|
-
runs-on: '${{ matrix.os }}'
|
|
26
|
-
strategy:
|
|
27
|
-
matrix:
|
|
28
|
-
os:
|
|
29
|
-
- ubuntu-20.04
|
|
30
|
-
- macos-10.15
|
|
31
|
-
node-version:
|
|
32
|
-
- 10.x
|
|
33
|
-
- 12.x
|
|
34
|
-
steps:
|
|
35
|
-
- uses: actions/checkout@v2
|
|
36
|
-
- name: 'Install node.js ${{ matrix.node-version }}'
|
|
37
|
-
uses: actions/setup-node@v2-beta
|
|
38
|
-
with:
|
|
39
|
-
node-version: '${{ matrix.node-version }}'
|
|
40
|
-
- name: Run functional tests
|
|
41
|
-
run: |
|
|
42
|
-
npm install
|
|
43
|
-
npm run end-to-end
|
|
23
|
+
npm run ci
|
|
44
24
|
npm-publish:
|
|
45
25
|
needs: unit-tests
|
|
46
26
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
47
|
-
runs-on: ubuntu-
|
|
27
|
+
runs-on: ubuntu-20.04
|
|
48
28
|
steps:
|
|
49
29
|
- uses: actions/checkout@v2
|
|
50
|
-
- name: Install
|
|
30
|
+
- name: Install Node.js
|
|
51
31
|
uses: actions/setup-node@v2-beta
|
|
52
32
|
with:
|
|
53
|
-
node-version:
|
|
33
|
+
node-version: 16.x
|
|
54
34
|
- name: Run semantic-release
|
|
55
35
|
env:
|
|
56
36
|
GH_TOKEN: ${{ secrets.GH_SEMANTIC_RELEASE_TOKEN }}
|
|
57
37
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
58
38
|
run: >
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
39
|
+
if [[ -n "$GH_TOKEN" && -n "$NPM_TOKEN" ]]; then
|
|
40
|
+
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/semantic-release.sh" | bash -
|
|
41
|
+
fi
|
|
42
|
+
build-docker-images:
|
|
43
|
+
# run this job if the unit tests passed and the npm-publish job was a success or was skipped
|
|
44
|
+
# note: github actions won't run a job if you don't call one of the status check functions, so `always()` is called since it evalutes to `true`
|
|
45
|
+
if: ${{ always() && needs.unit-tests.result == 'success' && (needs.npm-publish.result == 'success' || needs.npm-publish.result == 'skipped') }}
|
|
46
|
+
needs: [unit-tests, npm-publish]
|
|
47
|
+
runs-on: ubuntu-20.04
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v2
|
|
50
|
+
- name: Build Docker images
|
|
51
|
+
env:
|
|
52
|
+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
53
|
+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
54
|
+
run: |
|
|
55
|
+
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash -
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pelias-openstreetmap",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.14.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=10.0.0"
|
|
6
6
|
},
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"lint": "jshint .",
|
|
17
17
|
"start": "./bin/start",
|
|
18
18
|
"test": "npm run units",
|
|
19
|
-
"
|
|
19
|
+
"ci": "node ./test/ci-config.js && npm test && npm run end-to-end",
|
|
20
20
|
"units": "./bin/test",
|
|
21
21
|
"validate": "npm ls"
|
|
22
22
|
},
|
|
@@ -41,13 +41,12 @@
|
|
|
41
41
|
"iso-639-3": "^1.0.0",
|
|
42
42
|
"joi": "^14.0.0",
|
|
43
43
|
"lodash": "^4.17.4",
|
|
44
|
-
"merge": "^1.2.0",
|
|
45
44
|
"pbf2json": "^6.9.0",
|
|
46
45
|
"pelias-blacklist-stream": "^1.0.0",
|
|
47
46
|
"pelias-config": "^4.12.0",
|
|
48
47
|
"pelias-dbclient": "^2.13.0",
|
|
49
48
|
"pelias-logger": "^1.2.1",
|
|
50
|
-
"pelias-model": "^9.
|
|
49
|
+
"pelias-model": "^9.2.0",
|
|
51
50
|
"pelias-wof-admin-lookup": "^7.4.1",
|
|
52
51
|
"through2": "^3.0.0",
|
|
53
52
|
"through2-sink": "^1.0.0"
|
package/stream/tag_mapper.js
CHANGED
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
const _ = require('lodash');
|
|
8
8
|
const through = require('through2');
|
|
9
|
-
const merge = require('merge');
|
|
10
9
|
const peliasLogger = require('pelias-logger').get('openstreetmap');
|
|
11
10
|
|
|
12
11
|
var LOCALIZED_NAME_KEYS = require('../config/localized_name_keys');
|
|
13
12
|
var NAME_SCHEMA = require('../schema/name_osm');
|
|
14
|
-
var ADDRESS_SCHEMA = merge(
|
|
13
|
+
var ADDRESS_SCHEMA = _.merge( {},
|
|
15
14
|
require('../schema/address_tiger'),
|
|
16
15
|
require('../schema/address_osm'),
|
|
17
16
|
require('../schema/address_naptan'),
|
|
@@ -62,7 +61,8 @@ module.exports = function(){
|
|
|
62
61
|
else if( _.has(ADDRESS_SCHEMA, key) ){
|
|
63
62
|
var val3 = trim( value );
|
|
64
63
|
if( val3 ){
|
|
65
|
-
|
|
64
|
+
let label = ADDRESS_SCHEMA[key];
|
|
65
|
+
doc.setAddress(label, normalizeAddressField(label, val3));
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
});
|
|
@@ -149,3 +149,20 @@ function getNameSuffix( tag ){
|
|
|
149
149
|
|
|
150
150
|
return suffix;
|
|
151
151
|
}
|
|
152
|
+
|
|
153
|
+
// apply some very basic normalization
|
|
154
|
+
// note: in the future we should consider doing something more advanced like:
|
|
155
|
+
// https://github.com/pelias/openaddresses/pull/477
|
|
156
|
+
function normalizeAddressField(key, value) {
|
|
157
|
+
if (key === 'street') {
|
|
158
|
+
|
|
159
|
+
// contract English diagonals
|
|
160
|
+
value = value
|
|
161
|
+
.replace(/\b(northwest)\b/i, 'NW')
|
|
162
|
+
.replace(/\b(northeast)\b/i, 'NE')
|
|
163
|
+
.replace(/\b(southwest)\b/i, 'SW')
|
|
164
|
+
.replace(/\b(southeast)\b/i, 'SE');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return value;
|
|
168
|
+
}
|
package/.circleci/config.yml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
jobs:
|
|
3
|
-
build:
|
|
4
|
-
working_directory: /app
|
|
5
|
-
docker:
|
|
6
|
-
- image: docker:18.06.1-ce-git
|
|
7
|
-
steps:
|
|
8
|
-
- checkout
|
|
9
|
-
- setup_remote_docker
|
|
10
|
-
- run:
|
|
11
|
-
name: Build and push image to Docker Hub
|
|
12
|
-
command: apk --no-cache add curl bash && curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash -
|