]> mj.ucw.cz Git - leo.git/blobdiff - map.c
Průvodce: More styling
[leo.git] / map.c
diff --git a/map.c b/map.c
index 8f318e23e9427bafa5a65a7baf5417a2d1ed68ad..c9c2635e0716218382063c893c407a2b6f606198 100644 (file)
--- a/map.c
+++ b/map.c
@@ -4,7 +4,8 @@
  *     (c) 2014 Martin Mares <mj@ucw.cz>
  */
 
-#include <ucw/lib.h>
+#include "leo.h"
+
 #include <ucw/conf.h>
 #include <ucw/gary.h>
 #include <ucw/mempool.h>
@@ -13,8 +14,8 @@
 #include <stdio.h>
 #include <math.h>
 
-#include "leo.h"
 #include "osm.h"
+#include "shp.h"
 #include "map.h"
 #include "css.h"
 #include "sym.h"
@@ -44,6 +45,7 @@ static const char * const map_formats[] = {
   "invalid",
   "osmxml",
   "fixed",
+  "shape",
 };
 
 static struct cf_section map_source_cf = {
@@ -234,12 +236,22 @@ static void map_load_source(struct data_source *ds)
       break;
     case DATA_SOURCE_FIXED:
       msg(L_INFO, "Adding fixed objects");
+      if (!ds->file)
+       ds->file = "fixed";
       fixed_add();
       break;
+    case DATA_SOURCE_SHAPE:
+      msg(L_INFO, "Parsing %s as shape file", ds->file);
+      if (!ds->file)
+       die("Shape data sources must have a file name");
+      shp_parse(ds->file);
+      need_proj = 1;
+      break;
     default:
       die("Invalid data source format");
     }
 
+  osm_stats();
   if (debug_dump_source)
     {
       puts("=== Source data ===");