Drupal Best Integrates WebGIS with CMS: Italo Mairo

Interview (FULL TEXT)
28 January, 2023
Italo Mairo

More advanced and integrated uses of GIS modules in Drupal do not yet have detailed documentation. There is a need for an updated technical book on advanced geo-mapping with the Geofield Stack in Drupal 8 and above, points out Italo Mairo. He was replying to a question posed to him by our Editor-In-Chief, Sebin A. Jacob, in an email interview. 

Italo Mairo, as we know, is a crucial contributor to a set of Geographic Information System (GIS) modules that enable Drupal to store geocoded content and visualise it. He is the official creator and maintainer of Geofield Map and the maintainer of Geocoder, Geofield, and Leaflet Modules. (We recently published a story on the release of Leaflet Module 10.0.x with full support for D10.) He is also a co-maintainer/contributor to the Layout Paragraphs module. 

The Drop Times (TDT) approached him for an interview, asking questions about his work, and he was kind enough to reply via email. His answers inspire any Free Libre and Open-Source Software contributors in general and aspiring Drupal contributors in particular. It would also appeal to young engineers passionate about engineering drawing, computer graphics and visualisation. Read on to grab a bite from the exciting conversation. 

[NB: The language used is British English, as we intend to keep the answers as verbatim as possible. US readers, kindly bare with us.]

The Making of 'Italo Mairo' and His Role in Drupal GIS Modules

TDT [1]: We would like to know more about you as a person and a professional. Are you a cartographer by training and a geospatial analyst by passion? What are your academic credentials? 

Italo Mairo: Yes, I am a Digital cartographer by passion and training. Originally I graduated as Civil Engineer, but due to my natural predisposition for visual arts and photography, I soon directed my professional interest and skills towards computer graphics and digital communication, working a lot in the CAD and 3D modelling/animation fields. I was involved for years in services for territorial marketing using extensive GIS applications, initially with commercial applications, such as ESRI products (ArcViewArcGIS).

I liked combining logic in modelling geo-databases with the graphics and the appeal of the final spatial representations. It was very complicated to publish everything on the Web due to the very high costs and the lack of truly "Web-based" solutions.

GIS Applications

The advent of Google Maps and its APIs—so as other truly open-source solutions, such as Leaflet, OpenLayers, etc.—have revolutionised that world, allowing anyone to exploit and publish their creativity with open-source web languages. Before, it was too closed and limited to insiders, whereas anyone with knowledge of HTML, CSS, Javascript, PHP, etc., could indulge now. I was among the first to dive into that world, translating my passion into what quickly became increasingly advanced open-source Web GIS 2.0 products.

TDT [2]: It is intriguing to know your combined interest in GIS and Drupal. How were you introduced to Drupal, and what motivated you to start contributing to GIS modules for the platform?

Italo Mairo: I first met Drupal when I was tasked with digitising an Editorial Catalog of a Publishing House, making it an eCommerce at the same time, using an open-source solution exclusively. I spent 2/3 months trying different solutions (WordPress, Magento, Presta Shop, Joomla). Still, none could do both well or integrate each other simply and effectively, as it turned out in Drupal.

In 2011, the Drupal 7 version had just come out, and I succeeded brilliantly in my project thanks to Drupal Commerce.

I developed several Web GIS 2.0 applications with a "vanilla stack" of PHP and JS in Google Maps and Leaflet.

Vanilla PHP/JS WebGIS Applications

But after meeting Drupal, I felt attracted to integrating the same Web GIS 2.0 features with the most disparate features of its third-party modules. I was fascinated by the availability and robustness of its Entities and Fields APIs and the ability to manage them relationally with a backend UI. I saw the natural transposition into a CMS Web product of the peculiarities of GIS software, in which it is typical to add attributes to the managed geometric entities.

