Skip to content
Novus Examples
osm1.2 KB

OSM XML — Multipolygon Relation With Outer and Inner Ways

Wither Lake and its island as an OSM multipolygon relation: two closed ways tagged separately and joined by a relation whose members carry outer and inner roles. OSM has no polygon primitive at all, so reconstructing the hole means reading the relation rather than the ways.

Preview — first 39 linesosm
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Novus Examples geospatial fixtures">
  <bounds minlat="46.95" minlon="-12.64" maxlat="47.14" maxlon="-12.36"/>
  <node id="-1" lat="47.04" lon="-12.52"/>
  <node id="-2" lat="47.04" lon="-12.495"/>
  <node id="-3" lat="47.053" lon="-12.488"/>
  <node id="-4" lat="47.061" lon="-12.506"/>
  <node id="-5" lat="47.052" lon="-12.529"/>
  <node id="-6" lat="47.048" lon="-12.51"/>
  <node id="-7" lat="47.0525" lon="-12.511"/>
  <node id="-8" lat="47.053" lon="-12.504"/>
  <node id="-9" lat="47.047" lon="-12.503"/>
  <way id="-101">
    <nd ref="-1"/>
    <nd ref="-2"/>
    <nd ref="-3"/>
    <nd ref="-4"/>
    <nd ref="-5"/>
    <nd ref="-1"/>
    <tag k="natural" v="water"/>
  </way>
  <way id="-102">
    <nd ref="-6"/>
    <nd ref="-7"/>
    <nd ref="-8"/>
    <nd ref="-9"/>
    <nd ref="-6"/>
    <tag k="place" v="island"/>
  </way>
  <relation id="-201">
    <member type="way" ref="-101" role="outer"/>
    <member type="way" ref="-102" role="inner"/>
    <tag k="type" v="multipolygon"/>
    <tag k="natural" v="water"/>
    <tag k="water" v="lake"/>
    <tag k="name" v="Wither Lake"/>
  </relation>
</osm>

Specifications

Format
OSM XML 0.6
Nodes
9
Ways
2
Relations
1
Member Roles
outer, inner
Identifiers
negative (not-yet-uploaded convention)
Encoding
UTF-8
Line Endings
LF

Testing contract

Expected to pass
Scenario
Convert the relation to a GeoJSON Polygon.
Expected result
One Polygon with an exterior and an interior ring is produced; a converter that reads only the ways emits two unrelated closed lines and loses the hole.

What is a .osm file?

An .osm file holds OpenStreetMap data in the project's XML schema. The document contains node, way, and relation elements, each with an id, version, and free-form tag children; ways reference their nodes in order, and relations reference members by type, id, and role. It is the format returned by the OSM API and by Overpass queries, and the input to most OSM-based routing and rendering toolchains.

How to use this file

Use an example .osm file to test OSM parsers, tag filters, and routing-graph builders, checking that way node ordering is preserved, that relation roles are read, and that referenced ids missing from the extract are reported rather than skipped silently.

How to use this file for testing

“OSM XML — Multipolygon Relation With Outer and Inner Ways” is a deterministic Novus Examples fixture for Geospatial, Conversion testing, Data import. GeoJSON, GPX, and KML files with points, lines, polygons, and tracks — for testing map tools, route parsers, and geo importers.

Documented properties for this file: 9 nodes · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Geospatial fixtures publish one invented territory across formats, with the coordinate reference system and feature counts documented in specs. Convert or reproject and diff against the twin in the same group; edge-case geometries state exactly which assumption they are built to break.

Generated by generation/geospatial.py. Free for any use, no attribution required — license.