geocoder-php / Geocoder

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

ID from Service Provider in Address Model #749

Closed arubacao closed 7 years ago

arubacao commented 7 years ago

Is there any chance on adding the original IDs from the service providers to the address model? I'm heavily relying on them and have to keep an almost identical fork of some providers since inheriting the final base classes is not possible.

Cheers, Chris

Nyholm commented 7 years ago

We have the Location::getProvidedBy(source) which is the same as Provider::getName. Isn't that what you are asking for?

arubacao commented 7 years ago

yes, I'm also using this method to distinguish between providers. But what I'm referring to in my question is the actual ID. So somewhere within the updateAddressComponent method I'd get the value from place_id and set it on address object

place_id is a unique identifier that can be used with other Google APIs. For example, you can use the place_id in a Google Places API request to get details of a local business, such as phone number, opening hours, user reviews, and more. See the place ID overview.

Nyholm commented 7 years ago

Ah, on the GoogleMaps provider. Of course, we should definitely extend Google Maps' address object with a place ID.

I would be happy to review and merge such PR.

arubacao commented 7 years ago

Consider it done

arubacao commented 7 years ago

Do you think it would make sense to add an ID property to the Geocoder\Model\Address class? I guess most (maybe all ?) providers provide some sort of identification.