Comments (5)
I was going to open a similar issue :-)
I've jotted some notes down below however progressing this is not a priority for me, I'm putting my time into adding support for reverse_geocoder/reverse_geocode (offline) - longer term (and possibly a research path that may be worth checkout out), checkout https://github.com/geopy/geopy it supports MapQuest and a lot of other providers. I've not used it so can't vouch for it other than a cursory read.
reverse_geocoder/reverse_geocode with my minimal testing is looking suitable, I need to crunch it through my photos to see if it actually is suitable for my use case 🤞
NOTES:
- MapQuest base URL has changed
- actual url has changed (no php)
- arguments have changed
- payload has changed and parse_result() has no idea
URL and api change
old sample
new sample
Payload change
parse (etc.) are expecting a dict like (note mappings in comments):
{
'address': {
'default': u'California',
'country': u'United States of America', # MapQuest field: ["results"]["locations"][0]["adminArea1"] "US"
'state': u'California', # MapQuest field: ["results"]["locations"][0]["adminArea3"] "CA"
'city': u'Sunnyvale' # MapQuest field: ["results"]["locations"][0]["adminArea5"] "Sunnyvale"
}
}
Current mapquest payload looks more like:
{
"info": {
"statuscode": 0,
"copyright": {
"text": "© 2022 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2022 MapQuest, Inc."
},
"messages": []
},
"options": {
"maxResults": 1,
"ignoreLatLngInput": false
},
"results": [
{
"providedLocation": {
"latLng": {
"lat": 37.368,
"lng": -122.03
}
},
"locations": [
{
"street": "312 Old San Francisco Rd",
"adminArea6": "Heritage District",
"adminArea6Type": "Neighborhood",
"adminArea5": "Sunnyvale",
"adminArea5Type": "City",
"adminArea4": "Santa Clara",
"adminArea4Type": "County",
"adminArea3": "CA",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "94086",
"geocodeQualityCode": "P1AAA",
"geocodeQuality": "POINT",
"dragPoint": false,
"sideOfStreet": "R",
"linkId": "0",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 37.36798,
"lng": -122.03018
},
"displayLatLng": {
"lat": 37.36785,
"lng": -122.03021
},
"mapUrl": ""
}
]
}
]
}
from elodie.
payload has changed and parse_result() has no idea
🤣 That's the quick conclusion that I came to. I believe the fix should be isolated though.
from elodie.
Documenting some inconsistencies with the MapQuest API and how to detect errors.
['info']['statuscode'] != 0
means an error (docs).['options']['maxResults'] == -1
means Not Found (I think). And the case is not consistent betweenstatuscode
andmaxResults
.- However, it does not mean that
['results']
or['results']['locations']
have a length of0
.
- However, it does not mean that
Edit: I'm not sure what maxResults == -1
means but it DOES NOT mean Not Found. I also believe the following is true: the data itself has changed (i.e. lat/lon for Sunnyvale, CA is different now and CA is returned instead of California.
from elodie.
I created branch mapquest-fix to stage my work so far which can be tracked in gh-426.
from elodie.
Took a break and came back with a much simpler change to get it working. @clach04 thanks for the comment - it got me thinking differently about the fix.
from elodie.
Related Issues (20)
- api key generation fails HOT 3
- keywords based dynamic albums HOT 1
- imghdr going away
- Crash on text file NOT containing us-ascii or utf-8 in first line
- feature: able to create symlinks instead of copying
- Calculate checksum of image without EXIF-data
- Unknown Location - invalid AppKey HOT 14
- Support a time offset in addition to absolute time
- ISO 8601 datetime without capitalising the rest of the filename? HOT 1
- Dockerfile no longer resolves to a valid url for Exiftool download
- Dockerfile no longer works with debian:jessie as the base
- Unexpected int returned instead of string from metadata[part] in filesystem.py HOT 1
- Will there be an official Elodie docker image published on the cloud (ie not the Dockerfile) ?
- Elodie not recognizing videos with the .mkv file extension HOT 2
- Feature request: support for NRW and RAF files HOT 1
- config.ini ignored HOT 5
- Hard to tell what the problem is when there's errors importing files HOT 7
- Need to add a test: adding a file which is already in destination
- CircleCI URL for exiftool returns 404
- Use local database for geolocation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elodie.