summaryrefslogtreecommitdiff
path: root/navit/maptool/misc.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-05-15 19:25:11 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2010-05-15 19:25:11 +0000
commitf6c38185d6b6d559b198f9d32d3023eae81085f1 (patch)
treee548f72ba6408ec6f3cb06ad2ee28e39c1d51f44 /navit/maptool/misc.c
parentb13c44db5c5c363f8aa6dbd346e801ee75c5ec89 (diff)
downloadnavit-f6c38185d6b6d559b198f9d32d3023eae81085f1.tar.gz
Add:maptool:Experimental boundary polygon matching
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3253 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/maptool/misc.c')
-rw-r--r--navit/maptool/misc.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/navit/maptool/misc.c b/navit/maptool/misc.c
index 02ec8a4ce..5e5f1e5ef 100644
--- a/navit/maptool/misc.c
+++ b/navit/maptool/misc.c
@@ -95,6 +95,40 @@ contains_bbox(int xl, int yl, int xh, int yh, struct rect *r)
return 1;
}
+int
+bbox_contains_coord(struct rect *r, struct coord *c)
+{
+ if (r->h.x < c->x)
+ return 0;
+ if (r->l.x > c->x)
+ return 0;
+ if (r->h.y < c->y)
+ return 0;
+ if (r->l.y > c->y)
+ return 0;
+ return 1;
+}
+
+int
+bbox_contains_bbox(struct rect *out, struct rect *in)
+{
+ if (out->h.x < in->h.x)
+ return 0;
+ if (out->l.x > in->l.x)
+ return 0;
+ if (out->h.y < in->h.y)
+ return 0;
+ if (out->l.y > in->l.y)
+ return 0;
+ return 1;
+}
+
+long long
+bbox_area(struct rect *r)
+{
+ return ((long long)r->h.x-r->l.x)*(r->h.y-r->l.y);
+}
+
void
phase1_map(GList *maps, FILE *out_ways, FILE *out_nodes)
{