geocoder-php / Geocoder

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

type "premise" missing in google-maps-provider #715

Closed nigam214 closed 7 years ago

nigam214 commented 7 years ago

Issues in address parsing from Google Map API https://github.com/geocoder-php/google-maps-provider

Missing Type: "types" : [ "premise" ]

Example: https://maps.googleapis.com/maps/api/geocode/json?address=28.6105873,77.3885597

Nyholm commented 7 years ago

Oh. I thought we did. Can you create a PR with a test and fix for this? Make the PR to this repo

svrdlic commented 7 years ago

Earlier this month we added 'subpremise', not 'premise' :)

Nyholm commented 7 years ago

Ah, okey. We should add premise as well.

svrdlic commented 7 years ago

And I could fix this one also, if nobody replays

svrdlic commented 7 years ago

Why dont we add all parameters from google map replay? https://developers.google.com/maps/documentation/geocoding/intro#Types

Maybe we can add them to the dynamic array, that @Nyholm added instead of dynamic parameters?

Nyholm commented 7 years ago

Feel free to do so =)

nigam214 commented 7 years ago

@svrdlic please go ahead. sorry, couldn't able to reply earlier.

nigam214 commented 7 years ago

we can consider adding "formatted_address" as well. in my project, I wanted to get the formatted address of given lat/long and encounter your library and these missing components. as @svrdlic suggested, adding all address parameters could be a better option.

svrdlic commented 7 years ago

@nigam214 "formatted_address" is already added, I think. I hope that I'll be able to create PR until tomorrow.

nigam214 commented 7 years ago

@svrdlic saw the "formatted_address" in the code. thank you for pointing it out.

https://github.com/geocoder-php/google-maps-provider/blob/master/GoogleMaps.php#L264-L266

svrdlic commented 7 years ago

@Nyholm I have a problem with tests. I created new test in src/Provider/GoogleMaps/Tests/GoogleMapsTest.php, and when I run it, it says that functions that I added to GoogleAddress.php doesn't exit. Is it possible that it looks for those functions in vendor/geocoder-php/google-maps-provider?

Nyholm commented 7 years ago

Please submit a PR so we can see your work.

svrdlic commented 7 years ago

ok

aditya-cherukuri commented 7 years ago

I see there is work being done on this issue. Is it going to be part of the 4.x release or will it be a 3.3.1 release?

Nyholm commented 7 years ago

It is going to be a part of 4.x and released at the end of the month. There are no good way of making this work with the 3.3.x branch. That is one of the reasons we need a new release.

Nyholm commented 7 years ago

Closed by #732