geocoder-php / Geocoder

The most featured Geocoder library written in PHP.
https://geocoder-php.org
MIT License
3.94k stars 516 forks source link

[Nominatim] Fix enotices #995

Closed eileenmcnaughton closed 4 years ago

eileenmcnaughton commented 4 years ago

Current code expects osm_id & osm_type to be defined. However when I ran it with just a postcode they were not defined & I got an enotice - ie

this url https://nominatim.openstreetmap.org/search/search?format=jsonv2&q=90210%2CUnited+States&addressdetails=1&limit=5

Gave me this

[
  {
    "place_id": 200404707,
    "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
    "boundingbox": [
      "34.085763939939",
      "34.085863939939",
      "-118.2905153602",
      "-118.2904153602"
    ],
    "lat": "34.0858139399386",
    "lon": "-118.290465360203",
    "display_name": "Los Angeles, California, 90210, United States of America",
    "place_rank": 21,
    "category": "place",
    "type": "postcode",
    "importance": 0.535,
    "address": {
      "city": "Los Angeles",
      "state": "California",
      "postcode": "90210",
      "country": "United States of America",
      "country_code": "us"
    }
  }
]
eileenmcnaughton commented 4 years ago

Hi I'm probably not up for writing a test - this is pretty tangental to what I'm working on & I addressed it in our code just by altering our test data (since it was a test failing in a use case that wasn't important to us). I just did the PR through the github UI

jbelien commented 4 years ago

Superseded by #997.