Announcement

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

  • Get latitude using IP address

    Hi all,

    I want to pull latitude/longitude from IP addresses using:

    Code:
    geocode_ip
    ip_address, clear
    However, the output says:

    Click image for larger version

Name:	geocode_ip.PNG
Views:	1
Size:	28.4 KB
ID:	1555525


    Is there another way to get
    l
    atitu
    de & longitude?

    Thank you!
    Maggie

  • #2
    geocode_ip is a community contributed Stata command available from SSC and written by Sergio Correia a Statalist member and frequent contributor. Perhaps he will see this and offer advice. I note that freegeoip.net now redirects to ipstack.com, which sounds a lot less free, so there may be issues to overcome.

    Comment


    • #3
      1. IP addresses are addresses in the networking world. They don't map into the latitude/longitude coordinates. Example: take your mobile and start moving around; your IP stays the same, but coordinates change. So even though the IP address you've probed maps to the Southern Cross Educational Institute in Adelaide, Australia, there is no guarantee that the actual location of the user was that and other services may report a different location.
      2. That service doesn't exist anymore (was shut down in 2018).

      Comment


      • #4
        Thanks guys, appreciated it!

        I need to get latitude/longitude for our research, as we are testing sun exposure and VitD supplements.

        If I can't use IP address, is another way to pull latitude/longitude? e.g., using city town and country?

        Best regards!
        Maggie

        Comment


        • #5
          Maggie Ren ,

          if you know the town and country, you can use this service to determine the latitude/longitude:
          https://developers.google.com/maps/d...eocoding/intro

          Best, Sergiy

          Comment


          • #6
            Thanks Sergiy!

            I used geocodeopen, fulladdr(fulladdress) and it seems worked fine!

            Best regards, Maggie

            Comment

            Working...
            X