Skip to main content

I could use some help in understanding how donuts are stored in OSM XML. Or more specifically, why FME Data Inspector is not constructing the donut from the XML. Here is the simple shapefile test data I’ve created.

In FME, I’m writing out the OSM using the normal writer:

When I read that OSM back into Data Inspector, it doesn’t recognize the shape as a multipolygon. The geometry type is fme_no_geom:

The XML code is below. I’m seeing the relation present, so I’m not sure what else is required.

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6">
<node lat="34.6596384" lon="-87.0320968" id="-7"/>
<node lat="34.5631538" lon="-86.8849822" id="-10"/>
<node lat="34.7427899" lon="-86.9769288" id="-8"/>
<node lat="34.4741373" lon="-86.9217608" id="-4"/>
<node lat="34.6293808" lon="-86.7401662" id="-2"/>
<node lat="34.5063457" lon="-87.0619795" id="-5"/>
<node lat="34.5536885" lon="-86.9194622" id="-16"/>
<node lat="34.5669396" lon="-87.0022141" id="-15"/>
<node lat="34.6350549" lon="-86.9562408" id="-13"/>
<node lat="34.5271799" lon="-86.7493609" id="-3"/>
<node lat="34.7144522" lon="-86.7907369" id="-1"/>
<node lat="34.6047883" lon="-86.8596968" id="-11"/>
<node lat="34.6728726" lon="-86.8849822" id="-12"/>
<node lat="34.5574747" lon="-87.1217448" id="-6"/>
<node lat="34.6085723" lon="-87.0137075" id="-14"/>
<node lat="34.750345" lon="-86.8964755" id="-9"/>
<way id="-17">
<nd ref="-1"/>
<nd ref="-2"/>
<nd ref="-3"/>
<nd ref="-4"/>
<nd ref="-5"/>
<nd ref="-6"/>
<nd ref="-7"/>
<nd ref="-8"/>
<nd ref="-9"/>
<nd ref="-1"/>
</way>
<way id="-18">
<nd ref="-10"/>
<nd ref="-11"/>
<nd ref="-12"/>
<nd ref="-13"/>
<nd ref="-14"/>
<nd ref="-15"/>
<nd ref="-16"/>
<nd ref="-10"/>
</way>
<relation id="-19">
<member type="way" ref="-17" role="outer"/>
<member type="way" ref="-18" role="inner"/>
<tag k="type" v="multipolygon"/>
<tag k="landuse" v="farmland"/>
</relation>
</osm>

I’m using FME2023 build 23332. What could be the issue here?

Hi @dustin,

Thank you for your question! After checking in with our xml team I was able to gather a couple of key things:

To properly handle this, there’s a setting called Build Geometry for Multipolygon Relation in the OSM Reader that needs to be enabled when reading OSM files. This allows multipolygon relation features to have their geometry built (see the attached image).

  • When using the View Written Data or Open in Data Inspector buttons in Workbench, the OSM Reader reads back the translated data without this setting enabled, which results in the geometry type being shown as fme_no_geom.

To work around this, you can reread the OSM file into the workspace using the OSM reader with the setting, Build Geometry for Multipolygon Relation, toggled on. In the case of Data Inspector, you can use Open a Dataset option then change the setting in the Reader Parameters. Both ways should allow you to see the geometry type as fme_donut.

I hope this answers your question!

Emma


Reply