Opened 7 years ago
Last modified 7 years ago
#16262 assigned enhancement
[PATCH] Add BuildingOutsideResidentialArea test.
Reported by: | marxin | Owned by: | marxin |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core validator | Version: | |
Keywords: | Cc: | qeef |
Description
New validation useful for HOTOSM tasks.
Attachments (1)
Change History (12)
by , 7 years ago
Attachment: | 0001-Add-BuildingOutsideResidentialArea-test.patch added |
---|
follow-up: 3 comment:1 by , 7 years ago
comment:2 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 7 years ago
Replying to Don-vip:
Only residential buildings should be checked (house, apartments, etc.). We won't raise a warning for industrial buildings, farms, etc.
I'd like to get #10391 working first so the whole test could be written in MapCSS with something like that:
*[building=house] ∉ *[landuse=residential] { throwWarning: tr("{0} not inside {1}", "{0.tag}", "{2.key}"); }
Fully agree with you. Looks the #10391 is open for quite some time. I will take a look whether I can implement that.
comment:4 by , 7 years ago
I see two possible problems with usage of mapcss:
- we consider a single standing buildings as valid to not be in a residential area
- my current approach has a parameter that drives the proximity of buildings
comment:5 by , 7 years ago
Cc: | added |
---|
comment:6 by , 7 years ago
Reporter: | changed from | to
---|
follow-up: 8 comment:7 by , 7 years ago
I don't know about special HOT use cases, but landuse "describe the primary use of land", so even several buildings near to each other with at least one as building=residential are fine within another landuse=* area. This can be OK.
It would be OK as info level as it could indeed reveal tagging mistakes, but I think the number of false positives would be too high as this would fit in warning level. (I didn't yet test the test though.)
follow-up: 9 comment:8 by , 7 years ago
Replying to Klumbumbus:
I don't know about special HOT use cases, but landuse "describe the primary use of land", so even several buildings near to each other with at least one as building=residential are fine within another landuse=* area. This can be OK.
When considering HOT mapping, the number of buildings needed for residential area vary between 2 to 4 (depends on task instructions).
Related question - would it be possible to check out the number of buildings not in the residential area when written in MapCSS? I'm not skilled in MapCSS so just if it's even possible.
follow-up: 10 comment:9 by , 7 years ago
Replying to qeef:
Related question - would it be possible to check out the number of buildings not in the residential area when written in MapCSS?
That's not possibe in mapcss afaik. (wiki:Help/Styles/MapCSSImplementation)
comment:10 by , 7 years ago
Replying to Klumbumbus:
Replying to qeef:
Related question - would it be possible to check out the number of buildings not in the residential area when written in MapCSS?
That's not possibe in mapcss afaik. (wiki:Help/Styles/MapCSSImplementation)
There are couple of functions used in mapcss rules:
src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
One example is:
/* #12561 - building larger than Aalsmeer Flower Auction (518000) and Tesla factory (510000) */ area:closed[building][building!=no][eval(areasize()) > 520000] { throwError: tr("Too large building"); }
Maybe we can add function closebuildings
which would return # of buildings that are 'close' to a building.
comment:11 by , 7 years ago
Apart from that I did small experiment with MAPCSS (using work-around suggested in #10391). But it selected all buildings:
+area:closed[building][building!=no] ∈ area:closed:areaStyle[landuse=residential][landuse] { + set building_in_residential_area; +} + +area:closed[building][building!=no]!.building_in_residential_area { + throwWarning: tr("XXX building outsize a residential area"); +}
Thoughts why?
Only residential buildings should be checked (house, apartments, etc.). We won't raise a warning for industrial buildings, farms, etc.
I'd like to get #10391 working first so the whole test could be written in MapCSS with something like that: