Skip to content

Commit b2ca08b

Browse files
authored
Create hipped-bug
1 parent d27519e commit b2ca08b

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

test/hipped-bug

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
test('Hipped Roof Exception', () => {
2+
const data = `<osm version="0.6" generator="openstreetmap-cgimap 2.0.1 (2514269 spike-07.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
3+
<node id="1028052161" visible="true" version="3" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9515658" lon="30.7065509"/>
4+
<node id="1028052187" visible="true" version="3" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9514342" lon="30.7055416"/>
5+
<node id="1028052218" visible="true" version="3" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9515417" lon="30.7054858"/>
6+
<node id="1028052228" visible="true" version="3" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9516732" lon="30.7064950"/>
7+
<node id="4675313421" visible="true" version="3" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9514484" lon="30.7055343">
8+
<tag k="amenity" v="telephone"/>
9+
<tag k="operator" v="Россвязь"/>
10+
<tag k="payment:telephone_cards" v="yes"/>
11+
<tag k="phone" v="+7 81370 75189"/>
12+
</node>
13+
<node id="12149699806" visible="true" version="2" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9514791" lon="30.7058858">
14+
<tag k="addr:flats" v="7-12"/>
15+
<tag k="entrance" v="staircase"/>
16+
<tag k="ref" v="2"/>
17+
</node>
18+
<node id="12149699816" visible="true" version="2" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9515445" lon="30.7063876">
19+
<tag k="addr:flats" v="19-24"/>
20+
<tag k="entrance" v="staircase"/>
21+
<tag k="ref" v="4"/>
22+
</node>
23+
<node id="12149699817" visible="true" version="2" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9515196" lon="30.7061964">
24+
<tag k="addr:flats" v="13-18"/>
25+
<tag k="entrance" v="staircase"/>
26+
<tag k="ref" v="3"/>
27+
</node>
28+
<node id="12149699818" visible="true" version="2" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027" lat="59.9514544" lon="30.7056962">
29+
<tag k="addr:flats" v="1-6"/>
30+
<tag k="entrance" v="staircase"/>
31+
<tag k="ref" v="1"/>
32+
</node>
33+
<way id="88514597" visible="true" version="4" changeset="156067245" timestamp="2024-09-01T18:20:50Z" user="masmirnov" uid="16256027">
34+
<nd ref="1028052187"/>
35+
<nd ref="12149699818"/>
36+
<nd ref="12149699806"/>
37+
<nd ref="12149699817"/>
38+
<nd ref="12149699816"/>
39+
<nd ref="1028052161"/>
40+
<nd ref="1028052228"/>
41+
<nd ref="1028052218"/>
42+
<nd ref="4675313421"/>
43+
<nd ref="1028052187"/>
44+
<tag k="addr:city" v="Воейково"/>
45+
<tag k="addr:housenumber" v="1"/>
46+
<tag k="addr:place" v="Воейково"/>
47+
<tag k="building" v="apartments"/>
48+
<tag k="building:cladding" v="brick"/>
49+
<tag k="building:levels" v="3"/>
50+
<tag k="roof:shape" v="hipped"/>
51+
</way>
52+
</osm>`;
53+
const bldg = (new Building('88514597', data);
54+
const meshes = bldg.render();
55+
expect(meshes.length).toBe(1);
56+
});

0 commit comments

Comments
 (0)