-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggregation of buildings #6
base: buildings
Are you sure you want to change the base?
Conversation
@jeleniste do you have any info about the extra processing time required for calculating these aggregated shapes? |
@klokan it depends on tolerance for grouping, actually is ten meters (picture with pink and green polygons has lower, five, or four meters). Using ten meters tolerance for grouping isn |
@jirik Could you please provide initial feedback on the direction of development? |
From my point of view it behaves well in case of dense built-up areas. Suggestions
Performance Visual comparison |
@jirik Ok, i didnt know, how i can set zres into my sql before. I will get it there using this template. |
Exactly, you can see it in this sample. Thanks for your work! |
@jirik i can create recordset returning functions iterating over aggregated data and create matview from it. But it means use for loop and it can cost some calculating time (because of iterating). And, in my opinion, it isnt good solution use database triggers for computationally difficult jobs. For jobs like this is better to trigger refresh from application, because if some insert will be in more parts, matview will be refreshed on every statement. |
@jirik version with matview commited. Without triggers, in this moment, i should look on triggering mechanism on another layers. |
@jirik update triggers added, but im not able to test, if it works well |
@jirik could you test this, or look at it, if it is OK? Maybe calculation time be worse, because of change to matviews, in this case i can use function. |
@jeleniste Thanks. I will look at it in following days. At this moment I am struggling with more critical issues :-/ |
@klokan @jeleniste Unfortunately, I made a mistake when I was measuring the performance last time. Sorry for that. I measured it more precisely this time and results seem not-so-good. For Switzerland the critical import-sql step took about 6 extra minutes (compared to previous 0m). Switzerland has about 2.25 millions of buildings, the whole planet about 288 millions, that's about 128 times more. 128 * 6m = estimated increase 13h (in case of linear time complexity). But I am really not sure about what time complexity we can expect. Performance for Switzerland Z0-Z14, buildings only.
@jeleniste The code looks good to me now. Probably these two lines should be removed before merge. |
done |
This is an initial idea for implementation of aggregation of small buildings - which could be used on zoom 13 (or upper zooms).
Now we simply throw away small buildings in OpenMapTiles - so dense centres of towns such as Zurich with many small buildings practically disappear from the map. This PR is trying to fix the issue, see new green polygons:
(pink buildings are now in our map on z13 - red are removed)
We need feedback on the approach. Probably some very early test on performance would be good.
Values for aggregation should not be fixed constants - but probably derived from zres.
Comments on how to prepare this for merging would be helpful.
This is a possible very visual feature for OpenMapTiles v3.9.