The advent of Drupal 8 has represented a significant change in the way of writing the code of third-party Drupal modules. Geofield stack modules kept un-updated for some time. Hence, I made a virtue of necessity, and I took this opportunity to rewrite the Geofield Map module for Drupal 8 from scratch (this time as a standalone module), providing it with some advanced features I had in mind. By doing this, in a few months, I found myself taking care of the transposition into Drupal 8 of its main complementary (and most adopted) modules as well (Geofield, Leaflet and Geocoder), becoming so their main maintainer.

TDT [3]: Can you tell us more about the Leaflet module and its role in the Drupal Geofield Mapping stack? 

Italo Mairo: The Leaflet module for Drupal is central to the Geofield stack. 

It officially allows you to integrate and take advantage of the Leaflet library, a 'leading open-source JavaScript library for mobile-friendly interactive maps'.

It implements various functions for users, both for inputting information (in Geofield format) and for their advanced representation throughout dynamic, interactive and highly user-configurable Leaflet maps.

Drupal Leaflet Module

Its integration with Drupal tokens, associated with the presence of various hooks and Js triggers/events, allows the most enlightened users/developers to theme the results according to entities properties and extend the maps and its markers well beyond the configurations available in the module and also make them smartly interact with the other elements of the web page.

Its recent new release 10.0.x represents a major upgrade, with many new features and functional enhancements (listed on the module page and in its Readme.md file). It consolidates Drupal (versions 9 and 10) as a powerful middle-range open-source reality to build up a professional Web Gis 2.0 solution easily.

TDT [4]: You also maintain many GIS-related modules in Drupal. Can you explain the role of each of these modules and how they work together to support GIS functionality in Drupal?

Italo Mairo: Besides Leaflet, Geofield, Geofield Map, and Geocoder modules represent the central core of the Geofield Stack since Drupal 8 and later (Drupal 9.x, Drupal 10.x).

The Geofield module is the main dependency responsible for creating a Geofield Field type to store and manage the geographic information associated with the Drupal entity.

It exploits (and depends on) the GeoPHP library and can manage information in WKT format and GeoJson (in its geographical component), both as Simple Points/Multi points (pairs of Latitude and Longitude) and as Complex Geometries (Linestring & Multi-Linestring, Polygons & MultiPolygons, Geometry Collections). Basic Field Widgets and Field Formatters are defined inside for inserting and representing geographical information in textual formats (Lat/Lon, WKT, etc.) but not via Interactive Maps. It also implements proximity filters in Views and integrations with the Migrate and Feeds modules for import operations and batch creation of geo-referenced content.

The Geofield Map module integrates the Geofield with the Interactive Maps (as the Leaflet module does), exploiting them not only for the final representation (Formatter and View Styles based on Google Maps) but also for data entry (Widget, both in Leaflet and in Google Maps). It also integrates with the Geocoder module for Geocoding and Reverse Geocoding operations. It also implements two advanced types of plugins (unique in Drupal): one for the dynamic theming of markers in the UI and one for the contextual generation of associated Legends in the form of Blocks.

The Geocoder module is the most advanced, complete, easy-to-use solution for processing Geocode and Reverse Geocode operations on Drupal Entities. It integrates with the Geofield type field, allowing you to perform automatic Geocoding and Reverse Geocoding operations both in creating the entities (even in a programmed way) and in their representation at runtime (in the formatter or the View style).

Additionally, I now also maintain Leaflet More Maps and Leaflet More Markers (accessories to the Leaflet one) as a kind inheritance from Rick De Boer, a great contributor to the Leaflet module in Drupal 7.

Agile Development and Challenges

TDT [5]: What challenges and obstacles have you faced while developing and maintaining these modules, and how have you overcome them?

Italo Mairo: The Geofield module currently reports about 50k adoptions, equally distributed between the Drupal 7 version and later. The other main modules of the Geofield stack also register tens of thousands of adoptions.

