osmlab / labuildings

Los Angeles County building import
BSD 3-Clause "New" or "Revised" License
45 stars 14 forks source link

Fix split buildings #104

Closed maning closed 5 years ago

maning commented 8 years ago

LA City data was split to the parcel boundaries resulting to small polygons that should be part of the larger building (see: #71). We fix this during the import by using the Auto-tools plugin in JOSM but there are instances (prior to using Auto-tools) when this wasn't fixed.

We ran a detection for split buildings by analyzing size and shapes of buildings using OSM-QA-tiles, turf and tilereduce. Basic steps below:

Properties Description
_area Area of the polygon (meter^2)
_perimeter Perimeter (meter)
_shape Shape factor. Circles - approach a value of 100.00, squares 78.00, thin thread-like object have the lowest shape factor approaching 0. (4 * PI * Area) / (Perimeter^2)

The general idea is that small (_area) buildings are more compact (circles and squares) while large buildings are complex and wiggly. The reverse should be invalid buildings.

screen shot 2016-08-04 at 15 07 21

After several trials, we came up with an acceptable thresholds for split buildings.

return (p.properties._area <= 13 && p.properties._shape <= 76) ||
    (p.properties._area > 13 && p.properties._area <= 30 && p.properties._shape <= 52) ||
(p.properties._area > 30 && p.properties._area < 150 && p.properties._shape <= 17);

Trial Results

A for ~800 samples have the following results:

Category N %
👍 (valid detection) 661 81.60
👎 (invalid detection) 147 18.15
¯\_(ツ)_/¯ (Don't know) 2 0.25

Valid detection

valid_small_splits

valid_large_split
Thin/narrow rectangles

valid_traingles
Triangles

valid_diagonal
Diagonal cuts

Invalid detection

thin_roofs_on_catwalks
Roofs that connect other building

invalid_small_touching
Small buildings the slightly touches another building

invalid_apartments
Small square building that connects two apartment building complexes

These are just initial results and we can tweak the thresholds as we continue. I think the ~81% valid detection is good enough for the community to review and fix.

Dump of split buildings here (~4k buildings).

Next actions

jschleuss commented 8 years ago

Here's the MapRoulette challenge: http://maproulette.org/map/419

I think it's easier to edit the data in JOSM (if you allow remote control).

maning commented 8 years ago

Tested the maproulette task, some observations:

  1. Its hard to see the error at z19 (ticket).
  2. After loading in JOSM, its hard to see which of the buildings was identified as an error. Can we configure the task to select the way when loaded in JOSM? In the GeoJSON, the way id is in the @id property. AFAIK, this is possible.
  3. Using iD, we cannot do what our JOSM plugin does for merging tags with Auto-tools. Is this OK for the user to decide which tag to maintain?
maning commented 8 years ago

Posted a diary for the community to help in fixing: http://www.openstreetmap.org/user/manings/diary/39230

Current metrics as of today, let's watch if this improves after a week.

screen shot 2016-08-09 at 15 48 42

maning commented 8 years ago

@jschleuss @cityhubla Let's share this maproulette project to MaptimeLA.

jschleuss commented 8 years ago

Yep! Meetup this Thursday will promote fixing split buildings.

maning commented 5 years ago

Lol! Just saw that this was done. screen shot 2019-02-25 at 17 25 00

72% positive detection rate is not so bad.