From fd21b0047fd526d87b92c4748a62c571d55fb4ae Mon Sep 17 00:00:00 2001 From: Ariel Date: Mon, 18 Mar 2019 12:38:40 -0500 Subject: [PATCH] Added jamaica --- projects/jamaica/.env | 3 + projects/jamaica/README.md | 36 +++++ projects/jamaica/blacklist/osm.txt | 0 projects/jamaica/docker-compose.yml | 127 ++++++++++++++++ projects/jamaica/pelias.json | 74 ++++++++++ .../jamaica/test_cases/search_address.json | 135 ++++++++++++++++++ projects/jamaica/test_cases/search_venue.json | 47 ++++++ 7 files changed, 422 insertions(+) create mode 100644 projects/jamaica/.env create mode 100644 projects/jamaica/README.md create mode 100644 projects/jamaica/blacklist/osm.txt create mode 100644 projects/jamaica/docker-compose.yml create mode 100644 projects/jamaica/pelias.json create mode 100644 projects/jamaica/test_cases/search_address.json create mode 100644 projects/jamaica/test_cases/search_venue.json diff --git a/projects/jamaica/.env b/projects/jamaica/.env new file mode 100644 index 00000000..17bed0f1 --- /dev/null +++ b/projects/jamaica/.env @@ -0,0 +1,3 @@ +COMPOSE_PROJECT_NAME=peliasjamaica +DATA_DIR=/tmp/pelias/jamaica +DOCKER_USER=1000 diff --git a/projects/jamaica/README.md b/projects/jamaica/README.md new file mode 100644 index 00000000..cb98b969 --- /dev/null +++ b/projects/jamaica/README.md @@ -0,0 +1,36 @@ + +# Jamaica + +This project is configured to download/prepare/build a complete Pelias installation for the country of Jamaica. + +It's designed to be a larger example of using Pelias. + +# Setup + +Please refer to the instructions at https://github.com/pelias/docker in order to install and configure your docker environment. + +The minimum configuration required in order to run this project are [installing prerequisites](https://github.com/pelias/docker#prerequisites), [install the pelias command](https://github.com/pelias/docker#installing-the-pelias-command) and [configure the environment](https://github.com/pelias/docker#configure-environment). + +Please ensure that's all working fine before continuing. + +# Run a Build + +To run a complete build, execute the following commands: + +```bash +pelias compose pull +pelias elastic start +pelias elastic wait +pelias elastic create +pelias download all +pelias prepare all +pelias import all +pelias compose up +pelias test run +``` + +# Make an Example Query + +You can now make queries against your new Pelias build: + +http://localhost:4000/v1/search?text=kingston diff --git a/projects/jamaica/blacklist/osm.txt b/projects/jamaica/blacklist/osm.txt new file mode 100644 index 00000000..e69de29b diff --git a/projects/jamaica/docker-compose.yml b/projects/jamaica/docker-compose.yml new file mode 100644 index 00000000..b0b7586b --- /dev/null +++ b/projects/jamaica/docker-compose.yml @@ -0,0 +1,127 @@ +version: '3' +networks: + default: + driver: bridge +services: + libpostal: + image: pelias/libpostal-service + container_name: pelias_libpostal + user: "${DOCKER_USER}" + restart: always + ports: [ "4400:4400" ] + schema: + image: pelias/schema:master + container_name: pelias_schema + user: "${DOCKER_USER}" + volumes: + - "./pelias.json:/code/pelias.json" + api: + image: pelias/api:master + container_name: pelias_api + user: "${DOCKER_USER}" + restart: always + environment: [ "PORT=4000" ] + ports: [ "4000:4000" ] + volumes: + - "./pelias.json:/code/pelias.json" + placeholder: + image: pelias/placeholder:master + container_name: pelias_placeholder + user: "${DOCKER_USER}" + restart: always + environment: [ "PORT=4100" ] + ports: [ "4100:4100" ] + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + - "./blacklist/:/data/blacklist" + whosonfirst: + image: pelias/whosonfirst:master + container_name: pelias_whosonfirst + user: "${DOCKER_USER}" + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + - "./blacklist/:/data/blacklist" + openstreetmap: + image: pelias/openstreetmap:master + container_name: pelias_openstreetmap + user: "${DOCKER_USER}" + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + - "./blacklist/:/data/blacklist" + openaddresses: + image: pelias/openaddresses:master + container_name: pelias_openaddresses + user: "${DOCKER_USER}" + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + - "./blacklist/:/data/blacklist" + transit: + image: pelias/transit:master + container_name: pelias_transit + user: "${DOCKER_USER}" + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + csv-importer: + image: pelias/csv-importer:master + container_name: pelias_csv_importer + user: "${DOCKER_USER}" + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + - "./blacklist/:/data/blacklist" + polylines: + image: pelias/polylines:master + container_name: pelias_polylines + user: "${DOCKER_USER}" + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + interpolation: + image: pelias/interpolation:master + container_name: pelias_interpolation + user: "${DOCKER_USER}" + restart: always + environment: [ "PORT=4300" ] + ports: [ "4300:4300" ] + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + pip: + image: pelias/pip-service:master + container_name: pelias_pip-service + user: "${DOCKER_USER}" + restart: always + environment: [ "PORT=4200" ] + ports: [ "4200:4200" ] + volumes: + - "./pelias.json:/code/pelias.json" + - "${DATA_DIR}:/data" + elasticsearch: + image: pelias/elasticsearch:5.6.12 + container_name: pelias_elasticsearch + restart: always + ports: [ "9200:9200", "9300:9300" ] + volumes: + - "${DATA_DIR}/elasticsearch:/usr/share/elasticsearch/data" + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + cap_add: [ "IPC_LOCK" ] + fuzzy-tester: + image: pelias/fuzzy-tester:master + container_name: pelias_fuzzy_tester + user: "${DOCKER_USER}" + restart: "no" + command: "--help" + volumes: + - "./pelias.json:/code/pelias.json" + - "./test_cases:/code/pelias/fuzzy-tester/test_cases" diff --git a/projects/jamaica/pelias.json b/projects/jamaica/pelias.json new file mode 100644 index 00000000..fcb6f888 --- /dev/null +++ b/projects/jamaica/pelias.json @@ -0,0 +1,74 @@ +{ + "logger": { + "level": "info", + "timestamp": false + }, + "esclient": { + "apiVersion": "5.6", + "hosts": [ + { "host": "elasticsearch" } + ] + }, + "elasticsearch": { + "settings": { + "index": { + "refresh_interval": "10s", + "number_of_replicas": "0", + "number_of_shards": "3" + } + } + }, + "acceptance-tests": { + "endpoints": { + "docker": "http://api:4000/v1/" + } + }, + "api": { + "textAnalyzer": "libpostal", + "services": { + "placeholder": { "url": "http://placeholder:4100" }, + "pip": { "url": "http://pip:4200" }, + "interpolation": { "url": "http://interpolation:4300" }, + "libpostal": { "url": "http://libpostal:4400" } + } + }, + "imports": { + "adminLookup": { + "enabled": true + }, + "geonames": { + "datapath": "/data/geonames", + "countryCode": "AU" + }, + "openstreetmap": { + "download": [ + { "sourceURL": "http://download.geofabrik.de/central-america/jamaica-latest.osm.pbf" } + ], + "leveldbpath": "/tmp", + "datapath": "/data/openstreetmap", + "import": [{ + "filename": "jamaica-latest.osm.pbf" + }] + }, + "openaddresses": { + "datapath": "/data/openaddresses", + "files": [ + "jm/countrywide.csv" + ] + }, + "polyline": { + "datapath": "/data/polylines", + "files": [ "extract.0sv" ] + }, + "whosonfirst": { + "datapath": "/data/whosonfirst", + "importVenues": true, + "importPostalcodes": true, + "importPlace": [ + "85632215" + ] + }, + "interpolation": { + } + } +} diff --git a/projects/jamaica/test_cases/search_address.json b/projects/jamaica/test_cases/search_address.json new file mode 100644 index 00000000..6c9537df --- /dev/null +++ b/projects/jamaica/test_cases/search_address.json @@ -0,0 +1,135 @@ +{ + "name": "/v1/search address", + "description": "addresses in Jamaica", + "priorityThresh": 1, + "normalizers": { + "name": [ + "toUpperCase", + "removeOrdinals", + "stripPunctuation", + "abbreviateDirectionals", + "abbreviateStreetSuffixes" + ] + }, + "tests": [ + { + "id": 1, + "status": "pass", + "in": { + "text": "12 Ocean Blvd, kingston" + }, + "expected": { + "properties": [ + { + "street": "Ocean Boulevard", + "housenumber": "12", + "region": "Kingston St. John" + } + ] + } + }, + { + "id": 2, + "status": "pass", + "in": { + "text": "237 Old Hope Road" + }, + "expected": { + "properties": [ + { + "name": "237 Old Hope Road", + "housenumber": "237", + "region": "Saint Andrew", + "country": "Jamaica" + } + ] + } + }, + { + "id": 3, + "status": "pass", + "in": { + "text": "237 Old Hope Road" + }, + "expected": { + "properties": [ + { + "name": "237 Old Hope Road", + "housenumber": "237", + "region": "Saint Andrew" + } + ] + } + }, + { + "id": 4, + "status": "pass", + "in": { + "text": "Arthur Wint Drive" + }, + "expected": { + "properties": [ + { + "street": "Arthur Wint Drive", + "region": "Saint Andrew" + } + ] + } + }, +{ + "id": 5, + "status": "fail", + "in": { + "text": "16 1/2 Windward Road" + }, + "expected": { + "properties": [ + { + "housenumber": "16 1/2", + "street": "Windward Road", + "region": "Kingston St. John" + } + ] + } + }, + + + { + "id": 6, + "status": "pass", + "in": { + "text": "14a Shenstone Drive" + }, + "expected": { + "properties": [ + { + "name": "14 Shenstone Drive", + "street": "Shenstone Drive", + "housenumber": "14", + "region": "Saint Andrew" + } + ] + } + }, + { + "id": 7, + "status": "fail", + "in": { + "text": "54 Lyssons Road" + }, + "expected": { + "properties": [ + { + "name": "54 Lyssons Road", + "street": "Lyssons Road", + "housenumber": "54", + "city": "Morant Bay", + "region": "Saint Thomas" + } + ] + } + } + + + ] +} diff --git a/projects/jamaica/test_cases/search_venue.json b/projects/jamaica/test_cases/search_venue.json new file mode 100644 index 00000000..a742f274 --- /dev/null +++ b/projects/jamaica/test_cases/search_venue.json @@ -0,0 +1,47 @@ +{ + "name": "/v1/search venues", + "priorityThresh": 1, + "endpoint": "search", + "tests": [ + { + "id": 1, + "status": "pass", + "notes": "norman manley international should come up for KIN", + "in": { + "text": "kin" + }, + "expected": { + "properties": [ + { + "layer": "venue", + "name": "Norman Manley International Airport", + "country_a": "JAM", + "country": "Jamaica", + "region": "Kingston St. John", + "region_a": "KI" + } + ] + } + }, + { + "id": 2, + "status": "pass", + "notes": "norman manley international should come up for KIN", + "in": { + "text": "kin airport" + }, + "expected": { + "properties": [ + { + "layer": "venue", + "name": "Norman Manley International Airport", + "country_a": "JAM", + "country": "Jamaica", + "region": "Kingston St. John", + "region_a": "KI" + } + ] + } + } + ] +}