Since their Drupal 8 version, I took charge of the maintenance (and development) of such much-used modules, which represented a great responsibility. It required me to progress with due care: small steps and frequent releases as you don't want to wake up in the morning being reported of critical bugs on newly released versions.

That's why there are almost no reported bugs now on these modules.

The main challenge certainly concerned the transposition from Drupal 7 modules into Drupal 8 and adopting the new object-oriented development patterns. Facing the Security advisory process for the first time and acquiring the notorious Green Shield proved quite cumbersome (perhaps too much for the developer getting his first module approved).

But this was also a great opportunity because it allowed me to acquire the right skills in advanced Drupal 8 (also Drupal 9.x, Drupal 10.x) development. It got me used to writing high-quality code integrated with third-party libraries and strictly compliant with Drupal/PHP/Js coding standards.

Real-World Adoptions and Use-Cases

TDT [6]: Amuse us by sharing any successful, innovative, fascinating projects and case studies of your Geofield stack modules. Kindly share with us any success stories or examples of how the Leaflet module has been used in real-world projects by users of the Drupal Geofield Mapping stack.

Italo Mairo: Despite such a large number of adoptions worldwide, there is no public showcase of the most effective solutions implemented with the Geofield stack. That would be very useful.

Indeed, these modules could be (and are) used for the most disparate solutions, where the contents have a component of geographical enhancement: it could be mapping customers of the website, the properties of a real estate agency, the locations of a travel platform, the intended uses of a master plan, etc.

The FarmOS distribution certainly comes to mind as a sophisticated and consolidated solution using Geofield.

I have personally developed dozens of geospatial solutions with Geofield stack modules.

Among the most recent (from Drupal 8 versions onwards), it is certainly worth mentioning:

  • The Geofield stack Demo application to support community users, implementing basic and advanced functionalities with geo-contents and geo-tagged photographs produced during my life and work experience in New York;
  • An application for the recovery and automatic representation of geographical data on the spread of the Covid19 infection, which exploits the integration with the Feed module and the dynamic representation via Leaflet's Circular Marker;
  • Geo Images gallery prototype of some of my best pics taken in Denmark (), which demonstrates the ease of creating geo-referenced photo albums using the Geocoder module and EXIF metadata of files;
  • A pretty impressive and pragmatic Drupal integration of the Leaflet module with the information layer on the entire set of census parcels of the United States provided through ReportAll US web services.

Drupal WebGIS Modules

Drupal Community

TDT [7]: Share your experience of your engagement with the Drupal community and the feedback and support you received from fellow developers and users while working on these modules.

Italo Mairo: I've always considered its community, and its completely open source and freeware (sic) model are the best Drupal strengths.

