I am working on yet another social networking site and the specced feature set includes allowing users to upload and geotag information (both photos and text). I'm largely unfamiliar with such things and google's not being particularly helpful, mostly just finding me information about how to use Perl to collect a list of coordinates from your GPS unit and insert them into the EXIF tags of corresponding photos. Not terribly relevant to what I'm doing.

My current thought is that the way to go would be to store both the user's entered location (for human consumption) and the latitude/longitude (for machine consumption) in the database with lat/long determined by using the first of these options which returns a match:

  1. Explicit user-entered lat/long
    This should be handled easily by a regex or two to identify and extract the coordinates.
  2. Lookup of user-entered place name in a geolocation database
    Geo::GeoNames will attempt to retrieve this information from the GeoNames web service, but I think I'd prefer to do it locally, since GeoNames provides downloadable dumps of their database and daily updates.
  3. Geotagging information within EXIF tags of photos
    I would expect this to be fairly simple with Image::ExifTool once I figure out which tag(s) to look for.
  4. Geolocation associated with user's IP address
    Geo::IP looks like it should do this with country-level granularity, but, while looking through google, I ran across a site which can do lat/long lookups down to city-level, which would be more useful to me (assuming I can find it again).
So, my questions, then:

Am I approaching this in the right way?
Have I found the appropriate tools to implement it or are there better options out there?


In reply to Geotagging uploaded data by dsheroh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.