As far as I know, the answer is no. And unfortunately the users need to opt in for the location option, which means you end up with really few tweets that actually have the location data.
However, in one research, I found an almost-acceptable way to get the location data through get users (see the link). Basically, you get the location data users declare on their Twitter accounts. Assuming that the users in your dataset are not avid travelers, you can argue that their declared location can be used as the location of the tweet. After getting that location info, I found the coordinates for the cities listed and manually inserted all the values.
It is not a perfect solution, though I believe it works. I would love to hear if somebody has a better/easier/more efficient way.
Topic detection could also be used to identify the geo-location of social media users. Han and Cook (p. 452) assume that some topics like “Piccadilly and tube” are more often used in tweets by persons located in London than in another city.
Han, B., Cook, P. Text-Based Twitter User Geolocation Prediction. Journal of Artificial Intelligence Research 2014, 49, 451–500.
An investigation on general Twitter activities in London, Paris and New York City has already been done by Adnan & Longley. They compared names, probable ethnicities and genders of Twitter users in these cities.
Adnan, M., & Longley, P. Analysis of Twitter Usage in London, Paris, and New York City; AGILE 2013: Leuven, Belgium, 2013.
Maybe the methods will help you in your investigation.
I often use a combination of methods to locate Twitter users. Various methods will have varying certainty. Efe Sevin's response about using the user reported location field is very useful. Generally, these profile locations can be useful (depending on your needs). You do have to deal with misspellings and formatting of these locations and filter out obvious spurious places i.e. "Mars".
There is another option that has worked well for me as well. The Twitter Search API has a geocode parameter you can pass to search for Tweets. For the geocode parameter, you specify latitude, longitude, and a radius (mi or km). You can create many such "circles" that cover all your areas of interest at a granularity you need. Interestingly, Twitter returns tweets within your given circle by using their own internal methods to geolocate tweets. Twitter uses a combination of device/gps coordinates, user provided profile location, and (I believe/suspect) network/ip address location to determine tweets that fit within the geocode search parameter.
Note: the q or query parameter is required; however, I used a space (%20) as a way to search for all tweets from the given lat,long,radius.
We used a similar method for topic modeling tobacco-related tweets. Also, Dredze and colleagues have developed an interesting tool (named CARMEN) to geolocate tweets based on a combination of methods. I've attached a link to one of their articles.
Also, I think it's important to note that the latitude/longitude (provided through a GPS enabled device) is tied to a Twitter user NOT a specific tweet/status update. This is true as well with user-reported profile location. This is just something to keep in mind.
No you cannot extract location information if the user does not want his/her location to be public. If they have made it public then you have various methods to get the location.
Also, there are various hacks which can be used to get an approximate location of the user. Read the documentation to get an idea!
There are few possible methods present in the Twitter API:
1. https://dev.twitter.com/overview/api/places - Tweets can be found by place_id available in the API. For further information, read the friendly documentation available.
2. https://dev.twitter.com/rest/reference/get/geo/search - This is the recommended method to use find places that can be attached to statuses/update.
3. https://dev.twitter.com/overview/terms/geo-developer-guidelines - This link has the guidelines as to how much granularity do you want when you share your location.
Read the links carefully, authentication is recommended but not necessary.
Only as an addition to the suggestion to use "locations declared on user profiles":
I think you can isolate tweets that designate a location at certain times, even though the tweet isn't geotagged. For example, you can look for text like "I'm at..." or "I visited..." within the tweet text. You'll still have to find a way to organise these if you need to use coordinates though...
Agnes Mainka With the reference paper, I can only filter the tweets based on city or country, is it possible to get the exact geo coordinates for every tweet?