nst-guide / data

Create map waypoints and layers from open data sources
https://nst-guide.github.io/data/
GNU General Public License v3.0
6 stars 0 forks source link

Geotag photos #9

Closed kylebarron closed 4 years ago

kylebarron commented 4 years ago

For each photo in photo library, get the JSON output of exiftool. (Maybe cache this, because this presumably takes a long time?) Then using that JSON data, create a crosswalk between filename, other immutable file attributes (?), and original and interpolated GPS location.

For each timestamp, store the original GPS location (for iPhone photos), the raw GPS location from the watch, and the projected point on an ~official PCT track.

In order to check GPS drift, compare iPhone photo GPS locations to geotagged locations for those same photos. Check at the beginning and end of the trail. Is there drift?

You can't just look at file modification timestamps, because those are often post-trail.

kylebarron commented 4 years ago

Workflow for photos to upload to website:

Example osxphotos response:

> osxphotos query --album "PCTA Photo contest" --json | jq .
[
  {
    "uuid": "9DC216C4-8C18-4AA0-A281-884402908846",
    "filename": "9DC216C4-8C18-4AA0-A281-884402908846.jpeg",
    "original_filename": "DSC06547.JPG",
    "date": "2019-07-30 19:26:18-06:00",
    "description": null,
    "name": null,
    "keywords": [],
    "albums": [
      "PCTA Photo contest"
    ],
    "persons": [],
    "path": "/Users/kyle/Pictures/Photos Library.photoslibrary/originals/9/9DC216C4-8C18-4AA0-A281-884402908846.jpeg",
    "ismissing": false,
    "hasadjustments": false,
    "external_edit": false,
    "favorite": true,
    "hidden": false,
    "latitude": null,
    "longitude": null,
    "path_edited": null
  },
  {
    "uuid": "81CD8E80-E058-4020-AF30-70F785276FBB",
    "filename": "81CD8E80-E058-4020-AF30-70F785276FBB.arw",
    "original_filename": "DSC06544.ARW",
    "date": "2019-07-30 19:24:42-06:00",
    "description": null,
    "name": null,
    "keywords": [],
    "albums": [
      "PCTA Photo contest"
    ],
    "persons": [],
    "path": "/Users/kyle/Pictures/Photos Library.photoslibrary/originals/8/81CD8E80-E058-4020-AF30-70F785276FBB.arw",
    "ismissing": false,
    "hasadjustments": false,
    "external_edit": false,
    "favorite": false,
    "hidden": false,
    "latitude": null,
    "longitude": null,
    "path_edited": null
  },
  {
    "uuid": "AE7A71FB-029D-42A5-BAC8-2E186A8EBDA0",
    "filename": "AE7A71FB-029D-42A5-BAC8-2E186A8EBDA0.jpeg",
    "original_filename": "DSC06550.JPG",
    "date": "2019-07-30 19:26:43-06:00",
    "description": null,
    "name": null,
    "keywords": [],
    "albums": [
      "PCTA Photo contest"
    ],
    "persons": [],
    "path": "/Users/kyle/Pictures/Photos Library.photoslibrary/originals/A/AE7A71FB-029D-42A5-BAC8-2E186A8EBDA0.jpeg",
    "ismissing": false,
    "hasadjustments": false,
    "external_edit": false,
    "favorite": true,
    "hidden": false,
    "latitude": null,
    "longitude": null,
    "path_edited": null
  }
]
kylebarron commented 4 years ago

After creating the Photos album with photos to upload, you should add keywords to the photos within Photos, which will be included when queried with osxphotos

kylebarron commented 4 years ago

And add a description/caption for photos within Photos.app. Those should also be exported by osxphotos

kylebarron commented 4 years ago

If you crop a photo in Photos.app, is the photo pointed to from osxphotos the cropped photo or the original?

kylebarron commented 4 years ago

From the osxphotos Python API, it has two paths: path and path_edited. The first points to the original image, the second to the edited one. That way you can use the edited photo (if it exists) for the site.

kylebarron commented 4 years ago

Initial geotagging: https://github.com/nst-guide/create-database/commit/3ea97098d660956b8d0d2ba4ebe524921e35c6bd