Automatically import and Geo Map all your images and photo shoots in Drupal!

Drupal Recipe for Drupal (CMS & 10+) that implements advanced Geo Mapping functionalities with Media Images

Introduction

This Drupal Recipe enhances Drupal (10 +) with advanced Geo Mapping functionalities with Media Geo Images provided with EXIF data, regarding both Shoot Location/Coordinates and Shoot Creation Date.

It is based on the advanced application and configuration of the Geofield and Drupal Media modules stacks, and is developed and tested on DrupalCMS (11+) and in particular on its following basic variants:

Notwithstanding the above it may work fine and apply to any other Drupal instance where there are no existing configuration conflicts.

Requirements and Dependencies

Please check the following files for required dependencies:

Instructions

How to require / install it and make it magically work (out of the box)

This Drupal Recipe enhances the advanced interaction between the Geofield, Leaflet & Geocoder geo mapping modules and the Media Library Import module, for the automatic import of your images and photo shoots.

Note: This Drupal Recipe Instructions assume the use of DDEV

Step 1: place your images ready for import

The Drupal Recipe "out of the box" configuration expects to find all you images in (and import from) the following "photo_albums" folder:

/web/sites/default/files/photo_albums

and is going to import all the images into geo images media from there.

Thus please place the images you want to import and automatically geomap in that folder of your Drupal (CMS & 10+) instance.

Warm Tip: As a first test and import it is much better not to exceed a number of images above 50 - 100, in order not to experience a too long operating process. You will always be able to perform incremental / additional imports by adding new images to the same folder, without generating duplicate imports and Geo Images (thanks to the capabilities of the Media Library Importer module).

Step 2: require and install the Drupal Recipe

Apply the following composer commands:

As a result your Drupal instance should have the following:


Step 3: import and automatic Geo Map of your Images

Make double sure you placed your images in the "photo_albums" as instructed in Step 1, or in any other location, changing the Media Library Importer configuration (/admin/config/media/media-library-importer).

Then perform the Media Import operation, either manually from this Admin page:
/admin/config/media/media-library-importer/import
or throughout the following commands (worth a pre cache cleaning this time also):

ddev drush cr && ddev drush mli

and wait for the QueueWorkers complete all the import and the automatic Geo Mapping ...

All in one shot
For your convenience here is a unique line command that would perform all the above steps in one shot:
ddev composer require drupal/drupal_cms_geo_images && ddev drush cr && ddev drupal recipe ../recipes/drupal_cms_geo_images && ddev drush cr && ddev drush mli

Et Voilà! ...

You should now have:

Additional hints and tech notes

The Drupal Recipe:

Enjoy automatic Geo Mapping of your Photos and your Geographic Story telling in Drupal.