-
Notifications
You must be signed in to change notification settings - Fork 173
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
enhancement:maptool:slice big polygons into smaller parts #906
Conversation
This commit allows to slice all polygons (except poly_water_sliced) into squares so that they fit into smaller map tiles. Holes if present are correctly sliced as well. This has the advantage that they do not need to be processed albeit not being displayed, and navit-planet-extractor can filter them out. This has the disadvantage that the big polygons are displayed checkered if the corresponding itemgra in config features an outline. TODO: Slice already on polygon creation. Currently the slicing has to be performed twice, because of tile preprocessing and saving is done in seperate steps from the tempfiles. TODO: Make the trigger for slicing configurable. Right now it slices everything smaller than tile level 4.
If the question arises, why i didn't reuse the coastline code which somehow does something quite similiar, the answer is simply: I don't dare. Same is somehow true for the place I added the slicing. I know this is processed twice, but as I do not fully understand the tile selection code as well, this seemed to be the less intrusive way of doing this. And for exactly this reason I will not care for CodeFactor reporting about code doubling. (my version uses double, while the geom.c version uses int which overflows when used on map coordinates instead of display pixels. And float is OK for the maptool. Definitely.) |
This commit treats multipolygon members with empty role as "outer". This rescues a lot of ancient or wrong created multipolygon relations into the binfile.
Remove some stars to fix doxygen doc.
Seems to be OK and do what is wanted. Currently world is processing. Will try to post the sliced elements here. Not so many at all, but some are really huge. |
For a quick solution just unpack the planet and repack it into a zipfile which only contains the wanted pices. The empty files should not ne necessary any more. |
@jkoan Unfortunately it's not that easy. The 64bit zip file support of Navit is quite crippled and based on a very old zip file specification, but required for any map bigger than 4GiB. So your nowadays "zip" tool creates a zip file that's valid but will happily cause Navit to segfault. I'm in progress of writing a small application allowing to extract things creating Navit compatible files. And in the long run we should update / fix Navits zip file support. But that's another story. |
Couldent try it out myself, but probably this could help as well, in our repo deep deep in the source i found this https://github.com/navit-gps/navit/blob/trunk/navit/script/map_index.php it looks loke this is some kind of old state of the map extraction server. As well ther seems to be a cli option too https://github.com/navit-gps/navit/blob/trunk/navit/script/mapextract.php |
Use overlapping for slicing big polygons. Neccesary because Navit's tile system for tiles without overlap and those with is crippled. This produces ugly results, but sorts the slices to correct tiles.
The tool to extract portions from navit bin file is here: https://github.com/metalstrolch/navit_binfile_extractor @jkoan The PHP version in trunk will fail, as it will calculate tile bboxes wrong. See #918 |
World processed without errors. Seems to do what it is expected to do, including the somehow suboptimal look of the sliced polygons. But there are not so many at all. For those being curious, there's the actual list:
|
Will wait for result on #894 before proceeding. |
Confirmed to do what it should. Preparing to merge. |
This commit allows to slice all polygons (except poly_water_sliced) into squares so that they fit into smaller map tiles. Holes if present are correctly sliced as well. This has the advantage that they do not need to be processed albeit not being displayed, and navit-planet-extractor can filter them out. This has the disadvantage that the big polygons are displayed checkered if the corresponding itemgra in config features an outline. TODO: Slice already on polygon creation. Currently the slicing has to be performed twice, because of tile preprocessing and saving is done in seperate steps from the tempfiles. TODO: Make the trigger for slicing configurable. Right now it slices everything smaller than tile level 4.
This commit allows to slice all polygons (except poly_water_sliced) into squares so that they fit into smaller map tiles. Holes if present are correctly sliced as well. This has the advantage that they do not need to be processed albeit not being displayed, and navit-planet-extractor can filter them out. This has the disadvantage that the big polygons are displayed checkered if the corresponding itemgra in config features an outline. TODO: Slice already on polygon creation. Currently the slicing has to be performed twice, because of tile preprocessing and saving is done in seperate steps from the tempfiles. TODO: Make the trigger for slicing configurable. Right now it slices everything smaller than tile level 4.
) This commit allows to slice all polygons (except poly_water_sliced) into squares so that they fit into smaller map tiles. Holes if present are correctly sliced as well. This has the advantage that they do not need to be processed albeit not being displayed, and navit-planet-extractor can filter them out. This has the disadvantage that the big polygons are displayed checkered if the corresponding itemgra in config features an outline. TODO: Slice already on polygon creation. Currently the slicing has to be performed twice, because of tile preprocessing and saving is done in seperate steps from the tempfiles. TODO: Make the trigger for slicing configurable. Right now it slices everything smaller than tile level 4.
This commit allows to slice all polygons (except poly_water_sliced) into
squares so that they fit into smaller map tiles. Holes if present are
correctly sliced as well.
This has the advantage that they do not need to be processed albeit not
being displayed, and navit-planet-extractor can filter them out.
This has the disadvantage that the big polygons are displayed checkered
if the corresponding itemgra in config features an outline.
TODO: Slice already on polygon creation. Currently the slicing has to be
performed twice, because of tile preprocessing and saving is done in
seperate steps from the tempfiles.
TODO: Make the trigger for slicing configurable. Right now it slices
everything smaller than tile level 4.
Hopefully fixes #894