GeoPicSorter by Aldo Franquez

This page explains how GeoPicSorter works to sort your pictures in folders. Currently, it's assumed the API lets you send requests and it works all of the time, there's no implemented code that can handle errors. It's also tested to work on folders without sub-folders.

How it works?
  1. Once the user instructs GeoPicSorter to begin organizing the pictures by pressing Start on the files list window, it'll first look for any .jpg files in the chosen directory.
  2. If at least one picture is detected, Metadata-extractor is used to attempt to fetch GPS information on each picture recursively.
  3. Each of the pictures' location on the file system, their file names and coordinates (if any) are registered on a SQLite database locally, using SQLite JDBC.
  4. After all the information has been registered on the database, it's iterated on to get the location data from it and send it to Geoapify via HTTP requests (using OkHttp) to their reverse geocoding API, which you can test on their playground site here.
  5. As the requests are made, location names from the Earth matching the submitted coordinates and the chosen sorting criteria are extracted from the JSON output using the JSON-java tool, and stored in the database.
  6. Folders for any location name that doesn't exist in the work directory are created.
  7. Finally, pictures are copied to their matching folders, according to the names received from the API, Apache Commons IO is used to ensure file properties remain intact, this includes modification time. The user can change this default behavior to make the files move to the subfolders rather than keeping a copy on their original locations.
What happens if a picture isn't geotagged or it is but the API doesn't return the required location name?

GeoPicSorter can handle such cases, pictures without geotags or that miss latitude/longitude are moved to a folder named [Unknown], while pictures with proper geotags that don't have the matching info go to a special folder based on the chosen criteria, this means that if the user chose "street", the pictures whose street name couldn't be infered, are moved to a folder named [Streetless].