Code Monkey home page Code Monkey logo

Comments (4)

jbelien avatar jbelien commented on June 20, 2024 1

A PR (#1174) is ready that should solve this issue!

{
   "results" : [
      {
         "address_components" : [
            ...
            {
               "long_name" : "Wayaux",
               "short_name" : "Wayaux",
               "types" : [ "political", "sublocality", "sublocality_level_1" ]
            },
            {
               "long_name" : "Les Bons Villers",
               "short_name" : "Les Bons Villers",
               "types" : [ "political", "sublocality", "sublocality_level_1" ]
            },,
            ...
         ],
         "formatted_address" : "Rue de Pont-à-Migneloux, 6210 Les Bons Villers, Belgique",
         ...
      }
   ],
   "status" : "OK"
}

In this case, it will combine the 2 sublocality_level_1 and return Wayaux / Les Bons Villers as SubLocality Level 1 (see tests).

from geocoder.

guitoon avatar guitoon commented on June 20, 2024

Nice, thank you

from geocoder.

jbelien avatar jbelien commented on June 20, 2024

Released: https://packagist.org/packages/geocoder-php/google-maps-provider#4.7.1

from geocoder.

Stalinko avatar Stalinko commented on June 20, 2024

hey guys
this bug is still hapenning.

Just try to reverse these coordinates:

        $lat = 22.63376;
        $lng = 88.4147;

It will throw Geocoder\Exception\InvalidArgument "Administrative level 3 is defined twice".

Because the address JSON contains:

            {
               "long_name" : "NDDM Ward No - 26",
               "short_name" : "NDDM Ward No - 26",
               "types" : 
               [
                  "administrative_area_level_3",
                  "political"
               ]
            },
            {
               "long_name" : "North 24 Parganas",
               "short_name" : "North 24 Parganas",
               "types" : 
               [
                  "administrative_area_level_3",
                  "political"
               ]
            },

And your fix doesn't help. Because the exception is thrown before withSubLocalityLevels() call.
Any ideas how to fix it?

UPD in my local fork I've just removed this exception: lumiform/geocoder-php-common@2ce26bd

It causes that the duplicate levels are ignored.

from geocoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.