nchaulet / node-geocoder

nodejs geocoding library
http://nchaulet.github.io/node-geocoder/
MIT License
931 stars 213 forks source link

minConfidence is not honored #170

Closed cdaringe closed 8 years ago

cdaringe commented 8 years ago

hello:

it appears that on the latest build (3.9.2), minConfidence is not honored.

i execute:

    geodata = await geocoder.geocode({
      address: address.addressLine1,
      country: address.country,
      zipcode: address.zip,
      minConfidence: 0.92,
      limit: 1
    })
> address
{ addressLine1: '234 bananas',
  city: 'ALBUQUERQUE',
  addressLine2: '',
  zip: '87102',
  state: 'NM' }

> geodata[0]
{ formattedAddress: 'Bananas, Ambato EC180101, Ecuador',
  latitude: -1.2485661,
  longitude: -78.6444497,
  extra:
   { googlePlaceId: 'ChIJ38E2luiB05ERVs_MOGJdHSY',
     confidence: 0.7, // <== !!
     premise: null,
     subpremise: null,
     neighborhood: 'Ficoa',
     establishment: null },
  administrativeLevels:
   { level2long: 'Cantón Ambato',
     level2short: 'Cantón Ambato',
     level1long: 'Tungurahua',
     level1short: 'Tungurahua' },
  streetName: 'Bananas',
  city: 'Ambato',
  country: 'Ecuador',
  countryCode: 'EC',
  zipcode: 'EC180101' }

i acknowledge that there's a mild discrepancy between my inputs and the inputs to geocoder. however, the critical ones are present, per my understanding.

thanks!

AddoSolutions commented 8 years ago

+1

nchaulet commented 8 years ago

wich geocoder are you using ?

cdaringe commented 8 years ago

sorry, i should have included that. v 3.9.2 w/ google [edit: that was included ^^]. is "google" the information you are seeking?

nchaulet commented 8 years ago

minConfidence was only implemented for opencage geocoder but I will fix it to be more generic and available for google geocoder this week.

cdaringe commented 8 years ago

@nchaulet... you rock! 👍

nchaulet commented 8 years ago

just published the v3.10.0 with the fix