Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding São Paulo city project #256

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Utilizando-o-Pelias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Utilizando o Pelias

15 changes: 10 additions & 5 deletions common/preview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.9.4/leaflet-geocoder-mapzen.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.9.4/leaflet-geocoder-mapzen.js"></script>
<style>
#map{ height: 800px; }
html, body, #map {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<div id="map"></div>

<script>
var map = L.map('map', {
center:[42.35, -71.08],
zoom: 3,
minZoom:2,
scrollWheelZoom: false
center:[-23.54514, -46.63584],
zoom: 12,
minZoom:10,
scrollWheelZoom: true
});

var geocodingOptions = {
Expand Down
2 changes: 0 additions & 2 deletions projects/portland-metro/.env

This file was deleted.

2 changes: 2 additions & 0 deletions projects/sao-paulo-city/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
COMPOSE_PROJECT_NAME=pelias
DATA_DIR=./data
36 changes: 36 additions & 0 deletions projects/sao-paulo-city/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# City of São Paulo

This project is configured to download/prepare/build a complete Pelias installation for São Paulo city in Brazil.

GeoSampa is the official GeoPortal of the municipality of São Paulo city, maintained by the Coordination of Production and Information Analysis (GeoInfo) of the Municipal Department of Urbanism and Licensing and is in process of implemention a Pelias server. A test version is accessible on the link http://geocodesampa.ddns.net/

# 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, for example searching for MASP (Museu de Arte de São Paulo):

http://localhost:4000/v1/search?text=MASP
Empty file.
129 changes: 129 additions & 0 deletions projects/sao-paulo-city/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
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"
- "./synonyms/custom_street.txt:/code/pelias/schema/synonyms/custom_street.txt"
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:7.5.1
container_name: pelias_elasticsearch
user: "${DOCKER_USER}"
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"
84 changes: 84 additions & 0 deletions projects/sao-paulo-city/pelias.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"logger": {
"level": "info",
"timestamp": false
},
"esclient": {
"apiVersion": "7.5",
"hosts": [
{ "host": "elasticsearch" }
]
},
"elasticsearch": {
"settings": {
"index": {
"refresh_interval": "10s",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
},
"acceptance-tests": {
"endpoints": {
"docker": "http://api:4000/v1/"
}
},
"api": {
"services": {
"placeholder": { "url": "http://placeholder:4100" },
"pip": { "url": "http://pip:4200" },
"interpolation": { "url": "http://interpolation:4300" },
"libpostal": { "url": "http://libpostal:4400" }
},
"defaultParameters": {
"focus.point.lat": -23.54549,
"focus.point.lon": -46.63524
}
},
"imports": {
"adminLookup": {
"enabled": false
},
"blacklist": {
"files": [
"/data/blacklist/osm.txt"
]
},
"geonames": {
"datapath": "/data/geonames",
"countryCode": "BR"
},
"openstreetmap": {
"download": [
{ "sourceURL": "https://export.hotosm.org/downloads/1d986dfc-7a88-46c6-97fb-860dc725b51f/S%C3%A3o_Paulo_Municipality.osm.pbf" }
],
"leveldbpath": "/tmp",
"datapath": "/data/openstreetmap",
"import": [{
"filename": "S%C3%A3o_Paulo_Municipality.osm.pbf"
}]
},
"openaddresses": {
"datapath": "/data/openaddresses",
"files": [
"br/sp/sao-paulo.csv"
]
},
"polyline": {
"datapath": "/data/polylines",
"files": [ "extract.0sv" ]
},
"whosonfirst": {
"datapath": "/data/whosonfirst",
"importPostalcodes": true,
"countryCode": "BR",
"importPlace": [
"102062255"
]
},
"csv": {
"datapath": "/data/csv",
"files": ["sao-paulo.csv"]
}
}
}
41 changes: 41 additions & 0 deletions projects/sao-paulo-city/synonyms/custom_street.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
av,avenida,avn
rua,r
alameda,al
vila,vl,vla
de,d,di,do,de,da
praça,praca,pca,pça
general,gal,gnr,genrl
são,sao,s,san
pais,paes
morais,moraes,mourais,mouraes
doutor,dr, doutora, dra
José, Jose, Joze, Jozé
tv, travessa, travs
maria, m
santo, st, santa, sta
alves, alvez
eng, engenheiro
luiz, luis
lucas, luccas
brigadeiro, brig, brg
campos, cps
junior, jr, jn
ministro, ministra, min
franco, fco
senador, senadora, sen
marechal, mal
major, maj
cesar, cezar
artur, arthur
desembargador, desemb
porto, prt, prto
conde, cd
comandante, cmdte, cmd
tenente, ten
nossa, nsa, nssa
novo, nova, nv, nvo, nva
nosso, nso
dona, dna
advogado, adv
arquiteto, arquiteta, arq
jornalista, jorn
35 changes: 35 additions & 0 deletions projects/sao-paulo-city/test_cases/libpostal_quirks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "/v1/search address",
"description": "addresses in Portland, OR",
"priorityThresh": 1,
"normalizers": {
"name": [
"toUpperCase",
"removeOrdinals",
"stripPunctuation",
"abbreviateDirectionals",
"abbreviateStreetSuffixes"
]
},
"tests": [
{
"id": 1,
"status": "pass",
"in": {
"text": "4004 SW Beaverton-Hillsdale, Portland"
},
"issue": "https://github.com/OpenTransitTools/trimet-mod-pelias/issues/20",
"description": "libpostal does not handle street directionals in some cases",
"expected": {
"properties": [
{
"name": "4004 SW Beaverton Hillsdale Hwy",
"locality": "Portland",
"region": "Oregon",
"region_a": "OR"
}
]
}
}
]
}
Loading