README


home
@j4cob

Youtube geotagging

08 Aug 2010

The documentation on how geotagging works in Youtube is a little slim, so I’m documenting what I’ve learned about it recently.

When you pull a Youtube feed in JSON-C format, e.g. http://gdata.youtube.com/feeds/api/users/greenpeaceusa/uploads?alt=jsonc&v=2&max-results=50&category=oilspilltruth, sometimes you will get geotags like this:

{
  data: {
     ...
     items: [
       {
         id: "s-QQWRdF-5Y"
         ...
         geoCoordinates: {
           latitude: 29.149463653564453
           longitude: -90.47636413574219
         }
       }
       ....

And sometimes, instead of geoCoordinates, you will get location:

location: "cat island, louisiana"

The difference between these two lies in how the video was geotagged.  If a user geotagged the video by simply typing a location name into the map widget and hitting enter, it will receive a location: attribute. If a user geotagged the video by typing a location name and then dragging the marker, or simply by dragging the marker, then the video will receive a geoCoordinates: attribute. In theory whenever a video has a location: attribute, you should be able to send it through Google’s geocoding service and be confident that you will receive an answer close to what the user intended.  In practice, Google’s geocoding index will occasionally change, and the answer may not be exactly the same as what the user saw when they originally geotagged a video.

How do I geotag a video?

Assuming you already have a video uploaded, go to http://www.youtube.com/my_videos.  Click ‘Edit’ for one of your videos:

Youtube video list

In the lower right of the video Edit page, you will see a Date and Map panel:

Screen shot 2010-08-08 at 11.11.34 AM

You can fly to a location by typing its name:

Screen shot 2010-08-08 at 11.13.14 AM

Make sure to hit the “Save changes” button in the upper left.  After doing this, your video will receive a location: attribute.  However, if you want a more precise location, or you want your video to receive the easier-to-plot geoCoordinates attribute, zoom in and drag the pin to the exact location you want:

Screen shot 2010-08-08 at 11.15.55 AM

Notice that the “Map Location” box now contains exact latitude and longitude coordinates.  Hit “Save changes” in the upper left, and your video is now tagged with precise coordinates.  You should see these show up as the geoCoordinates attribute in JSON-C output.

How can I tell if a Youtube video is geotagged?

As far as I can tell, there is no way to figure this out through the user interface on Youtube.com.  I believe the only way to access Youtube geotags is through the API.