Closed Krukarius closed 4 years ago
@Krukarius
We haven't yet written a geocoder for MapQuest. It isn't difficult, though. Could you please email me at s.anand@gramener.com? We can get on a call and figure it out.
I'm somewhat a newbie in GIS/geocoding so I wouldn't be much help on figuring it out, so I'll just follow your progress via update from git hub. Stay safe,
Ed
On Wed, Apr 29, 2020 at 9:24 AM S Anand notifications@github.com wrote:
@Krukarius https://github.com/Krukarius
We haven't yet written a geocoder for MapQuest. It isn't difficult, though. Could you please email me at s.anand@gramener.com? We can get on a call and figure it out.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gramener/geocode-excel/issues/3#issuecomment-621319311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2KEDXZUOVFWL6MU66NVNDRPBIEBANCNFSM4MP6TI5A .
The issue has been solved.
Since the VBA Excel debugger shows:
Dim loc As MSXML2.IXMLDOMElement
and states an error User-defined type not defined
It means, that the problem lies in the lack of a proper library.
In this event everyone, who use this tool in his own workbook must do the following steps:
Thanks a lot for sharing this, @Krukarius -- sorry I wasn't able to revert earlier.
Hi,
I would like to use your tool for Nominatim, OpenStreetMap Api.
I was trying to use your code, copying it from the source file, which looks like this:
Function NominatimGeocode(address As String) As String Application.Caller.Font.ColorIndex = xlNone Dim xDoc As New MSXML2.DOMDocument xDoc.async = False xDoc.Load ("https://nominatim.openstreetmap.org/search?format=xml&q=" + address) If xDoc.parseError.ErrorCode <> 0 Then Application.Caller.Font.ColorIndex = vbErr NominatimGeocode = xDoc.parseError.reason Else xDoc.SetProperty "SelectionLanguage", "XPath" Dim loc As MSXML2.IXMLDOMElement Set loc = xDoc.SelectSingleNode("/searchresults/place") If loc Is Nothing Then Application.Caller.Font.ColorIndex = vbErr NominatimGeocode = xDoc.XML Else Application.Caller.Font.ColorIndex = vbOK NominatimGeocode = loc.getAttribute("lat") & "," & loc.getAttribute("lon") End If End If End Function
but after typing the formula into my Excel document: =nominatimGeocode(AA2) I am getting an error: **Compile error
User-defined type not defined**
I came to consultation, that you used your own API key, so it might cause the problem. I set up my own API key on the Mapquest.com, and receive it.
Now I don't know, where to place it. I superseded the line:
Dim loc As MSXML2.IXMLDOMElement
, which was indicated by the VBA excel debugger. I put my API key like this: Dim loc As (myAPI). Unfortunately now, the debugger points the same line, and error says Syntax error.Could you help me to sort it out?
Thank you in advance,