Skip to content

Commit 7e08de6

Browse files
authored
Update building.test.js
1 parent d27519e commit 7e08de6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/building.test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,38 @@ test('Part must be within outline', () => {
345345
expect(new Building('11', data).parts.length).toBe(0);
346346
});
347347

348+
test('Multipolygon Part must be within outline', () => {
349+
const data = `<?xml version="1.0" encoding="UTF-8"?>
350+
<osm>
351+
<node id="1" lat="0.001" lon="0.001"/>
352+
<node id="2" lat="0.001" lon="0"/>
353+
<node id="3" lat="0" lon="0"/>
354+
<node id="4" lat="0" lon=".0005"/>
355+
<node id="5" lat="0" lon=".001"/>
356+
<node id="6" lat=".0001" lon=".001"/>
357+
<node id="7" lat=".0001" lon="0.005"/>
358+
<way id="11">
359+
<nd ref="1"/>
360+
<nd ref="2"/>
361+
<nd ref="3"/>
362+
<nd ref="1"/>
363+
<tag k="building" v="apartments"/>
364+
</way>
365+
<way id="22">
366+
<nd ref="4"/>
367+
<nd ref="5"/>
368+
<nd ref="6"/>
369+
<nd ref="7"/>
370+
<nd ref="4"/>
371+
</way>
372+
<relation id="40">
373+
<member type="way" ref="22" role="outer"/>
374+
</relation>
375+
</osm>
376+
`;
377+
expect(new Building('11', data).parts.length).toBe(0);
378+
});
379+
348380
window.printError = printError;
349381

350382
var errors = [];

0 commit comments

Comments
 (0)