Giter Club home page Giter Club logo

Comments (3)

jmathai avatar jmathai commented on May 29, 2024

I haven't generated one in years as my original one still works. If you hear back from MapQuest support then please update this bug.

from elodie.

clach04 avatar clach04 commented on May 29, 2024

@amit-handa I had a similar experience, keep trying ;-)

In the meantime, a lower quality solution is to hack in local geo lookup, using reverse_geocoder - https://github.com/thampiman/reverse-geocoder

Hack elodie/geolocation.py

to add

import reverse_geocoder

Then replace lookup() - or simply add an additional function to replace the existing one (you can monkey patch this too):

def lookup_hardcoded_reverse_geocoder(**kwargs):
    if(
        'location' not in kwargs and
        'lat' not in kwargs and
        'lon' not in kwargs
    ):
        return None
    if 'location' in kwargs:
        raise NotImplemented()
    coordinates = [(kwargs['lat'], kwargs['lon'])]
    #results = reverse_geocoder.search(coordinates)
    results = reverse_geocoder.search(coordinates, mode=1)  # non-parrellel mode, avoid multiprocessing RuntimeError fork error(s)
    result = {
        'address': {
            'country': results[0]['cc'],
            'state': results[0]['admin1'],  # potentiall could do 'admin2' - for US lookup of (37.368, -122.03) not recommended
            'default': results[0]['admin1'],  # potentiall could do 'admin2' - for US lookup of (37.368, -122.03) not recommended
            'city': results[0]['name'],
        }
    }
    return result


# hack
lookup = lookup_hardcoded_reverse_geocoder

from elodie.

amit-handa avatar amit-handa commented on May 29, 2024

Thanks for responding.
mapquest support is responsive (thank god !). I was able to get the key, had to recreate the account.

root cause is to use https://developer.mapquest.com rather than http://.. version. latter is obsolete (not sure why they still expose it though, but I aint complaining for anything I get free)

from elodie.

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.