Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Geocode3- no longer available?

    Hello,

    I am trying to install geocode3 (I understand that geocode has been replaced with its up-to-date version).

    However, I get the following error message after typing "findit geocode3":

    "file http://fmwww.bc.edu/RePEc/bocode/g/geocode3.pkg not found
    could not load geocode3.pkg from http://fmwww.bc.edu/RePEc/bocode/g/
    r(601)";

    It seems like geocode3 is no longer available. Is there an alternative way of installing it? Am I missing something?

    Thank you,

    Pierpaolo


  • #2
    There is no geocode3 package currently downloadable on SSC. I'd ask the program authors why.

    Comment


    • #3
      Thanks.
      It would be very useful to know is someone could share the .ado file and/or if the command is still working.

      Pierpaolo

      Comment


      • #4
        What locations are you attempting to geocode? If all your addresses are in the U.S., you can build out an instance of the PostGIS Tiger Geocoder without too much pain. On my MacBook Pro (i7 quad core 2.9Ghz 16GB RAM) it takes about five minutes to query 1,000 addresses in California. In smaller states, the processing is much faster although I've not done any formal benchmarks. There are also people who've done the work to build out similar capabilities with the open street map database as well. If you have a more powerful box, I'd assume you could very easily get much better performance.

        Comment


        • #5
          Hi Pierpaolo,

          I've encountered a similar issue. Does anyone have or know of archived versions of the package that are still functioning? It would be a great help please!

          Rohan

          Comment


          • #6
            Rohan Thavarajah
            I have a backup copy from 04.04.2014, but until we know what's going on I don't think it is a good idea to spread it around. You need to contact the author Mr. Stefan Bernhard.
            You will find his address on this page: http://www.stata.com/statalist/archi.../msg00630.html
            Best, Sergiy Radyakin

            Comment


            • #7
              For anyone needing to use the Google geocoding API, I just added a program to the jsonio package for handling the API call and parsing the data (with options that allow you to return different parts of the payload of your choosing).

              Comment


              • #8
                Willilam, the current jsonio package looks to be circa 2015. Did you pull back the version that added ggeocode?

                Comment


                • #9
                  cammcdermaid

                  Code:
                  . net desc jsonio, from("http://wbuchanan.github.io/StataJSON/")
                  
                  ---------------------------------------------------------------------------------------------------------------------------------------------------------------
                  package jsonio from http://wbuchanan.github.io/StataJSON
                  ---------------------------------------------------------------------------------------------------------------------------------------------------------------
                  
                  TITLE
                        'JSONIO': A Stata plugin for IO operations involving JSON
                  
                  DESCRIPTION/AUTHOR(S)
                        
                        A program to serialize Stata datasets (in memory) to JSON.
                        Options are available to return the JSON object to the
                        console or to write the JSON object to disk.  The plugin
                        requires JRE 1.8 or later.
                        
                        KW: JSON
                        KW: IO
                        KW: export
                        KW: convert
                        KW: data transfer
                        
                        Requires: Stata version 14.1
                        
                        Distribution-Date: 20160212
                        
                        Author: Billy Buchanan
                                Data Scientist
                                Office of Research, Evaluation, and Assessment
                                Minneapolis Public Schools
                        
                        
                        Support: email William [dot] Buchanan @t mpls [dot] k12 [dot] mn [dot] us
                        
                  
                  INSTALLATION FILES                               (type net install jsonio)
                        ggeocode.ado
                        ggeocode.sthlp
                        jsonio.ado
                        jsonio.sthlp
                        jsonio.jar
                  ---------------------------------------------------------------------------------------------------------------------------------------------------------------
                  The -ggeocode- command is available from the development version of the package (see above). I've not had a ton of time to try working out/testing better ways to consistently flatten JSON into a two dimensional array just yet and haven't submitted the changes to the SSC because of that. But if you install it from the location above you should be good to go.

                  Comment


                  • #10
                    Hi Statalist,

                    I try to use -ggeocode- as suggested in help file, but there is error message.
                    Here is my sample:
                    Code:
                     clear
                    input float id str28 city str4 state str12 zip
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    1 "LITTLE RIVER" "SC" "29566" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087" 
                    2 "SPARTA" "GA" "31087"
                      end
                    And that is my code
                    Code:
                    ggeocode city state zip
                    That is the error
                    java.lang.NoClassDefFoundError: org/paces/Stata/Google/Google
                    Caused by: java.lang.ClassNotFoundException: org.paces.Stata.Google.Goo
                    > gle
                    at java.net.URLClassLoader$1.run(URLClassLoader.java: 372)
                    at java.net.URLClassLoader$1.run(URLClassLoader.java: 361)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:360)
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 24)
                    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 57)
                    r(5100);
                    My stata is v14 MP. My laptop is window 7 pro 64 bits, 8GB ram.

                    Could you fix what is my error?

                    Many thanks

                    Comment


                    • #11
                      David Tranv, there are a few different issues potentially at play. The first is that geocoding is used for point locations, not polygons. So, you would need a street address along with the city/state to get reasonable results. I haven't checked the Google API in a while but it might just return the centroids for these types of cases. The second thing that might help is restarting your Stata. The error that you're getting could indicate that you installed the package after the JVM had already been spun up, in which case the Java binary wouldn't be found on the class path. If you install/reinstall right at the start of your session that should help some.

                      Comment


                      • #12
                        Wbuchanan, thanks for your reply.
                        Do you know any package that could give me the location without street address. My data do not contain street.
                        Many thanks

                        Comment


                        • #13
                          David Tranv What location are you searching for? There are an infinite number of points within say Paris, France, so how would the point that you are searching for be selected and how could it be verified? The Google geocoding API will return a latitude and longitude which I assume is the centroid, but I've not looked deep enough into their API documentation to be sure about that. I think the issue you ran into was more an issue of needing to restart your Stata or install the development version of the program:

                          Code:
                          net inst jsonio, from("http://wbuchanan.github.io/StataJSON/") replace force
                          When I use the version that would be installed from that location this is what the results look like:

                          Code:
                          . clear
                          
                          . input float id str28 city str4 state str12 zip
                          
                                      id                          city      state           zip
                            1. 1 "LITTLE RIVER" "SC" "29566" 
                            2. 2 "SPARTA" "GA" "31087" 
                            3. end
                          
                          . ggeocode city state zip, ret(bbox location geotype address location)
                          
                          . li
                          
                               +---------------------------------------------------------------------------------------------------------------------------------+
                            1. | id |         city | state |   zip |           formatted_address |    geo_type | bbox_ma~t | bbox_max~n | bbox_mi~t | bbox_min~n |
                               |  1 | LITTLE RIVER |    SC | 29566 | Little River, SC 29566, USA | approximate | 33.906248 | -78.576886 | 33.851908 | -78.687295 |
                               |---------------------------------------------------------------------------------------------------------------------------------|
                               |                                 lat                           |                                  lon                            |
                               |                           33.873228                           |                            -78.61418                            |
                               +---------------------------------------------------------------------------------------------------------------------------------+
                          
                               +---------------------------------------------------------------------------------------------------------------------------------+
                            2. | id |         city | state |   zip |           formatted_address |    geo_type | bbox_ma~t | bbox_max~n | bbox_mi~t | bbox_min~n |
                               |  2 |       SPARTA |    GA | 31087 |       Sparta, GA 31087, USA | approximate | 33.286101 | -82.953667 | 33.267893 | -82.990281 |
                               |---------------------------------------------------------------------------------------------------------------------------------|
                               |                                 lat                           |                                  lon                            |
                               |                           33.275701                           |                           -82.976259                            |
                               +---------------------------------------------------------------------------------------------------------------------------------+

                          Comment

                          Working...
                          X