System.out.println("Usage: java twitter4j.examples.geo.GetGeoDetails [place id]");
System.exit(-1);
}
try {
Twitter twitter = new TwitterFactory().getInstance();
Place place = twitter.getGeoDetails(args[0]);
System.out.println("name: " + place.getName());
System.out.println("country: " + place.getCountry());
System.out.println("country code: " + place.getCountryCode());
System.out.println("full name: " + place.getFullName());
System.out.println("id: " + place.getId());
System.out.println("place type: " + place.getPlaceType());
System.out.println("street address: " + place.getStreetAddress());
Place[] containedWithinArray = place.getContainedWithIn();
if (containedWithinArray != null && containedWithinArray.length != 0) {
System.out.println(" contained within:");
for (Place containedWithinPlace : containedWithinArray) {
System.out.println(" id: " + containedWithinPlace.getId() + " name: " + containedWithinPlace.getFullName());
}