Skip to content

Commit

Permalink
also dedupe building points coming from a relation, for #130
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Jul 6, 2020
1 parent bde4faf commit b701fcf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions convert_osm/src/osm_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,15 @@ pub fn extract_osm(
.next()
.and_then(|id| id_to_way.get(&id))
{
if pts.len() < 3 {
let mut deduped = pts.clone();
deduped.dedup();
if deduped.len() < 3 {
continue;
}
map.buildings.insert(
OriginalBuilding { osm_way_id: rel.id },
RawBuilding {
polygon: Polygon::new(pts),
polygon: Polygon::new(&deduped),
public_garage_name: None,
num_parking_spots: 0,
amenities: get_bldg_amenities(&tags),
Expand Down
10 changes: 10 additions & 0 deletions data/other_polygons/krakow.poly
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
krakow
1
19.91220474243164 50.075099742705696
19.926795959472656 50.039722339360004
19.975547790527344 50.04810065472004
19.974689483642578 50.07587092194771
19.940528869628906 50.07917583535689
19.91220474243164 50.075099742705696
END
END

0 comments on commit b701fcf

Please sign in to comment.