Using Generative AI for Geospatial Data Processing in FME (with 6 Examples)
The AI revolution is changing the game in geospatial data processing in unexpected ways. Across sectors, we’ve seen it streamline business processes, boost productivity, and improve decision-making. Want help creating or editing content? Done in seconds. Need a summary of a massive document? Here you go. Wishing you had a personal assistant to do research, bounce ideas off of, and do mundane tasks? It can do that, too.
As we strive to understand the role and power of AI, some people are panicking that robots are coming for everyone’s jobs (I admit, I held a bit of this fear myself)—but the reality is far from it. Instead, it’s proving to be a tool to make everyone’s jobs easier. Even with the most powerful AI, humans still need to create prompts and interpret the results, which means prompt engineering is becoming a skill for the resume. If you’ve tried using ChatGPT for anything advanced, you know what I mean: using it takes practice.
When working with geospatial data, generative AI can be an incredible help, enabling advanced data extraction, automating analysis for better decision-making, and improving predictive modeling. The trick is knowing how to incorporate it into data integration workflows—which is where Safe Software 's new FME AI connectors come in.
FME can integrate with various APIs and formats, transform data, and handle data distribution. AI is one piece of the workspace, helping you to get more valuable results.
Adding generative AI into your FME workflows is as easy as adding any other reader, writer, or transformer to the canvas. At the time of writing, these are FME’s tools for working with generative AI:
These transformers enable a conversational approach to AI prompting via GPT-4 and GPT-3.5 Turbo.
Time to master a new skill: Writing killer prompts
To get the most out of AI, it’s necessary to understand how to create prompts that will generate the most useful results. This is a learning curve. Until you build that skill, the results will leave you squinting at the screen and wondering what all the fuss is about.
A few important things to consider:
Let’s dive into some examples. These come from our recent webinar, Latest Advances in Generative AI: Exploring New Technology for Data Integration, which you can watch to see the full demos and discussion.
Example 1: Prompting with context in the OpenAIChatGPTConnector
In the OpenAIChatGPTConnector parameters, different fields can provide information to the AI, including the role, message history, and a unique conversation ID.
For example, we can send the following prompts:
By prompting the AI with context and the chat history, we can get more useful results than if we simply send one prompt asking it to generate a JSON file.
Example 2: Generating geospatial datasets with automated context
FME’s new Generative AI Reader does much of the prompting legwork automatically. In the parameters, simply type what you want. The reader will generate the field names and rows.
For example, we can ask it for the following information:
“ All CFL teams, their team name, their stadium name, city name, the stadium location. Oh yes, also their annual revenue and average game attendance”
The dataset we get back looks like this when opened in Visual Preview:
As mentioned above, the data comes from whatever the AI knows from its training data, which is currently pre-September 2021. As ChatGPT improves and can take into consideration up-to-date information from around the internet—perhaps even be trained on your company’s data—we can see this type of scenario being much more useful.
Here’s another set of prompts. First, let’s ask for an informative dataset of all the US states:
“All 50 US State names, their 2 letter code, an example zipcode in each, and the capital city”
Now let’s use this data in this second prompt:
“The top 10 companies by revenue in @Value(capital), @Value(state), with their company headquarters address, number of employees, and industry”
So, for every row in the previous dataset, we will run this query. Here is the result for Boise, Idaho:
Here is the result for all cities and states:
Recommended by LinkedIn
This is a great example of how we can chain together queries to generate more useful, comprehensive results. The context added by the reader will be a huge time saver, enabling you to simply type in what sort of dataset you want and get it back within seconds. You can then process and distribute the data in any of FME’s supported formats.
Example 3: Generate images using Leap AI
FME has two transformers for generating AI images: OpenAIImageGenerator and LeapAIConnector. They are both straightforward to use, accepting a prompt and contextual parameters such as the size. Here’s an FME Lizard-Zipster mutant it generated during the webinar:
Example 4: Create an app for self-serve document processing
Tensing has developed several tools that leverage generative AI in FME. Accessible via a web interface, they enable end users to upload a document and get back an AI-generated summary. These tools can also be accessed in FME via these transformers:
This is a great example of how AI can be integrated in an FME workflow to empower end users to use it for a specific scenario. In this case, an end user can upload a document and get back a summary, keywords, and even locations from the document for use in geospatial analysis.
Example 5: Another app for extracting locations from PDF maps
Tensing also created a workflow to automate location extraction from embedded PDF maps, which includes the following steps:
They have also made this available as a web app.
This scenario illustrates how different services can be integrated using FME, creating a very powerful workflow that empowers end users to leverage AI.
Example 6 (sneak peek): Generate regex, SQL, and Python queries
Currently under development in FME: we’re considering how we can let AI help users write regular expressions, SQL, and Python. Functionality would include:
For example, a user hoping for SQL help could type:
from us_counties, find the county that is most rainy, the result should contain the county name, the county population , the annual rain, the annual snow and average temperature
And the AI would return:
SELECT county_name, pop, annulrain, annulsnow, avetemp FROM us_counties WHERE annulrain = (SELECT MAX(annulrain) FROM us_counties) GROUP BY county_name, pop, annulrain, annulsnow, avetemp;
Let us know if you’re interested in this and any other AI-related functionality. Many of us already use ChatGPT to generate queries in these languages, so we’d like to embed this into FME to help speed up the authoring experience.
Try it!
Using generative AI for geospatial data processing can enhance workflows and decision-making processes, enabling tasks that were previously tedious, complex, and even impossible. Let us know how you’re using this new functionality, and check back for more updates!
For more examples and step-by-step guides, check out our Tutorial: Getting Started with OpenAI in FME.
How are you using generative AI in FME? What are your biggest challenges?
love this Generative coding assist AI ...I have excellent skills and experience as an Analyst and working with Image Analysis and other tools. This is the bridge I need to build the code for some very sophisticated tools and process builds thanks as I am diving into your FME and AI course training as we speak who says you can't teach an old dog new tricks ? I am a Drake University Bulldog
It’s all about Where