summaryrefslogtreecommitdiff
path: root/navit/maptool/misc.c
diff options
context:
space:
mode:
authorStefan Wildemann <metalstrolch@users.noreply.github.com>2019-09-03 09:14:39 +0200
committerGitHub <noreply@github.com>2019-09-03 09:14:39 +0200
commitb643162c355231eed6fd9c76731b816391d808dc (patch)
treebbf4401f1a1ef49fcf684a1366a58d00a135b58b /navit/maptool/misc.c
parent94834b753cc9c2e1e668feb887683416538861ce (diff)
parentb0d66a6c4ac6a1cf63e676ba24fd3061686cea15 (diff)
downloadnavit-b643162c355231eed6fd9c76731b816391d808dc.tar.gz
core:feature:multipolygon support #824
This adds multi polygon support to navit binfile. It uses the following attempt: - Multipolygon "outer" polygons are converted to polygons inside the binfile map. - Multipolygon "inner" polygons are added as attributes to the outer polygon. - New method is added to graphics to draw polygons with "holes" (currently qt5, gtk_drawing_area, and Windows (except CE) but at least sdl can do this as well) Since the binfile format stays structural intact, new maps can be processed by old Navit versions, except they draw the multipolygons without their "holes", New version of Navit can still read old maps of course. Limitations: - In the maps, there are multipolygons having other multipolygons as inner or outer. These are unsupported and fail the member check. According to https://wiki.openstreetmap.org/wiki/Relation:multipolygon these are invalid. And the current web display cannot display them as well. See https://www.openstreetmap.org/relation/5587300 . Don't know if this get a standard mapping feature. Hopefully not. - Multipolygon polygons tend to become huge. No algorithm to split them into smaller chunks is contained. But my personal opinion is to exclude some types of polygons from map altogether on constrained devices over not including or artificial cutting the multipolygon ones. Btw. there are already huge traditional polygons as well. - Processing the map required more disk space as one cannot early drop ways with unknown tags any more, as they could be part of multipolygon. Maptools -n flag works as expected for the final result though. Additional changes: - Default to 64 bit zip files on maptool
Diffstat (limited to 'navit/maptool/misc.c')
-rw-r--r--navit/maptool/misc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/navit/maptool/misc.c b/navit/maptool/misc.c
index 1c30b94f7..9b1c72da2 100644
--- a/navit/maptool/misc.c
+++ b/navit/maptool/misc.c
@@ -213,12 +213,20 @@ int item_order_by_type(enum item_type type) {
return max;
}
+static inline int filter_unknown(struct item_bin * ib) {
+ if(ignore_unknown && (ib->type==type_point_unkn || ib->type==type_street_unkn || ib->type==type_none))
+ return 1;
+ return 0;
+}
+
static void phase34_process_file(struct tile_info *info, FILE *in, FILE *reference) {
struct item_bin *ib;
struct attr_bin *a;
int max;
while ((ib=read_item(in))) {
+ if(filter_unknown(ib))
+ continue;
if (ib->type < 0x80000000)
processed_nodes++;
else
@@ -239,6 +247,8 @@ static void phase34_process_file_range(struct tile_info *info, FILE *in, FILE *r
int min,max;
while ((ib=read_item_range(in, &min, &max))) {
+ if(filter_unknown(ib))
+ continue;
if (ib->type < 0x80000000)
processed_nodes++;
else
@@ -278,6 +288,8 @@ static int phase34(struct tile_info *info, struct zip_info *zip_info, FILE **in,
void dump(FILE *in) {
struct item_bin *ib;
while ((ib=read_item(in))) {
+ if(filter_unknown(ib))
+ continue;
dump_itembin(ib);
}
}