[Editor's note: The word freeware is a misnomer here. Drupal is not freeware but free software. Freeware might be free of cost but would not provide the freedom to modify, assemble and redistribute the code. Learn more about the four freedoms of free software.]

Being part of it as a maintainer of such widely adopted modules is both a responsibility and a privilege.

You no longer develop something for your own purposes but also to support all users and make the product useful beyond your point of view. Bug issues and support and feature requests are a burden but, at the same time, a unique opportunity to improve and connect more closely with incredible professionals worldwide. I genuinely think volunteering based on your skills and interests is wonderful. 

Sometimes it's more complicated when you find yourself interacting with users who, above all, "demand". In such cases, I like to emphasise with them the opportunity to act as a "giver" besides as a "taker", directly referencing this insightful article written by Dries Buytaert some time ago. 

Integration of Data Visualisation, GIS and Web Technologies

TDT [8]: Historically, what has changed in approaches and technology wrt GIS? How have your modules reacted to these evolutions over time? 

Italo Mairo: As mentioned, I think the biggest revolution in the GIS field has been its full integration with Web technologies. Ongoing evolutions are (and will be) hence aligned with the evolutions of the Web itself, which are many. For example, the graphic technologies of OpenGL come to mind, or the integrable ones of virtual reality or augmented reality or those of Web 3.0 or IoT-based applications. 

A reference for me to follow is undoubtedly Mapbox which has been state-of-the-art in the Web GIS field for years and which (on closer inspection) turns out to be a spin-off of a previous important Drupal web agency (Development Seed). Drupal obviously does not present itself as an alternative (or competitor) to such dedicated and professional Web GIS engines but rather at the top of powerful open-source CMS solutions, increasingly open to integrations with third-party tools and new technologies. In this, limits will only be those related to the creativity and effort of the developers who will be able to dedicate themselves.

TDT [9]: In your opinion, what is the future of GIS in Drupal? Are there any new features or capabilities you are currently working on or planning to develop?

Italo Mairo: IMHO, Geo-Mapping in Drupal should certainly stay as a key feature and could even consolidate in the future. Though not competing with the most advanced and specialised Web GIS engines, it can certainly represent an advanced intermediate tool for those who are not specifically cartographers but want to enrich their Web product and its information contents with not trivial level Web GIS functionalities and representations.

Geofield Stack modules are already compatible with more complex data structures, such as the Components based ones (i.e. with Paragraphs), so with less traditional architectures (which are very popular now) such as Decoupled and Headless ones, maybe with the smart Views GeoJSON module. On this latter front, it would also be interesting to experiment with the integration of Next.js for Drupal project.

The vitality of Drupal in the near future and its ability to adapt and adopt the best evolutions of Web development will be an indispensable recipe for consolidating and fueling its geo-mapping functionalities.

TDT [10]: How do you see the use of GIS technologies and data visualisation evolving in the future, and how do you envision your modules fitting into this landscape?

Italo Mairo: If the evolution of GIS is closely linked to that of Web technologies and to their mutual integration, the issue of visualisation of the final data is central and goes hand in hand with that which concerns the User Experience (UX). There are very frequent cases in which Web Maps are difficult to use and understand for users because they have been constructed with approximation, representing geo-referenced data on the map with very ineffective results: too many overlapping markers (without appropriate clustering), undocumented labels and popups uninformative and with an awkward style. It's those web maps that you open once and never go back to.

In developing my solutions and implementing the functionalities of geo-mapping modules for Drupal, I pay great attention to the significance of the geo-referenced contents and the quality (and usability) of the representation for the end user.

Need for Advanced Documentation

TDT [11]: Do you have any tips or advice for new users of GIS and Drupal who want to get started with these modules? Are there any resources or communities you recommend for learning about GIS in Drupal?

Italo Mairo: It is intuitive to add Geofield to your dataset in Drupal, and basic functionalities and specifications are quite well documented in Geofield Stack modules Readme.md files and their Drupal.org pages. Their configurations are also relatively easy to understand and manage, knowing what a Widget, a Formatter, a View Style, etc., is in Drupal.

Obviously, knowledge of the geo-mapping libraries currently implemented (Google Maps API and Leaflet JS) is a requirement, at least in the fundamental aspects and concepts regarding Geocoding/Reverse Geocoding operations and available providers.

Unfortunately, more advanced and integrated uses do not yet have detailed documentation for Drupal 8 and later versions (Drupal 9 and Drupal 10). Users should rely on the existing module's channels (Drupal.org, Drupal Slack, etc.) to investigate advanced techniques and countless issues already faced by users or open new supports request. 

Presenting Drupal WebGIS modules at NYC meetup
Italo Mairo Presenting Drupal WebGIS modules at NYC meetup

There are a couple of presentations made by myself at the Drupal Meetup in New York City, posted on my Slideshare profile, and linked on the Geofield module page. 

For sure, one could write a new updated technical book on this topic (advanced geo-mapping with the Geofield Stack in Drupal 8 and above). Who knows, maybe someone will find the time to do that sooner or later.

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please let us know in the comments below and we will try to address the issue as best we can.

Related People

Advertisement Here