pelias / docker

Run the Pelias geocoder in docker containers, including example projects.
MIT License
315 stars 218 forks source link

Adding São Paulo city project #256

Open feromes opened 3 years ago

feromes commented 3 years ago

Hi,

First of all, I'd like to congratulate you guys who drive this project as it is. It's incredible job.

I am working on a Pelias instance for São Paulo City and would like to share with you.

Actually, we have a test version running (http://geocodesampa.ddns.net/) and making a lot of improvement and new data sources every week.

We recently pulled 3,5 million Address on OpenAddresses and waiting for them to update our Pelias

Thanks,

missinglink commented 3 years ago

Very nice thanks @feromes

missinglink commented 2 years ago

Is this ready to be merged?

feromes commented 2 years ago

I am improving synonyms, because I've realized it's not working properly just changing the custom_*.txt files. I am gonna work on int next days and I'll update this pull request

erdmanncross commented 2 years ago

@feromes @missinglink did the synonyms work for you? I have a problem with this, I did the same as your pr but it doesn't respond correctly with the synonyms. /v1/search?text=BRIG. FARIA LIMA 3732+SAo Paulo+SP+04538132+BRA&lang=pt-br&size=1

{
  "geocoding": {
    "version": "0.2",
    "attribution": "http://10.129.33.122:4000/attribution",
    "query": {
      "text": "BRIG. FARIA LIMA 3732 SAo Paulo SP 04538132 BRA",
      "size": 1,
      "private": false,
      "lang": {
        "name": "Portuguese",
        "iso6391": "pt",
        "iso6393": "por",
        "via": "querystring",
        "defaulted": false
      },
      "querySize": 20,
      "parser": "libpostal",
      "parsed_text": {
        "street": "brig. faria lima",
        "housenumber": "3732",
        "city": "sao paulo",
        "state": "sp",
        "postalcode": "04538132",
        "country": "bra"
      }
    },
    "engine": {
      "name": "Pelias",
      "author": "Mapzen",
      "version": "1.0"
    },
    "timestamp": 1631110754181
  },
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -46.663713,
          -23.570533
        ]
      },
      "properties": {
        "id": "101965533",
        "gid": "whosonfirst:locality:101965533",
        "layer": "locality",
        "source": "whosonfirst",
        "source_id": "101965533",
        "country_code": "BR",
        "name": "São Paulo",
        "confidence": 0.6,
        "match_type": "fallback",
        "accuracy": "centroid",
        "country": "Brasil",
        "country_gid": "whosonfirst:country:85633009",
        "country_a": "BRA",
        "macroregion": "Sudeste",
        "macroregion_gid": "whosonfirst:macroregion:1511777411",
        "region": "São Paulo",
        "region_gid": "whosonfirst:region:85682041",
        "region_a": "SP",
        "county": "São Paulo",
        "county_gid": "whosonfirst:county:102062255",
        "localadmin": "Jardim Paulista",
        "localadmin_gid": "whosonfirst:localadmin:404567359",
        "locality": "São Paulo",
        "locality_gid": "whosonfirst:locality:101965533",
        "label": "São Paulo, Brasil"
      },
      "bbox": [
        -46.826199,
        -24.008431,
        -46.365084,
        -23.356293
      ]
    }
  ],
  "bbox": [
    -46.826199,
    -24.008431,
    -46.365084,
    -23.356293
  ]
}

/v1/search?text=FARIA%20LIMA%203732+SAo%20Paulo+SP+04538132+BRA&lang=pt-br&size=1

{
  "geocoding": {
    "version": "0.2",
    "attribution": "http://10.129.33.122:4000/attribution",
    "query": {
      "text": "FARIA LIMA 3732 SAo Paulo SP 04538132 BRA",
      "size": 1,
      "private": false,
      "lang": {
        "name": "Portuguese",
        "iso6391": "pt",
        "iso6393": "por",
        "via": "querystring",
        "defaulted": false
      },
      "querySize": 20,
      "parser": "libpostal",
      "parsed_text": {
        "street": "faria lima",
        "housenumber": "3732",
        "city": "sao paulo",
        "state": "sp",
        "postalcode": "04538132",
        "country": "bra"
      }
    },
    "engine": {
      "name": "Pelias",
      "author": "Mapzen",
      "version": "1.0"
    },
    "timestamp": 1631110847222
  },
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -46.6817064,
          -23.5893038
        ]
      },
      "properties": {
        "id": "polyline:511979",
        "gid": "mixed:address:polyline:511979",
        "layer": "address",
        "source": "mixed",
        "source_id": "polyline:511979",
        "country_code": "BR",
        "name": "Avenida Brigadeiro Faria Lima 3732",
        "housenumber": "3732",
        "street": "Avenida Brigadeiro Faria Lima",
        "confidence": 0.8,
        "match_type": "interpolated",
        "accuracy": "point",
        "country": "Brasil",
        "country_gid": "whosonfirst:country:85633009",
        "country_a": "BRA",
        "macroregion": "Sudeste",
        "macroregion_gid": "whosonfirst:macroregion:1511777411",
        "region": "São Paulo",
        "region_gid": "whosonfirst:region:85682041",
        "region_a": "SP",
        "county": "São Paulo",
        "county_gid": "whosonfirst:county:102062255",
        "localadmin": "Jardim Paulista",
        "localadmin_gid": "whosonfirst:localadmin:404567359",
        "locality": "São Paulo",
        "locality_gid": "whosonfirst:locality:101965533",
        "neighbourhood": "Itaim Bibi",
        "neighbourhood_gid": "whosonfirst:neighbourhood:85766041",
        "label": "Avenida Brigadeiro Faria Lima 3732, São Paulo, Brasil"
      }
    }
  ],
  "bbox": [
    -46.6817064,
    -23.5893038,
    -46.6817064,
    -23.5893038
  ]
}
missinglink commented 2 years ago

Synonyms are applied at index-time, so they will require a full re-index. Did you drop and recreate the elasticsearch index?

feromes commented 2 years ago

Hi @erdmanncross,

Yes, it did! But I need to mount the volume on docker-compose.yml addressing your custom_street.txt on it like that:

...
  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
...

Take a look at our version of docker-compose https://github.com/geoinfo-smdu/pelias-docker/blob/master/projects/sao-paulo-city/docker-compose.yml

See you,

erdmanncross commented 2 years ago

Synonyms are applied at index-time, so they will require a full re-index. Did you drop and recreate the elasticsearch index?

@feromes yes, I added custom_streets to the dockerfile @missinglink now I understood why it wasn't working, I didn't recreate the indexes. I will do this and test again

tks guys.

missinglink commented 12 months ago

Hi, is this ready to merge?