Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message for "ggeocode" #22

Open
yichenx opened this issue Jun 8, 2017 · 13 comments
Open

error message for "ggeocode" #22

yichenx opened this issue Jun 8, 2017 · 13 comments
Assignees
Labels

Comments

@yichenx
Copy link

yichenx commented Jun 8, 2017

I'm trying to geocode some addresses.
DO.txt

But the code stops working and gives the following error.

java.lang.NoSuchMethodError: org.paces.Stata.MetaData.Meta.getStataobs()Lorg/paces/Stata/Observations/Observations; at org.paces.Stata.Google.DataRetrieval.<init>(DataRetrieval.java:39) at org.paces.Stata.Google.Google.geocode(Google.java:26)
I doublechecked with the sample code and stata returns same error.

do2.txt

Thanks!

@wbuchanan wbuchanan self-assigned this Jun 9, 2017
@wbuchanan wbuchanan added the bug label Jun 9, 2017
@wbuchanan
Copy link
Owner

@yichenx
I think this is related to a dependency update that I made. I'll try to see if I can patch this over the weekend. I'd expect everyone will need to update this a bit more as I modify one of the underlying dependent libraries (StataJavaUtilities), but my longer term plan is to have that library get installed separately to avoid any classpath issues like what happened in one of the other recent tickets.

In the mean time, you could use jsonio rv to make the requests to the API and return a single record with the associated metadata included in the variable labels.

@yichenx
Copy link
Author

yichenx commented Jun 11, 2017

Thank you!

@wbuchanan
Copy link
Owner

@yichenx

I got bogged down with work this weekend, but haven't forgot about looking into this. I don't think it will be a difficult fix and just wanted to keep you in the loop.

@wbuchanan
Copy link
Owner

@yichenx

I tried last night using the examples in the help file and didn't get the error. Can you see if you can reproduce the error if you use those examples? Type help ggeocode to see the examples I'm referencing. There are some fields that may not always populate, but I was able to get the latitude and longitude values for each of the examples as well as the other values using the optional arguments.

@wbuchanan
Copy link
Owner

Also if you have brewscheme installed on your machine, you'll want to update that :

ado, find(brewscheme)
ado uninstall [#]
net install brewscheme, from(http://wbuchanan.github.io/brewscheme)

There is a dependency issue with the older versions of brewscheme. I'm going to end up decoupling some of that stuff in the not too distant future, but this would be a way to solve the problem if it is a dependency issue.

@yichenx
Copy link
Author

yichenx commented Jun 12, 2017

I followed your instruction but somehow I ran into the same error message. Here's the error message when I ran the example codes:

java.lang.NoSuchMethodError:
org.paces.Stata.MetaData.Meta.getStataobs()Lorg/paces/Stata/Observations/Observations;
at org.paces.Stata.Google.DataRetrieval.(DataRetrieval.java:39)
at org.paces.Stata.Google.Google.geocode(Google.java:26)

When I tried to update brewscheme, I got two package number. Is that normal?
ado, find(brewscheme)

[22] package brewscheme from http://wbuchanan.github.io/brewscheme
'BREWSCHEME': a toolkit for data visualizations in Stata.
[23] package brewscheme from http://wbuchanan.github.io/brewscheme
'BREWSCHEME': a toolkit for data visualizations in Stata.

Thanks a lot for your help.

@wbuchanan
Copy link
Owner

So you should:

ado uninstall [23]
ado uninstall [22]
net inst brewscheme, from(http://wbuchanan.github.io/brewscheme)

This is likely an issue with the Java classpath and one of the plugins used in older versions of brewscheme relying on a slightly earlier version of StataJavaUtilities.

@yichenx
Copy link
Author

yichenx commented Jun 12, 2017

Yes. I did run the above code. The error message was after I install the new brewscheme:

java.lang.NoSuchMethodError:
org.paces.Stata.MetaData.Meta.getStataobs()Lorg/paces/Stata/Observations/Observations;
at org.paces.Stata.Google.DataRetrieval.(DataRetrieval.java:39)
at org.paces.Stata.Google.Google.geocode(Google.java:26)

@wbuchanan
Copy link
Owner

@yichenx
Ok thanks for the info. I'll try to look into this during the week at some point. Shouldn't be too difficult of a change to find/make.

@yichenx
Copy link
Author

yichenx commented Jun 12, 2017

@wbuchanan Thanks a lot!

@wbuchanan
Copy link
Owner

@yichenx
Can you copy/paste the code from the file above into one of the comments? I keep losing track of the file and having to download it again and am trying to keep my file system from getting too cluttered.

@yichenx
Copy link
Author

yichenx commented Jul 12, 2017

Sure. @wbuchanan

local maxid1 = 468
local maxid2 = 1176
forvalues x=1/2{
clear all
display x' forvalues i=1/maxidx'' { use temp\geocodex'.dta, clear
keep if id==i' ggeocode address, ret(viewport address bbox) save temp\geocodex'_`i'.dta, replace
}
}

@wbuchanan
Copy link
Owner

@yichenx
The example code you have above is not valid Stata code. That said, you'll want to obtain an API key from Google to use ggeocode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants