Introduction
Geographically Encoded Objects for RSS (GeoRSS) is an OGC standard with which FME is certified compliant. GeoRSS allows for geographic information to be embedded within RSS or Atom feeds, enabling real-time delivery of geospatial data. Here is an example of a GeoRSS feed by the USGS. This feed can be used to map earthquake events as points.
In this tutorial, you will be guided through the process of transforming a simple CSV file of earthquake data into a dynamic GeoRSS feed. You can use FME to write a Simple or GML GeoRSS feed that complies with the OGC GeoRSS 1.0 standards.
Step-by-Step Instructions
If you are using your own data, please ensure your data can be used to create a GeoRSS output. Your data should have geometry (see here for GeoRSS Geometry Support in FME).
Source Data
The data for this tutorial is a CSV file of all the earthquakes recorded in a one-month time frame from the USGS Earthquake Hazard Program.
Part 1: Converting a CSV to a GeoRSS Feed
We will use the CSV’s attributes and a variety of transformers to create a detailed, OGC-compliant GeoRSS output. Download the attached data and workspace templates to get started.
1. Open FME Workbench
Open FME Workbench and start a new workspace, or open CSVtoGeoRSS.fmwt to follow along in the finished workspace.
2. Add a CSV Reader
Add a new reader and select CSV as the Format
- Format: CSV (Comma Separated Value)
-
Dataset: all_month.csv
- Click the ellipsis to navigate to the location of the file on your computer
Click OK
3. Add a CoordinateSystemSetter Transformer
Simple geometry only supports EPSG:4326. Since our output is GeoRSS-Simple, we will set the coordinate system to EPSG:4326 here. Connect the CSV reader to the input port and double-click the transformer to open the parameters window to set the following fields:
- Coordinate System: EPSG:4326
Click OK
4. Optional: Add a Sampler Transformer
If you are working with a large dataset and would like to test that the output is correct before processing the entire dataset, add a Sampler transformer. For this example, the Sampler transformer retained 1 out of 100 records by changing the following parameter:
- Sampling Rate (N): 100
Click OK
5. Add a Second Sampler Transformer
Only the first feed type feature is passed onto the GeoRSS writer; all others will be ignored. Connect the Sampled port of your first Sampler to the input of this transformer. Let's set up this Sampler with the following parameters:
- Sampling Rate (N): 1
- Sampling Type: First N Features
Click OK.
6. Add a GeometryRemover Transformer
The GeoRSS Feed writer does not need any geometry. Add this transformer after the second Sampler to remove any geometry from the Feed writer. If there is no GeometryRemover, the point from the first entry will also be written to the feed.
7. Add an AttributeManager Transformer
Now, we will set all of the attributes that we need for our feed. Connect it after the GeometryRemover. Let’s begin by double-clicking the AttributeManager to open it.
-
Add Attribute:
-
Output Attribute: Title
- Value: USGS Significant Earthquakes, Past Month
-
Output Attribute: LinkURI
-
Value:
https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_month.atom
-
Value:
-
Output Attribute: LastUpdate
- Value:
@DateTimeNow()
- Value:
-
Output Attribute: Title
Click OK.
8. Add a DateTimeConverter Transformer
We must convert it into ISO to conform to the OGC standards of date and time for GeoRSS. To do this, we add a DateTimeConverter after the AttributeManager. Select the attribute to convert and ISO as the output format by selecting:
- Datetime Attributes: LastUpdate
- Output Format: ISO
Click OK.
9. Add a GeoRSS/RSS Feed Writer
Click the Add Writer button, start typing GeoRSS, and select the GeoRSS/RSS Feed Writer. Name the GeoRSS Feed file. We will keep the default Writer Parameters but enable Pretty Print for better readability. Select both Feed and Entry.
Click OK.
Connect the Output port of DateTimeConverter to the Input port of the Feed writer.
10. Add a Second DateTimeConverter Transformer
From the Sampled port of our first Sampler, add a connection to our newly added DateTimeConverter’s Input port. This time, we are converting the “time” and “updated” attributes from our input CSV.
- Datetime Attributes: time, updated
- Output Format: ISO
Click OK.
11. Add a second AttributeManager Transformer
This transformer will help us set the attributes for our Entry feature type writer. Connect AttributeManager_2 to the output port of the DateTimeConverter_2 transformer.
-
Add Attribute:
-
Output Attribute: Title
-
Value:
M @Value(mag) - @Value(place)
-
Value:
-
Output Attribute: LinkURI
-
Value:
https://earthquake.usgs.gov/earthquakes/eventpage/@Left(@Value(Id),2)@Right(@Value(Id),8)
-
Value:
-
Output Attribute: Title
-
Update Attribute:
-
Input Attribute: id
- Output Attribute: ID
- Action: Rename
-
Input Attribute: time
- Output Attribute: Published Date
- Action: Rename
-
Input Attribute: id
Click OK.
The title will include the entry's magnitude and location. Since the GeoRSS entry's ID has a particular format, we must use string functions to generate the proper format.
Part 2: Exposing Writer Format Attributes
Format Attributes are specific to a format’s schema, but are not all visible by default. To “expose” them makes them visible through the feature type dialog. Depending on the format of your GeoRSS feed, you may need to write out fewer or even more attributes. For more information on the feature attributes, see this schema document.
1. Expose Additional Format Attributes from the Feed Writer
Double-click on the Feed writer to open the Feature Types, and navigate to the Format Attributes tab to expose additional attributes. Beyond the attributes we set from the previous part, we also need to expose five additional format attributes. Find the following and click the checkbox to expose them:
- Author
- AuthorURI
- Icon
- LastUpdate
- LinkRelation
Click OK.
2. Add Newly Exposed Attributes
Let’s add on the attributes that we just exposed. Open the parameters for the AttributeManager and set the following:
-
Add Attribute:
-
Output Attribute: Author
- Value: U.S. Geological Survey
-
Output Attribute: AuthorURI
-
Value:
https://earthquake.usgs.gov/
-
Value:
-
Output Attribute: Icon
- Value:
https://earthquake.usgs.gov/favicon.ico
- Value:
-
Output Attribute: LinkRelation
- Value: self
-
Output Attribute: Author
Click OK.
3. Expose Additional Attributes on the Entry Feature Type
Beyond the attributes we set from the previous part, we must expose eight additional format attributes. Double-click the Entry Feature Type and locate the following, and click the checkbox to expose them:
- Category{}.Category
- Category{}.Label
- Elevation
- LastUpdate
- LinkRelation
- LinkType
- Summary
- SummaryType
Click OK.
4. Add Exposed Attributes
Let’s set the values of the attributes we just exposed to the AttributeManager_2 transformer.
The Category{}.Label and Category{}.Category attributes are list attributes. If you would like multiple Category attributes, start with Category{0}.Label and Category{0}.Category. Then, use {1} as the list element number and keep going up by an integer for any additional Category attributes.
-
Add Attribute:
-
Output Attribute: Category{0}.Label
- Value: Age
-
Output Attribute: Category{0}.Category
- Value:3 0 Days
-
Output Attribute: Category{1}.Label
- Value: Magnitude
-
Output Attribute: Category{1}.Category
-
Value:
Magnitude @round(@Value(mag),[0])
-
Value:
-
Output Attribute: Category{2}.Label
- Value: Contributor
-
Output Attribute: Category{2}.Category
- Value: net
-
Output Attribute: Category{3}.Label
- Value: Author
-
Output Attribute: Category{3}.Category
- Value: net
-
Output Attribute: Elevation
-
Value:
@Evaluate(@mult(@Value(depth),[1000]))
-
Value:
-
Output Attribute: LinkRelation
- Value: alternate
-
Output Attribute: LinkType
- Value: text/html
-
Output Attribute: Summary
-
Value:
<![CDATA[<Insert valid HTML>]]>
-
Value:
-
Output Attribute: SummaryType
- Value: HTML
-
Output Attribute: Category{0}.Label
-
Update Attribute:
-
Input Attribute: updated
-
Output Attribute: LastUpdated
- Action: Rename
-
Output Attribute: LastUpdated
-
Input Attribute: updated
Click OK.
5. Run the Workspace
Run the workspace and view the output. You will have one XML output file containing the Feed and Entry feature types. View the file with any XML editor to see your newly created GeoRSS output! Here we can see the feed and the first entry:
Here is a preview of the GeoRSS feed in Data Inspector, where the earthquake events can be seen as points on a map:
Troubleshooting
If your feed needs additional attributes, refer to the schema documentation for all available attributes. The writer can expose these attributes under Format Attributes. The Elevation attribute for the Entry writer feature type is still being implemented and will not write out any <georss:elev> values as of 2025.0. Despite not appearing as a user or format attribute in the Feed writer feature type, Id does exist and will be written out as long as you create an Id output attribute.
Additional Resources
For more in-depth information on GeoRSS, consult the OGC Implementation Specification document:
To learn more about how FME handles reading and writing GeoRSS, refer to the following FME documentation:
Data Attribution
The data in this tutorial originates from the USGS Earthquake Hazards Program. This data is in the public domain and can be accessed from https://earthquake.usgs.gov/earthquakes/feed/v1.0/csv.php.